A few days ago I tried to build some perls with 32 bit ints and 128 bit floats. Cue test failures. Today I tried again, and this time I read my notes from last time on how to do it, and it Just Works.

Yay past me!

(the #BigInt modules bundled with some versions of perl don't like that combination of data sizes; the solution is to ignore their test failures, install anyway, and then upgrade to the latest versions from the #CPAN)

#perl #32bit #RidiculousComputing #ComputationalPerversions

@DrHyde what is the advantage of 32b INT when you're running 128b FLOAT ?
@Boston_PM these are builds for CPAN-testing, where weird combinations of options will help tease out subtle bugs, and also for torture-testing my own code which cares about data types, for interoperability with other systems.
@DrHyde ahhh, Intentionally Edgy edge cases.
Very good.
- @BRicker [alt]

@Boston_PM @BRicker yep, same reason I test on Solaris and *BSD, and why I tested for a while on RISC V. Throwing code at weird shit prevents developers from falling into the grave sin of believing that All The World's A V̶A̶X̶ R̶e̶d̶h̶a̶t̶ x̶8̶6̶ Whatever.

Perl code is impressively portable - even XS code! - and it's rare that I find anything that falls over on this sort of stuff, and when I do the dev generally fixes it quickly.

@DrHyde @Boston_PM
Indeed.

(TBQF, both Perl Core and XS are C and C is All the World's a PDP-11, which was a hardware/microcode implementation of an abstract register machine — like Lisp, a student attempted implementation of Professor's abstract model, and Prof ran with it; Edson deCastro was p****d and left to form Data General — so C is almost like a virtual machine for portability, and libc is almost like all-the-world-is-Unix(2,3) for portability)

@BRicker @Boston_PM XS stuff tends to be nice and portable because people are strongly encouraged to use perl's macros for anything that goes anywhere near a data type. For example, if you want to format a floating point value as text you use `"%" NVgf` and you'll magically get the right format string, you don't need to care whether it's %f, %g, or whatever mad shit is needed for weird longer floating point types.

There's absolutely tons of thoroughly unportabla C code out there though.

@BRicker @Boston_PM my favourite C portability screw up is #bzip2 which insists that `short` be 16 bits.

Getting that to work on a platform where short, int and long were all 64 bits, and where you only had C89, no fancy C99 data types like `int16_t`, was "fun".

@DrHyde
(Quite a while ago, for a while I was running Debian on DEC ALPHA at home to have a 64bit Perl to do stuff that belonged in Fortran w/o getting back into Fortran.)