Re:PyPy.js: Python in the web browser
by icebraining on Wednesday August 22, 2018 @12:21PM
(#17819828)
Yes, but PyPy is usually compiled to machine code (and emits machine code), not to JS.
[ Parent
| on HN ]
True, but the asm.js is then compiled to machine code by the browser's JS JIT.
I'd expect some overhead from sandboxing etc., but it should be fairly close to native speed.
It's not "overhead from sandboxing" that's a problem, it's the fact that translating from bytecode to bytecode to bytecode will cause it to lose some ... succinctness at each step, giving the final machine code generator a harder time coming up with efficient code for it.
Indeed, but many of the optimizations introduced by PyPy should be visible regardless of compilation target.
I love Python but js is close to an order of magnitude faster
Re:PyPy.js: Python in the web browser
by icebraining on Wednesday August 22, 2018 @12:41PM
(#17819976)
Have you tried PyPy?
Unfortunately it hasn’t been a drop-in replacement for our CPython codebase (lots of Numpy/Pandas/etc).