Live data from Hacker News

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

pypyjs.org

91–100 of 144 posts

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

#92
post #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.

Not sure why this was downvoted. Does anyone care to elaborate?

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

#93
post #78

Earlier quoted context omitted.

"If we ship Python inside of Firefox, no one is going to use it because it's not available in Chrome, it's not available in Internet Explorer." Oh yeah? Try me.

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 it happening unless Nadella's "Really Good, Honest! (TM)" Microsoft makes some sort of grand gesture towards Google or (more likely) Mozilla.

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

#94
post #92
post #23

Earlier quoted context omitted.

> 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.

Not sure why this was downvoted. Does anyone care to elaborate?

I didn't downvote, but I don't think the problem has anything to do with specific language features. It's purely a political issue: you have to get at least two or three main vendors to adopt the new language at the same time, and none of them must perceive it as a threat to its own agenda. For that to happen, all of them must release compatible implementations that put everyone on an equal level at the exact same time, which is really hard to accomplish. It was very hard even to get javascript where it is now (remember the browser wars and all the incompatible extensions it spawned... ?), starting again from scratch with any new language would be extremely difficult, regardless of how "nice" the actual language is.

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

#96
post #49

Sadly, "import antigravity" doesn't work

I was more disappointed (but not surprised!) that "import pip" didn't work. If it did (and it has big ramifications for how much of "python" (for some definition of "python" that includes most of the standard library) works. Eg sockets, interacting with some sort of "local" "file-system" etc) one could (this is handy if working on windows, and running python via cmd-r python.exe): import pip # pip.main expects a list…

That would be a total security nightmare and hopefully it's never going to happen.

I'd be happy enough with serving .py files with the exact same restrictions and privileges that JS libraries have now.

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

#97
post #49

Sadly, "import antigravity" doesn't work

I was more disappointed (but not surprised!) that "import pip" didn't work. If it did (and it has big ramifications for how much of "python" (for some definition of "python" that includes most of the standard library) works. Eg sockets, interacting with some sort of "local" "file-system" etc) one could (this is handy if working on windows, and running python via cmd-r python.exe): import pip # pip.main expects a list…

[deleted]

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

#98
post #27
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?

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.

http://en.wikipedia.org/wiki/Wirth%27s_law

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

#99
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

I wonder if Python could be embedded as an addon.

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).

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

#100
post #85
post #67

Earlier quoted context omitted.

> However I'm not sure if the drawbacks can be addressed in the current JS model, notably: very slow warmup, huge download size Only for the first time loading it. It would be great if some big organization (looks at Google) hosts the "standard" version of the file, much like jquery, so that it would be cached and ready to be used on the local machine most of the time.

I believe this only addresses the download size and not the crazy warmup (you still reparse it etc.)

Not quite. At least Firefox caches compiled asm.js.
Post reply on HN