3 ms·
That's extremely easy to answer. The answer is you'd write an interpreter for JavaScript in Java, use a partial evaluation framework also written in Java to co
by mike_hearn 8y ago
That's extremely easy to answer.
The answer is you'd write an interpreter for JavaScript in Java, use a partial evaluation framework also written in Java to convert it to a JIT compiler, and then run it on a multi-purpose optimising polyglot virtual machine that's also written in Java. Such a thing would be fully bootstrapped and fully managed.
And usefully, it exists already. That's what happens if you run JavaScript on SubstrateVM using TruffleJS and Graal:
https://www.graalvm.org/ https://www.graalvm.org/
The closest thing you find to unmanaged code is parts of the garbage collector, where "SystemJava" is used, a dialect that gives access to pointer arithmetic. But everything else including the JIT compiler itself is fully managed.
- afiori 8y agoIf I understand what you are describing this is how PyPy works.