News for hackers. Stuff that matters.
Re:The ultimate cross platform language by jamesu on Wednesday August 03, 2011 @06:34AM (#2840542)
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.

Re:The ultimate cross platform language by ootachi on Wednesday August 03, 2011 @08:48AM (#2840908)
It'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.
Re:The ultimate cross platform language by neutronicus on Wednesday August 03, 2011 @12:38PM (#2841794)
Common 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.
Re:The ultimate cross platform language by aidenn0 on Wednesday August 03, 2011 @12:57PM (#2841888)
No, 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.

Re:The ultimate cross platform language by neutronicus on Wednesday August 03, 2011 @01:09PM (#2841944)
I didn't see a need to introduce another piece of jargon, but thanks for the clarification.