CPython on the Web

John Nagle nagle at animats.com
Tue Jan 4 01:11:20 EST 2011


On 1/1/2011 11:26 PM, azakai wrote:
> Hello, I hope this will be interesting to people here: CPython running
> on the web,
>
> http://syntensity.com/static/python.html
>
> That isn't a new implementation of Python, but rather CPython 2.7.1,
> compiled from C to JavaScript using Emscripten and LLVM. For more
> details on the conversion process, see http://emscripten.org

    It's a cute hack, but it's about 1000 times slower than CPython.

Try

def cnt(n) :
     j = 0
     for i in xrange(n) :
         j = j + 1
     return(j)

print(cnt(1000000))

with this.  It will take 30 seconds or so to count to a million.

					John Nagle



More information about the Python-list mailing list