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

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.



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


You also would not be able to minify it properly because of whitespace identation constraints. Or am I off on this?


Minifying is a compression hack. Just get the files served compressed with a proper algorithm. gzip compresses whitespace just fine.


You 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()


If we're compiling to bytecode there is no need to minify.


Or you could deliver your JSVM bytecode as binary files (which reveals a new set of drawbacks)




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

Search: