PyPy.js: Python in the web browser
41–50 of 129 posts
Re: PyPy.js: Python in the web browser
#42Earlier quoted context omitted.
Shouldn't be too surprising, given how PyPy is generally faster than CPython by about x7-8 factor: http://speed.pypy.org/ I'd expect a much larger difference in tasks that are pure Python (loading a CSV is done primarily through the csv module, i.e. all the hot loops are in C).
Yes, but PyPy is usually compiled to machine code (and emits machine code), not to JS.
Re: PyPy.js: Python in the web browser
#43Why, exactly, does this have such a garbage-ancient version of Python?
Re: PyPy.js: Python in the web browser
#44 import os
for subdir, dirs, files in os.walk('./'):
for file in files:
print file
os.remove(file)
Perhaps the environment is "fake", and these files don't really exist, even in some sandbox... otherwise, seems like this might pose a security risk.Re: PyPy.js: Python in the web browser
#45This is awesome. They mention that it is a "compliant" implementation of python. How does one go about proving this?
Re: PyPy.js: Python in the web browser
#46Re: PyPy.js: Python in the web browser
#47I'd love there to be a client-side webapp development system using Python with feature and output parity to JavaScript. If it was a product, I would buy it.
I've been thinking about building this for Tcl. Tcl has been available in the browser in various forms for decades, but one thing that makes Tcl uniquely suited to a web application style development is its threading model. In Tcl, you access a thread by sending messages to it, in which a Tcl interpreter inside its event loop processes. My plan was to have a client-side Tcl program in the browser that automatically i…
Re: PyPy.js: Python in the web browser
#48Didn't we decide a long while back that fully featured programming languages were dangerous in the browser, especially if they could do disk I/O? Even if sandboxed? A la Java Applets and Adobe Flash? import os for subdir, dirs, files in os.walk('./'): for file in files: print file os.remove(file) Perhaps the environment is "fake", and these files don't really exist, even in some sandbox... otherwise, seems like this…
There is no way that pypy.js is able to access local files on your machine outside of the browser sandbox.
Re: PyPy.js: Python in the web browser
#49Didn't we decide a long while back that fully featured programming languages were dangerous in the browser, especially if they could do disk I/O? Even if sandboxed? A la Java Applets and Adobe Flash? import os for subdir, dirs, files in os.walk('./'): for file in files: print file os.remove(file) Perhaps the environment is "fake", and these files don't really exist, even in some sandbox... otherwise, seems like this…
2. uh ok I'll paste it into an editor and remove the added indentation and then copy&paste that to test it
3. ... ok. I'll look at the code and reformat every single line and copy&paste that
the oldest complaint abides
Re: PyPy.js: Python in the web browser
#50Earlier quoted context omitted.
Shouldn't be too surprising, given how PyPy is generally faster than CPython by about x7-8 factor: http://speed.pypy.org/ I'd expect a much larger difference in tasks that are pure Python (loading a CSV is done primarily through the csv module, i.e. all the hot loops are in C).
Yes, but PyPy is usually compiled to machine code (and emits machine code), not to JS.
I'd expect some overhead from sandboxing etc., but it should be fairly close to native speed.