http://qs321.pair.com?node_id=548835

logan has asked for the wisdom of the Perl Monks concerning the following question:

After a long and fruitful life, my laptop is dying. It served me well, but its time has passed and I'm looking to buy something new. Apple's laptops look dead sexy, but I haven't used a Mac in about 10 years and I'm unsure.

Before I plunk down $2-3000 for a new laptop, I'd like to hear what everyone else's experiences have been. Is development on the Mac as easy as it is with a standard Unix box? Are you able to use standard BSD perl modules off of CPAN? Has that changed with the new Intel Macs? Are there hidden pitfalls I should know about? Is it still simply a matter of vi/emacs or are there cool dev tools for perl available for the Mac? And finally, is it really worth it? Or am I better off just buying a Dell and installing Linux/BSD?

Finally, for anyone who actually works at Apple, is there a perl community over there?

-Logan
"Spockmate!"

Replies are listed 'Best First'.
Re: Perl on a Macintosh
by merlyn (Sage) on May 11, 2006 at 21:16 UTC
    A mac running Darwin/OSX is as capable for development as any Linux box. In fact, some would argue, even more capable.

    Keep in mind a few things:

    • The default filesystem is case-insensitive. Yeah, unlike all boxes in the Unix world. So, there's a few CPAN modules that blow up for that. You can either avoid those, or make a UFS filesystem to mount as needed.
    • Nearly any interesting "unix" tool is available either in Fink or DarwinPorts. However, neither of them cover the entire list of interesting things, and installing stuff from both will be troublesome and redundant. And for other things, you'll have to install things yourself anyway (like I build a daily updated version of Emacs from CVS, so that I can get a nice Carbon Emacs that acts Mac-like).
    • Yes, there is a Perl community at Apple, and Perl is fully supported on the Mac.
    • You can write XCode programs with a natural Mac GUI, using Perl code to implement the triggers, using Camelbones. By You, I mean someone smarter than me, because I still haven't gotten my head completely around it.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      The default filesystem is case-insensitive. Yeah, unlike all boxes in the Unix world.

      It's actually slightly worse than that... I don't recall the circumstances in which it's bitten me, but OSX's default filesystem is sometimes case-sensitive and sometimes (most of the time) not. I have no idea what the guys at Apple were thinking when they allowed that to happen.

      That single issue aside, though, I'm currently on my second PowerBook and have found it to be a wonderful platform, both for Perl development and for doing unixy things in general.

      The default filesystem is case-insensitive. Yeah, unlike all boxes in the Unix world. So, there's a few CPAN modules that blow up for that.
      Can you elaborate, and finger a few of those suckers?

      Windows is case insensitive too, so the same modules will blow up on Windows too. That may or may not matter, depending on how Unix-centric those modules are.

      Together with Mac-OSX, that makes a large part of the Perl community. I think that is not acceptable, but maybe that's just me...

      I think depending on the case of a file name to distinguish between two files, is a bad practice. Especially for Perl modules. Again, maybe that's just me...

Re: Perl on a Macintosh
by wazoox (Prior) on May 11, 2006 at 21:58 UTC

    My desktops are PCs running Linux, my laptop is an iBook running Mac OS X and they play perfectly well together. I installed X11 (I use it most of the time), and I have all tools I'm used to : gcc, vi, nedit, sed, perl... Actually I installed Linux too on this Mac, but I never use it :)

    The fantastic ability of the *Book to instant-sleep and instant-wake without a glitch is something you can't live without once you tried (I still have to see something nearly half as efficient under windows or Linux). Another incredibly useful Mac-OS tool is the ability to have many network configurations available and switch from one to another in a single click instantly.

    these features aren't important for a desktop, but they make macintosh laptops really better than the rest of the crop!

Re: Perl on a Macintosh
by borisz (Canon) on May 11, 2006 at 21:09 UTC
    I use a Powerbook and a Macmini for all my work. Buy it. It works fine.
    Boris
