If this was implemented in higher-levels of abstraction we could
introduce
different tagging schemes to support locatives, flonums, etc. This could
lead
to more language features, reduced memory usage and garbage on smaller
hardware and better performance on 64-bit machines that don't need the
lower 3
bits of the machine word for object addresses due to alignment.
Hardcoded 1-bit tags doesn't give much room for future ideas or any
other
immediates. I could continue the work into libid, but I haven't looked
much
at Jolt yet; I'm not sure where to start.
Preliminary results as applied to libid here:
http://kurtstephens.com/node/60
32-bit machines also don't need the lower 3 bits if you align all
objects by 8 bytes.
Mozilla's SpiderMonkey Javascript implementation used in Firefox and other
Mozilla environments uses 3 bit tags as follows :-
000 - untagged reference to an Object
001 - a 31 bit int
010 - tagged reference to a Double
100 - tagged reference to a String
110 - tagged Boolean
There is more room within the boolean's space to have thurther encoded
types.
The only issues are extra "coing" and "uncoding" code, which could be
implicitly generated in generated code and speed issues.
If its usage could be virtual and transparent in generated code (ie there or
not there on a generation flag) and maybe also modifiable in instances then
we would have the best of all worlds.
Aaron
_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc