Live data from Hacker News

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

pypyjs.org

121–130 of 144 posts

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

#121
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…

Since PyPy compiles RPython to C, couldn't one write a web app in RPython, compile it to C, then to JS (with asm.js) and enjoy a quick page load and smaller file size? By the way, is RPython a nice language to program in?

correction: the C to JS step would be done with Emscripten (asm.js is a subset of JS not a compiler)

Thank you for the answers

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

#122

Earlier quoted context omitted.

Of course it could. But that would defeat the point, because support wouldn't be widespread enough for any real use (unless you're just using it for an intranet site or something).

As usual, everyone devalues the benefits of progressive enhancement. Add-on would be a great way to get the ball rolling, as long as your website works without it too.

But we're not talking about some optional feature you can just shim in 1kb of JavaScript, we're talking about the language used to write a web app. Sure, you could use PyPy.js as a fallback, but you'd essentially create a horrible loading experience for >99.99% of your users while you wait for this addon to catch on (which won't happen, because there's no reason for an end-user to install it). For a language like Python to be natively supported on the web, at least one major browser has to support it. And that's not likely to happen given the current state of affairs.

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

#123
post #93

Earlier quoted context omitted.

Well, Google more or less tried the same with Dart and has since abandoned that plan in favor of targeting JS as Dart's primary runtime. Then again, the Dart VM never shipped in mainline Chrome, so who knows how a more committed attempt would have played out.

That's a bit of a fig leaf: dart never had the clout and popularity Python has, and it was clearly something no other browser vendor could get behind. Python has significant cross-vendor mindshare and wouldn't be perceived as fostering anybody's agenda. It's true though that getting even two major browser vendors to agree on supporting another scripting language in addition to JS, is really really hard. I don't see i…

Python might have clout, but in many way it's even harder to optimize than JavaScript, whereas Dart was designed by JavaScript VM experts to be easily optimizable and has a very fast, very small VM.

Python is also only just starting to explore optional typing which is obviously a prime feature of Dart and JS derivatives like TypeScript.

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

#124
post #93

Earlier quoted context omitted.

That's a bit of a fig leaf: dart never had the clout and popularity Python has, and it was clearly something no other browser vendor could get behind. Python has significant cross-vendor mindshare and wouldn't be perceived as fostering anybody's agenda. It's true though that getting even two major browser vendors to agree on supporting another scripting language in addition to JS, is really really hard. I don't see i…

Python might have clout, but in many way it's even harder to optimize than JavaScript, whereas Dart was designed by JavaScript VM experts to be easily optimizable and has a very fast, very small VM. Python is also only just starting to explore optional typing which is obviously a prime feature of Dart and JS derivatives like TypeScript.

It's very clear that this is not a technical problem, but a political one. Dart could be the second coming of Knuth and still nobody but Google would implement it in a major browser.

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

#125
Not working for me:

"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://10.30.229.27:15871/cgi-bin/blockpage.cgi?ws-session=1.... This can be fixed by moving the resource to the same domain or enabling CORS."

Firefox 37.0.1

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

#126
post #17

Earlier quoted context omitted.

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?

Have you seen Gary Bernhardt's THE BIRTH & DEATH OF JAVASCRIPT? https://www.destroyallsoftware.com/talks/the-birth-and-death...

I saw this a few months ago, and it never gets any less insane (in a good way) to watch. Just following Atwood's Law, I suppose.

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

#130
post #68

If software is eating the world, JavaScript is eating the languages.

Only because the browser vendors are too scared (for whatever reason, legitimate or otherwise) to add extra languages to the mix, like python.

"vendors are too scared (for whatever reason, legitimate or otherwise) to add extra languages to the mix, like python."

Tried python server-side, mod_python and got lots of issues with formatting. Not syntax or mixed tab/spaces but one-off spacing errors. I realised then, Python used this way has problems. Could be fixed though.

Post reply on HN