I've been reading about the upcoming Itanium and AMD-64 chips. In them, the discussion has been that the OSes and some databases have been ported to handle 64-bit instruction sets, but that application developers have not.

I'm wondering

  1. Will Perl will be updated to handle 64-bit?
  2. How will that happen?
  3. How will that affect a Perl developer?
Ideally, you would recompile Perl to be 64-bit compatible, then run your programs without change. Or, will there be 64-bit pragmas? Is Perl5.x going to be the 32-bit standard and Perl6 the 64-bit?

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: 64-bit Perl
by Abigail-II (Bishop) on May 20, 2003 at 18:26 UTC
    Perl has been able to handle 64 bit integers and pointers for quite some time already. It's not so much a matter whether your hardware supports it, it's a matter whether your compiler supports it. Perl doesn't generate machine instructions, the compiler does.

    Perl can do either 64 bit integers, and 64 bit pointers, or both, and all the combinations are mutually binary incompatible. 64 bitness isn't something you turn on with a pragma, it's a Configure option.

    For more details, see the README file coming with the Perl distribution.

    Abigail

Re: 64-bit Perl
by Joost (Canon) on May 20, 2003 at 14:57 UTC
    As no-one replied, I'll put in my 0.02 euros.

    AFAK you can compile perl to use 64bit numbers, check perl -V for use64bitint and use64bitall. Whether or not this will play nice with non-standard XS modules depends (maybe even per platform). On my 32 bit linux machine compiling with long numbers will warn a lot when compiling XS modules.

    Then again, the details of all this are not very clear to me,
    YMMV.

    Joost

    -- #!/usr/bin/perl -np BEGIN{@ARGV=$0}s(^([^=].*)|=)()s; =Just another perl hacker\
Re: 64-bit Perl
by htoug (Deacon) on May 20, 2003 at 19:24 UTC
    As Abigail-II noted Perl *is* able to handle 64-bit and has been for some time.
    We run perl on a Dec/Compaq/HP Alpha processor, and that has been 64-bit for many years (10? 11? 13? I can't remember). I can't remember which Perl release gave 64 bit int's, but there was absolutely no significant change: we ran both Unix and VMS on Alphas, Solaris on sparc and ICL-DRS/NX on sparc, and Win32-something-or-other on i386 and happily used the same source on all platforms!
    Side-note: Perl is *truely* portable

    So the answers to your questions are something in the order of:

    1. No, it is already
    2. It has happened, by much hard work from several p5p-members
    3. In no way at all
Re: 64-bit Perl
by crenz (Priest) on May 20, 2003 at 16:41 UTC

    Generally, a 64 bit processor can help you with three things:

    • Faster calculations with big numbers
    • Accessing more than 4 GB of memory
    • Using SIMD instructions on wider registers (128 bits for the PPC970)

    (Okay, so this is a bit simplified, but that's the benefits for most people.) A 64 bit processor is not automatically twice as fast as a 32 bit processor.

    IMHO, it is actually better for perl to stay 32 bit for a while: perl is known to be a memory hog (as a trade-off for higher speed), and going 64 bit would mean using double the amount of memory for pointers. Which is just not worth the marginal benefits.

    My guess is that perl's 64 bit support will be enhanced for those that need it, and will stay an optional switch during compilation for quite some time to come. 64 bit processors like AMD's Opteron or IBM's PPC970 (hopefully to be used in Apples soon :)) can handle 32 bit code just fine.

    Update: The PowerPC 970 is made by IBM, of course, not by Intel... thanks, elusion!

Re: 64-bit Perl
by hardburn (Abbot) on May 20, 2003 at 16:01 UTC

    Being that a significant chunk of Perl code is just a glorified front-end to a database, I wouldn't worry too much about it. If the database software is ready, then perl is ready, at least for many practical jobs.

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    Note: All code is untested, unless otherwise stated

Re: 64-bit Perl
by Marza (Vicar) on May 21, 2003 at 06:23 UTC