Re: Perl on a Macintosh
by chargrill (Parson) on May 11, 2006 at 22:23 UTC

    I do as much of my development on a mac as I possibly can, which sucks at the office because I'm forced to use wintel. MacPerl (pre OS-X) had a lot of gotcha's, but I haven't run into a single one on my powerbook.

    Some modules are hard to install via CPAN, specifically those that require certain libraries. Math::PARI comes to mind. Certain other modules with external dependencies can be helped along w/ fink, a very freebsd-ports-ish way of installing OSS libs.

    All in all though, for all the annoyances of Windows + cygwin, my inability to find a comfortable working linux/bsd distro/window manager to install on an intel machine, I can't help but wholeheartedly recommend a few extra bucks for a mac.



    --chargrill
    $,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}
Re: Perl on a Macintosh
by kwaping (Priest) on May 11, 2006 at 23:22 UTC
    I'm a longtime Mac user and unix lover, so OSX is basically a fantasy come true for me. The GUI is easy enough for anyone to use, yet the ability to open Terminal and have a unix prompt satisfies the most hardcore command-line junkies out there.

    I don't have much more to add over what previous posters have said, except that I love BBEdit for my Perl stuff.

    Update: I've put my money where my mouth is, and purchased a MacBook Pro (aka Intel laptop) for myself my wife. ;) One thing that REALLY impressed me was migrating applications and documents from our main iMac to the laptop. I connected a firewire cable between them, put the iMac into "target disk mode" and clicked Continue a few times on the laptop. Within two hours, the laptop was a clone of the desktop, including applications that ran without any extra configuration (which I had fully expected to do), network, logins - EVERYTHING. Truly an amazing piece of software.

    ---
    It's all fine and dandy until someone has to look at the code.
      Don't forget that much of what you get in BBEdit for $199 is offered for FREE from the same company in the Text Wrangler product! If you are more of a casual hacker, you may be able to save yourself some $$
Re: Perl on a Macintosh
by spiritway (Vicar) on May 11, 2006 at 23:51 UTC

    There are so many personal choices and preferences that it's really difficult to make any firm recommendations.

    I tend to buy Windows boxes, because they're around. Then I install Linux, if it will take. If not, I reinstall the Windows and live with it.

    Oddly, I do most of my development on the Windows computers, simply because my tools are mostly useful on Windows. Even ActiveState's Komodo, which runs on Linux, has features missing that appear in Windows.

    I have heard many good things about the new Mac's, but I've never used one.

    Probably best bet would be to go around and test drive the units that look promising, to see what seems to fit.

    BTW, Dell sometimes has laptops available for around $400. You'd probably need to get more memory, but it's something else to think about.

