Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

endianness of wordcode



I'm a little doubtful about the necessity of having doubled wordcode files
for different endianness.  It's only useful when sharing files across
heterogeneous networks --- you wouldn't distribute wordcode files, you'd
compile them in situ (or at least I would).  I wonder whether it would be
better always to dump in the native format, check if the order is swapped
when reading, and if so swap it back on the fly.  That's a fairly trivial
operation compared with all the rest of the stuff zsh is going to be doing
with the extracted code.

In fact, the code I stole as the basis for the pattern-matching equivalent
of wordcode explicitly reconstructs integers by shifting and or'ing,
probably without even the intention of making it machine-independent since
the compiled patterns were for internal use.

I think the zcompile documentation, and maybe other places where wordcode
is mentioned, could be friendlier: it introduces the (non-existent?) word
`wordcode' with no explanation, and you really don't even need to know that
it exists, only that there is a black box which produces versions of
functions that load faster and maybe save memory.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>



Messages sorted by: Reverse Date, Date, Thread, Author