Slashdot Mirror


New Cocoa/Perl Bridge Released

bsartist writes "I've released the first version of a Cocoa/Perl bridge that I call CamelBones. It's alpha-quality but functional enough for the example application, a POD reader similar to MacPerl's Shuck, to be written entirely in Perl." There are other projects like this that have been started, though this is the first one I've seen (since the Rhapsody days, anyway) that has code available.

27 comments

  1. What about Perl development? by Erasei · · Score: 2, Interesting

    I like to see people out there using Perl. I guess it's mainly because it's the language I use almost exclusively. I just bought a new iBook (14.1lcd, 600mhz, combo drive model), and I can say the main selling point for me was the Darwin base. To be able to have a Perl compiler with me wherever I go is _very_ handy.

    Is it just my lack of googling skills, or are there +no+ Perl development tools for OS X? I mean, Apple designed a beautiful and wonderfully easy to use application development suite with ProjectBuilder and InterfaceBuilder that even I can use, and have written a few applescript apps for fun with it.

    Why would Apple not include a Perl framework for ProjectBuilder? They include one for java, and even applescript, but not for Perl.

    Anyone know of any good Perl development suites out there?

    --
    visit my free wallpaper collection, wp.erasei.com
    1. Re:What about Perl development? by Anonymous Coward · · Score: 1, Interesting

      Why stop at Perl, could we have frameworks for Python, RealBasic etc...?

      Make ProjectBuilder the best place for all programming

    2. Re:What about Perl development? by pudge · · Score: 3, Informative

      I would guess because most people don't care. I use BBEdit under Mac OS X to write Perl and am perfectly happy with it. I wouldn't ever use ProjectBuilder to do Perl projects ... unless they are tied to something like this, where you're doing Perl to tie into Cocoa. Maybe I am abnormal, though.

    3. Re:What about Perl development? by Erasei · · Score: 2


      Yeah, that's what I mean. Since we now have some tools (ie: the one this article is about) to get embeded Perl into our ObjC projects, you'd think that Apple would let write the Perl in ProjectBuilder as well. Granted, Apple isn't writing this embedded Perl funcationality, but I think it would be handy.

      --
      visit my free wallpaper collection, wp.erasei.com
    4. Re:What about Perl development? by tarzan353 · · Score: 2, Informative
      BBEdit is great for Perl development.

      You can run scripts, check syntax, even access perldocs from within BBEdit on a highlighted function name.


      I can't forsee Project Builder including Perl... PB is for creating applications, not writing scripts.


    5. Re:What about Perl development? by RevAaron · · Score: 2

      See my post. Use Google. There are frameworks for other languages (including Python), but there could always stand to be more. Why create Cocoa bindings for REALbasic? What would that accomplish?

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    6. Re:What about Perl development? by bsartist · · Score: 1

      Strictly speaking, Project Builder is only needed the first time you build your project. After that, you can use BBEdit's "Open Hidden" function to edit your Perl code, which is stored in the Resource folder.

      --
      Lost: Sig, white with black letters. No collar. Reward if found!
    7. Re:What about Perl development? by RevAaron · · Score: 4, Informative

      Why would you have to have Apple "let" you use PB to write perl? Have a look a CamelBridge, the very project that this post is about, look at the Doc section of the website. You can write the perl scripts in PB, even use IB to create the GUI. The ShuX POD browser is a native, double-clickable GUI app for OS X that's written in perl.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    8. Re:What about Perl development? by RevAaron · · Score: 2

      A lot of people seem to love BBEdit. Not sure why, that feature list you cite isn't really outstanding for an IDE. Not everyone likes a real IDE, I understand that. PB isn't much of a "real" IDE compared to a Smalltalk system though, either.

      But keep your eyes out. With this badass new CamelBones stuffs, I'm going to try and developer a Smalltalk-like IDE for perl. mmmm, NSBrowser. :)

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    9. Re:What about Perl development? by RevAaron · · Score: 2

      Frankly, besides the few perl IDEs that cost money, there doesn't seem to be any decent IDEs for perl on Linux or Win32, let alone OS X. I found an IDE for Win32 called "Open Perl IDE" that is OK, but it's only for Windoze. Most perl coders seem to think that having an IDE is wussy, but then again, using a more straight forward language is wussy too, so perhaps there's a connection. :P With this new bridge, I may give a whack at trying to make a little perl IDE. I'm talking about a "real" IDE, something Smalltalk-like, not some cheap hack. mmm, NSBrowser. :)

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    10. Re:What about Perl development? by bsartist · · Score: 1

      Why create Cocoa bindings for REALbasic? What would that accomplish?

      After the public flogging that the makers of REALBasic gave Cocoa, it would very nearly be worth the effort just to tweak their noses and be enter. :-)

      --
      Lost: Sig, white with black letters. No collar. Reward if found!
    11. Re:What about Perl development? by bsartist · · Score: 1

      Damn, a bit too quick on the trigger there... what I meant to say was...

      Why create Cocoa bindings for REALbasic? What would that accomplish?

      After the public flogging that the makers of REALBasic gave Cocoa, it would very nearly be worth the effort just to tweak their noses and be entertained by their reaction. :-)

      --
      Lost: Sig, white with black letters. No collar. Reward if found!
    12. Re:What about Perl development? by RevAaron · · Score: 2

      I apologize for for not being fun, but ...

      Seems like an awful lot of work for such a tiny amount of amusement. In general, a lot of Mac users and some Mac developers seem to think that Cocoa is better, just because. It would be a lot more worth while to create an IDE that used perl+CB as it's programming engine, and added the niceities of RB, but leaving the GUI design to IB. Now, there are a lot of people who don't use or much like perl (including me, but I'm trying to like it, desperately) and would want another language. While BASIC blows, if you're writing bindings, why not write them for some Free BASIC interpreter, and make a free RB, that was very well at dealing with and working with Cocoa? I think that'd get them back in a much more fatal way, if that's the point.

      One question for you... are you the Apple engineer that was working on this for the OS X build system, or is this a completely independent project?

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    13. Re:What about Perl development? by bsartist · · Score: 1

      My suggestion was totally a joke - yes, it would be far too much work to do, just for a few grins. I would hardly know where to begin. I haven't written anything in BASIC since, let me see, '94, when I was part of the team that wrote Internet Creator for Windows 3.1, in VB. (Yes, I've actually had VB code published - now my secret is out.)

      One question for you... are you the Apple engineer that was working on this for the OS X build system, or is this a completely independent project?

      No, that's not me. I heard about that project about a year ago, but I hadn't seen any signs of it being released or supported outside of Apple, so about two months ago, I decided to have a go at it myself. I downloaded the Python/ObjC bridge to study the technique they're using, studied the perlguts and perlapi man pages, and well, here we are.

      We have talked before, though, on MacSlash. I use the handle "sherm" over there.

      --
      Lost: Sig, white with black letters. No collar. Reward if found!
    14. Re:What about Perl development? by theolein · · Score: 0

      I thought the new Macperl runs in OSX?

    15. Re:What about Perl development? by RevAaron · · Score: 2

      A-ha! Hi! Well, thanks for the effort- it could just get me to use perl some even. :)

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  2. Excellent by medcalf · · Score: 3, Insightful

    I'm excited about this, and will certainly be watching it develop. There are times when embedding Perl into ObjC would be really helpful (for example, using Perl rather than TCL as an embedded tool language), and if this project works out, it will provide a very useful tool for the MacOS X developer community.

    -jeff

    --
    -- Two men say they're Jesus. One of them must be wrong. - Dire Straits
    1. Re:Excellent by bsartist · · Score: 1

      Calling Perl from Objective-C works now, although I haven't yet written any documentation for doing that.

      --
      Lost: Sig, white with black letters. No collar. Reward if found!
    2. Re:Excellent by marklark · · Score: 1
      Just wondering, considering your name (B.S. Artist), would you be full of it?

      Otherwise, work up that documentation. :^)

  3. Hell yeah! (and other bridges) by RevAaron · · Score: 3, Interesting

    This isn't the first XXXObjective-C bridge to come out for OS X. There's RubyCocoa, which works pretty well. Squeak has an (more generalized) Objective-C bridge. Lua has one. I believe the PyObjC bridge has released code as well, and works under OS X, although that project seems to be a lot more quiet than the others.

    Good to see this. I emailed the author about it coming out, and had a bad feeling it would never get released. (why? dunno, just a feeling) :)

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  4. OS X as a great scripting/RAD environment by RevAaron · · Score: 4, Informative

    One of the issues that hasn't really been solved on most platforms is the want to have a double-clickable app written in one of these high-level languages. In the case of RubyCocoa and CamelBridge, that problem is solved, thanks to OS X's awesome bundling system.

    Take ShuX, the POD viewer for OS X mentioned above, for example. It's written in perl, and aside the perl system that comes with OS X, all it requires is the CamelBridge.framework. When the user decompresses the ShuX tarball, they're presented with a .app- a double-clickable, first-class Mac OS X application. To the user, it appears native in every way. They could easily copy it to other drives and folders with no problems.

    They could stuff-it up and send it to a friend- and provided they that had the CamelBridge framework, the recipient could run the app with no fuss. No screwing around with extra dependencies, installing libs, making sure the .pl file is associated with the interpreter. If there are additional libraries that app requires, but aren't generally applicable, they can just be thrown in the Resources subfolder, along with the main.pl script. This isn't quite as big of a deal in perl, because of CPAN, but it could be a huge boon for those using other scripting languages.

    AFAIK, this problem hasn't been solved anywhere near this elegantly on other platforms. Keep the user experience very consistent and pleasing, but gives the developer all the option she wants! :)

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    1. Re:OS X as a great scripting/RAD environment by bsartist · · Score: 3, Insightful

      If there are additional libraries that app requires, but aren't generally applicable, they can just be thrown in the Resources subfolder, along with the main.pl script. This isn't quite as big of a deal in perl, because of CPAN,

      I was actually thinking that was a big deal, because of CPAN. For all but a few developer's machines, it's pretty safe to assume a bone-stock Perl configuration, with no CPAN modules installed. You can package CPAN modules with your app, so that the end user doesn't have to install them.

      --
      Lost: Sig, white with black letters. No collar. Reward if found!
    2. Re:OS X as a great scripting/RAD environment by RevAaron · · Score: 2

      Ah, I see what you mean. Well, all the same- OS X still presents a great solution to that problem. :)

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  5. Unicode? by jcr · · Score: 2

    I haven't been keeping up with Perl for the last few years, unfortunately. Is Perl fully capable of handling UTF-16 strings?

    I'd love to be able to use Perl for string-bashing within Cocoa apps, and unicode is rather critical for interoperability with NSString.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
    1. Re:Unicode? by larkost · · Score: 3, Informative

      While I don't have much experience using Unicode, perl does support UTF-8 cueently. For more details 'man perlunicode'. The next major version of perl will be built on UTF-16. Everything will be built so that internal representations are in UTF-16 (or at least seem to be... for speed's sake).

  6. Infobot by twiztidlojik · · Score: 0

    Now I can make a GUI for Infobot! Yay!!!

    --
    I will now redundantly add my name to the end of my post. You know, in case you forgot me or something.
  7. BBEdit by TheInternet · · Score: 2, Interesting

    A lot of people seem to love BBEdit. Not sure why, that feature list you cite isn't really outstanding for an IDE.

    I really like BBEdit as well. I'm not sure why, but I suspect it's at least partially because it doesn't try to be your operating system. It doesn't bog you down with masses of toolbars, tabs file browsers, etc. This is where HomeSite become unusable for me.

    There's no particular set of features that make BBEdit special. It may be the philoshopy the developers applied to the application more than anything -- it doesn't make any of those stupid really obvious mistakes that drive one insane. But certainly the focused approached to editing is a big lure. It gets out of your way and lets you focus on what you're doing.

    On the other hand, Project Builder is nice.

    - Scott

    --
    Scott Stevenson
    Tree House Ideas