Live data from Hacker News

PyPy.js: A fast, compliant Python implementation for the web

pypyjs.org

21–30 of 144 posts

Re: PyPy.js: A fast, compliant Python implementation for the web

#22
post #4

So does this mean that since I'm better at Python than Javascript, I can now use this to make my web frontends in Python? Because that would be pretty sweet.

That would be great as one of the things that puts me off of front end development is lack of language choice. I adore Python as a language and it would certainly make a great choice for a front end language if supported. Maybe if this project takes off, browser vendors would ship a Python interpreter alongside the JS one. I'd bet that Apple, Google, Mozilla, etc. could make Python fast if they threw as much money at…

have you looked into CoffeeScript? it's slightly more pythonic than JavaScript.

Re: PyPy.js: A fast, compliant Python implementation for the web

#23
post #9

I watched the presentation in Pycon 2015[1], and I really liked how honest/aware they are about the challenges and tradeoffs (so far, the performance it's pretty bad compared to javascript, and the download size is still an issue). At the end is answered why python can't be directly included in Firefox or other browsers(the presenter/main developer works for Mozilla) [1] https://www.youtube.com/watch?v=PiBfOFqDIAI

> python can't be directly included in Firefox or other browsers

So Python is a bad candidate, but there are better candidates out there. For example, jsofocaml (using OCaml in the browser) looks quite promising.

In the end, we need a lightweight yet properly defined and highlevel language, and the ML languages as well as the LISP languages are great candidates for that.

Re: PyPy.js: A fast, compliant Python implementation for the web

#24

Besides the big download size, it does several things very "right": Full Python data model, access to the full javascript model (albeit slowly currently). Also PyPy is the right choice as the basis for this (as opposed to CPython) because its ecosystem is generally more "pure" Python than CPython's. C Extensions would only get in the way.

> ... access to the full javascript model .... How is the JS model accessed?

See nosir's comment.

Re: PyPy.js: A fast, compliant Python implementation for the web

#26
post #17
post #11

This is glorious. From https://github.com/rfk/pypyjs/blob/master/CONTRIBUTING.rst : > We have the following major components in the PyPy repo: >> An "emscripten" build platform definition, which teaches pypy's rpython toolchain how to compile things with emscripten: ./deps/pypy/rpython/translator/platform/emscripten_platform/. >> An rpython JIT backend that emits asmjs at runtime: ./deps/pypy/rpython/jit/backend/asmj…

Glorious indeed. At least three levels of abstraction, two JITs, and a host of supporting code. Can we add some more layers like an emulator or get recursive by getting something like Pyasm running inside it?

I work on a machine that has two hypervisors, one third in plan, and more abstraction layers than a lasagna software.

It is still very very efficient.

Re: PyPy.js: A fast, compliant Python implementation for the web

#27
post #17
post #11

This is glorious. From https://github.com/rfk/pypyjs/blob/master/CONTRIBUTING.rst : > We have the following major components in the PyPy repo: >> An "emscripten" build platform definition, which teaches pypy's rpython toolchain how to compile things with emscripten: ./deps/pypy/rpython/translator/platform/emscripten_platform/. >> An rpython JIT backend that emits asmjs at runtime: ./deps/pypy/rpython/jit/backend/asmj…

Glorious indeed. At least three levels of abstraction, two JITs, and a host of supporting code. Can we add some more layers like an emulator or get recursive by getting something like Pyasm running inside it?

But... Hardware is cheap, right? Hardware gets faster all the time, right? Sure, the end user rarely sees any noticeable improvement because we just use the speed increase as an excuse to write ever more inefficient code, but at least you get to use your favorite language in the browser.

Re: PyPy.js: A fast, compliant Python implementation for the web

#28
post #4

So does this mean that since I'm better at Python than Javascript, I can now use this to make my web frontends in Python? Because that would be pretty sweet.

Yo know the most troubling aspect of browse side scripting is the DOM, js syntax has its issues but not the biggest issue.

Re: PyPy.js: A fast, compliant Python implementation for the web

#30
post #22

Earlier quoted context omitted.

That would be great as one of the things that puts me off of front end development is lack of language choice. I adore Python as a language and it would certainly make a great choice for a front end language if supported. Maybe if this project takes off, browser vendors would ship a Python interpreter alongside the JS one. I'd bet that Apple, Google, Mozilla, etc. could make Python fast if they threw as much money at…

have you looked into CoffeeScript? it's slightly more pythonic than JavaScript.

There's raypidscript also: http://www.rapydscript.com/ which is a python like JS precompiler (https://news.ycombinator.com/item?id=9385596)

I haven't had the time to try it yet, but maybe it'll suit your needs ;)

Post reply on HN