3 ms·
How does it compare with Brython? http://www.brython.info/ http://www.brython.info/
by fiatjaf 11y ago
How does it compare with Brython? http://www.brython.info/ http://www.brython.info/
- Veedrac 11y agoI had a conversation about Brython vs PyPy.js on Reddit 6 months ago[1]. The short of it is that I wouldn't trust Brython to handle edge-cases that PyPy.js will, and that PyPy.js is at least as fast for me when warmed up. That said, I've lots of praise for the Brython project, and it's a way lighter dependency (both in size and warm-up times). [1] https://www.reddit.com/r/Python/comments/33m7io/comparing_the_speed_of_cpython_brython_skulpt_and/cqmyn5w https://www.reddit.com/r/Python/comments/33m7io/comparing_th...
- callahad 11y agoPyPy.js literally starts with PyPy compiled to asm.js, so you intrinsically get relatively comprehensive Python compatibility right out of the box. Brython, as I understand it, is an independent attempt at implementing a subset of Python in JavaScript. Edit: rfk addresses this directly around 46:00 in the interview. Paraphrased: "The big trade-off Brython does to get good performance is the number model. Things there map pretty directly to JavaScript. But if you overflow or do something different, you suddenly won't get Python's semantics. If you're writing new code for Brython, it's a good set of trade-offs, and in some ways you get tighter integration with the browser and the DOM. But if you're trying to take some existing code off the shelf and run it... you're more likely to run into issues."
- aroberge 11y agoHowever, he is wrong about the state of Brython https://groups.google.com/d/msg/brython/NRHEaoxAfgw/xMipOAYNBAAJ https://groups.google.com/d/msg/brython/NRHEaoxAfgw/xMipOAYN...
- tedmiston 11y agoHe addressed Brython at PyCon '15. I don't see the slides online, but the video is at https://www.youtube.com/watch?v=PiBfOFqDIAI https://www.youtube.com/watch?v=PiBfOFqDIAI. Abstract: > PyPy.js is an experiment in building a fast, compliant, in-browser python interpreter. By compiling the PyPy interpreter into javascript, and retargeting its JIT compiler to emit asmjs code at runtime, it is possible to run python code in the browser at speeds competitive with a native python environment. This talk will demonstrate the combination of technologies that make such a thing possible, the results that have been achieved so far, and the challenges that still remain when trying to take python onto javascript's home turf. > We'll cover: an overview of PyPy and why it's a good fit for this type of project; an introduction to asmjs and the rise of javascript as a compile target; what it looks like when you smoosh these two technologies together; a comparison with other approaches such as brython and PythonJS; and some concrete suggestions for how the result might be useful in practice.