On Mon, Oct 02, 2000 at 04:35:29PM -0400, Dan Sugalski wrote:
> I agree, platform native is a good idea generally, as long as we have some
> means of indicating how the platform encodes the data. The bytecode needs
> to be transportable across platforms--I want the same bytecode to be able
> to run on a VAX, x86, Alpha, and PowerPC box.
>
> Also, transportable floats are rather problematic. It's one thing to tag an
> integer with size and endianness. It's rather another to deal with floating
> point formats. I have at least six available to me on my Alpha box, and who
> knows how many elsewhere. I'd rather not have to have code to deal with all
> of them in everyone's perl. (Of course, I'm not sure what the alternative
> is...)
Benjamin Stuhl (I think) for perl bytecode as of ByteLoader 0.04 decided
that the best thing to deal with this sort of intra-platform incompatibility
was to store floats as ASCII strings. If there's a way of tagging what is
"native" format of float, and hence reader knowing whether writer's
format is the same, one possibility could be to write out native & ASCII
Then reader can fall back to parsing in the ASCII if the binary isn't
edible.
Nicholas Clark