3 ms·
Since Porffor can compile itself (you can run the compiler inside of Porffor), any calls to eval could be compiled to Wasm (via executing the Porffor compiler i
by syrusakbary 2y ago
Since Porffor can compile itself (you can run the compiler inside of Porffor), any calls to eval could be compiled to Wasm (via executing the Porffor compiler in Porffor JS engine) and executed performantly on the same JS context *
*or at least, in theory
- tasty_freeze 2y agoI haven't used it, but reading their landing page, Porffor says their runtime is vastly smaller because it is AOT. If the compiler had to be bundled with the executable, then the size of the executable would grow much larger.
- spartanatreyu 2y agoYeah, but you'd only need to include Porffor into compiled code if it used eval. And most devs stay away from eval for well-deserved security reasons.
- concerndc1tizen 2y agoThat wouldn't work: The Wasm spec does not allow for modifying an already running program (e.g. JIT). AFAIK the only option is to include an interpreter.
- syrusakbary 2y agoYou don't need to modify an already running program, you can plug new functions into an existing Wasm program via a table, and even attach variables via globals or function arguments. I'd recommend checking the work on making SpiderMonkey emit Wasm as a backend