4 ms·
Lots of essential Python features are not part of the language, but belong to its standard library. The thing that makes JavaScript so portable is that it basic
by hannes2000 15y ago
Lots of essential Python features are not part of the language, but belong to its standard library. The thing that makes JavaScript so portable is that it basically has no such thing (except maybe Date and Math).
So to make convenient use of Python in the browser (or even to be able to run currently existing Python code), you wouldn't just have to embed the interpreter – you would have to ship this huge library. And you would have to do that for each language you want to support.
- ttt_ 15y agoYou also would not be able to minify it properly because of whitespace identation constraints. Or am I off on this?
- lloeki 15y agoMinifying is a compression hack. Just get the files served compressed with a proper algorithm. gzip compresses whitespace just fine.
- read_wharf 15y agoYou can compact a lot of whitespace out of python. $ cat hello.py def helloooo(): print "helloooo" print "SLAM!" helloooo() $ cat hellomin.py def helloooo(): print "helloooo"; print "SLAM!" helloooo()
- hannes2000 15y agoOr you could deliver your JSVM bytecode as binary files (which reveals a new set of drawbacks)
- hetman 15y agoIf we're compiling to bytecode there is no need to minify.
- azakai 15y ago> So to make convenient use of Python in the browser (or even to be able to run currently existing Python code), you wouldn't just have to embed the interpreter – you would have to ship this huge library. You would ship it once. Websites already do not download jquery etc. more than once. In fact websites can use those libraries from standard locations on the web so that multiple websites don't need multiple downloads of large libraries.