CPython on the Web

azakai alonmozilla at gmail.com
Tue Jan 4 02:13:43 EST 2011


On Jan 3, 10:11 pm, John Nagle <na... at animats.com> wrote:
> 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, seehttp://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

Yes, as I said, "the code isn't optimized (so
don't expect good performance)" :)

It can get much faster with more work.

- azakai



More information about the Python-list mailing list