Re: Perl on a Macintosh
by graff (Chancellor) on May 12, 2006 at 00:35 UTC
    In case you rely on X-Windows stuff from the linux/unix world, X is also fully supported in macosx -- you just have to install the X development kit (source code for the X11R6/include/*.h files) in order to install Perl/Tk. There's nothing complicated about it; it just works. And you have the option of hooking up a usb 3-button mouse (button-2/scroll-wheel works as God intended), as well as getting used to the laptop's native 3-button emulation ("option-key + click" for button-2, "apple-key + click" for button-3), which isn't much of a problem, really.

    I've taken in a variety of sourceforge-style packages and installed them very easily on the mac ("./configure; make; sudo make install" -- but if the package has a file called "INSTALL", sometimes I have to rename that to "INSTALL.txt", because of the case-insenstive file name thing); I also use "sudo perl -MCPAN -e shell" a lot as well -- only rare problems with that (no more than I would have with linux, I expect).

    Yes, I'd say it's worth it.

Re: Perl on a Macintosh
by TedPride (Priest) on May 12, 2006 at 05:54 UTC
    I assume you're getting one of the new Intel-based Macs? Even if Mac OS itself gave you problems, the latest version of OS X comes with Boot Camp, which makes it extremely easy to partition and boot in Windows (or with a little more patience, a Unix clone, if you're not satisfied with the one at the base of Mac OS). Just install your favorite operating system and you're good to go :)

    I so want one, but I'll have to stifle my greed until one of my current computers dies.

      Actually, I was debating about the Intel Mac. I was given to understand that the clock speed on a Mac is actually much faster than the same clock speed on a Wintel box for reasons that escape me. Now that Macs are using Intel processors, is the distinction gone? Or was the reason that the Mac OS simply runs faster than Windows, making more efficient use of the CPU? Or was it all a load to begin with? If I opt for the Intel version, what am I really getting (besides Boot Camp)?

      -Logan
      "What do I want? I'm an American. I want more."

        Actually, I was debating about the Intel Mac. I was given to understand that the clock speed on a Mac is actually much faster than the same clock speed on a Wintel box for reasons that escape me.

        To oversimply slightly the argument was more like the PPC could do "more" per-clock cycle than an Intel processor, so just comparing CPUs on clock speed was comparing apples and oranges.

        Now that Macs are using Intel processors, is the distinction gone?

        Yes. Any speed differences now will be down to the OS rather than the CPU type. Whether that actually makes a difference I neither know nor care :-)

        If I opt for the Intel version, what am I really getting (besides Boot Camp)?

        You'll probably get a longer shelf life for the computer. Apple is moving away from PPC as fast as it can, and I imagine that attitude will make a difference during the lifetime of your machine.

        You'll get a faster computer for anything that's running Intel code (some Mac applications will be running on a virtual PPC until they are ported, so these will likely be slower than they would on a modern PPC).

        The more interesting thing you'll get is likely ports of software like VMware to the Mac in the near future. Virtualisation rocks!

        Basically - if you're a coder I would get an Intel box. About the only reason to go for a PPC is if you need to run software like Photoshop that's not been ported to run natively on the Intel under Mac OS X yet.

Re: Perl on a Macintosh
by dorward (Curate) on May 12, 2006 at 06:53 UTC

    Macs are quite capable, and I used one for almost a year in a previous job. That said, I wouldn't get one again - I found the UI increasing irritating as time went on, and got annoyed by the number of things (focus follows mouse being the prime example) that I took for granted in Linux-land, but came under the heading of "Shareware. Pay after 30 days." on the Mac.

    A Mac might suit you, and they do suit lots of Perl hackers, but it didn't suit me. I've had 18 months of recovery and am quite happy sticking to Linux (and I've just bought myself a new laptop from Novatech and slapped Fedora on it - very nice, and much better for my bank balance then anything from Apple ;).

      "Shareware. Pay after 30 days." Wait, what? This is the exact information I was looking for. Can you expand on this a bit? One of the reasons I'm looking at Macs is the bundled application suite combined with the unix core. Can you give me some specifics about what's actually shareware and what common unix stuff is shareware? I've been leaning towards making the trip to the Apple Store tomorrow, so anything you can tell me would be a great help.

      -Logan
      "Spockmate!"

        Well ... (remembering that I haven't used a Mac in 18 months so I might misremember details and things might have changed) ...

        Anything you can get for UNIX is almost certainly going to be available (and the usual collection of FOSS stuff is free), but things that run in X11 don't tie in nicely with the rest of the system.

        Apps designed for the Mac appear in the toolbar at the bottom of the screen, but anything running under X gets lumped into the icon for X. Drag and drop doesn't work smoothly between X apps and native apps. And so on...

        This means that, generally, you'll be wanting to do things with native apps whenever possible - but most of these are not FOSS.

        Then are the class of apps that fiddle with the GUI, so if you want (for instance) Focus Follows Mouse or Virtual Desktops, then you have to start forking out for software such as CodeTek Virtual Desktop.