Closed ir-g closed 10 years ago
Runtimejs uses V8 to compile JavaScript. And as far as I know, V8 doesn't support AOT compilation and it is purely a just-in-time compiler. So, I don't think it's possible at the moment.
I know that Node provides the vm module which allows you to precompile code, but AFAIK it's not any more performant than just using it at runtime.
@iefserge @RangerMauve I was thinking that it could be beneficial for making compiled server applications possible, meaning that software could be made and relesed in binary-only form.
@isaacrg Precomiling might be nice if you don't want your source code to be visible, but it does come at a performance loss, and the actual JIT is pretty fast.
Might want to look at the first answer here.
Note: AOT is not always the slower option - where AOT compiling is performed on the chosen device, it can be quicker.
@RangerMauve the node VM module compiles code into the current context. It's a slightly better version of eval
. It does not actually compile your code into a serialized format.
Would AOT/compilation be planned for runtimejs? I would find it a great feature for an iteration of JS.