3 ms·
I used haXe a while back when implementing a concept SCUMM interpreter which worked in Javascript & Flash. It fitted the gap nicely... i could literally use the
by jamesu 15y ago
I used haXe a while back when implementing a concept SCUMM interpreter which worked in Javascript & Flash. It fitted the gap nicely... i could literally use the same code when compiling for flash and javascript.
My only big problem with it was the standalone "neko" target used a bizarre hack which meant integers were limited to 31 bits. This became incredibly problematic when implementing code (e.g. drawing, file loading, interpreting bytecodes) which relied on the assumption that integers were at least 32 bits in size.
There was an official workaround which used an "Int32" class. This effectively meant if you built for "neko" you had to rewrite half your code to use Int32. Bizarrely haXe had no in-built abstraction for transparently handling 32bit integer types in this case.
- ootachi 15y agoIt's not a "bizarre hack", it's a very common implementation strategy known as integer tagging. You see it everywhere from OCaml to the V8 JavaScript engine.
- neutronicus 15y agoCommon Lisp also has fewer-than-32-bit integers. It uses a few bits so that the VM can tell whether something is a pointer or an unboxed integer.
- aidenn0 15y agoNo, it has fewer-than-32-bit fixnums. Integers are practically unbounded. Also, on cmucl and it's derivatives you can declare something to be (unsigned-byte 32) and when possible it will use untagged integers for performance. This makes a difference because if you declare something "fixnum" you know you're being non-portable, but if you declare something (unsigned-byte 32) or just integer then you expect it to work across all implementations.
- neutronicus 15y agoI didn't see a need to introduce another piece of jargon, but thanks for the clarification.