4 ms·
thank you :) you got almost the answer here "It's not quite the same as AS3" Haxe focus on transpilation/cross-compilation with its own language 'Haxe' and it
by zwetan 10y ago
thank you :)
you got almost the answer here "It's not quite the same as AS3"
Haxe focus on transpilation/cross-compilation with its own language 'Haxe' and its own compiler, libraries, VM, etc.
The closest to Redtamarin would be the NekoVM http://nekovm.org http://nekovm.org
I would say it is a different approach, Redtamarin focus on AS3 the language but also on the AVM2 and by extension the reuse of the Flex SDK (for the compiler) and other tooling that already exists (like Flash Builder IDE).
And so when you compare Haxe/NekoVM to AS3/AVM2 the difference mainly shine in how you write programs and libraries.
Redtamarin approach is to provide a "C API" for low-level function and other syscall, so dev can write "as fast as if they were writing AS3 as usual", they only need to learn a new API and the subtleties of system programming.
You could find the same kind of differences with CrossBdrige https://github.com/adobe-flash/crossbridge https://github.com/adobe-flash/crossbridge
Both NekoVM and CrossBridge focus (in their own way) on the reuse of C/C++ libraries, e.g. if you need zlib you can reuse it, but then it forces you to compile native stuff.
Redtamarin almost opposite approach is to provide a kind of C standard library (POSIX like even) in the context of AS3/AVM2, which allow you to port or write the AS3 code to do native stuff in a cross-platform way, but you can not reuse external native libs like zlib.
See for example this getaddrinfo sample code ported from C to AS3 https://twitter.com/zwetan/status/752202410521726976 https://twitter.com/zwetan/status/752202410521726976
The logic for that is let's say you need popen2.popen2() from Python,
you can implement it in AS3 reusing C functions like popen(), pipe(), fork(), dup2(), close(), etc.
Except for fork(), the AS3 code will work under Linux / Mac OS X.
You could say that Redtamarin is a lot of hard work to add small native C functions call, so dev can easily write AS3 programs for command-line and server-side.
Another example, you can take JS (ECMAScript, ECMA-262) code, compile it and run it with the redshell, I did it with the TypeScript compiler, I just needed to implement ChakraHost, the detail is here https://discuss.as3lang.org/t/the-case-when-you-dont-want-node-js/307 https://discuss.as3lang.org/t/the-case-when-you-dont-want-no...
So to come back to Haxe/NekoVM, I'm not so sure you could either implement popen2.popen2() with just the system libraries available or if you could just compile/run TSC sources with Haxe/NekoVM unless making a big rewrite of the whole thing.
Many people probably think that AS3 is dead because "flash is dead", but AS3 is also ES4 and so fully compatible with ECMA-262, being able to reuse IDE with just a little swap of playerglobal.swc with redtamarin.swc and instantly have syntax completion to write server-side program, publishing documentation with tools like asdoc, etc.
All those things are the reason why Redtamarin focus on AS3 the language, and why it is very different than Haxe and/or NekoVM.
- ZenoArrow 10y agoThank you for taking the time to write a detailed answer!