Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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


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.


The other issue with Python in the browser is that the significant whitespace requirement prevents minification, which would bloat download size.


Significant whitespace (in all languages, really, its a difference of degree rather than kind) constrains, but does not prevent, minification. (Idiomatic python code can be reduced by three chars per indentation level on each line with no impact on semantics, and of course other transformations that aren't whitespace elimination that are past of minification are unaffected.)

Heck, there are existing python minification tools.


Also, with SourceMaps you could provide compiled Python code (.pyc), which is already heavily minified.


Here's a possible solution

- Let there be pojs landing page

- Download pypy.js in the background

- Run python code

- Dance with Glee!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: