Welcome PythonScript: Python to Javascript translator in 350 lines of Python

Amirouche Boubekki amirouche.boubekki at gmail.com
Sat Mar 23 17:10:43 CET 2013


I'm happy to announce the immediate avaibility of PythonScript a Python ->
Javascript translator written in Python. So far it works... Break it online
@ http://apppyjs.appspot.com

How it works ? Similarly to PyPy, it use a restricted version of Python
called PythonJS. Along side this translator there is two other components
PythonToPythonJS which translates (more) Python to PythonJS and a runtime
library written in PythonJS that creates javascript objects to emulate
classes, objects and methods. It's not compliant.

Other Python in the browser solutions are written in Javascript (skulpt,
brython) or both (pyjaco, pyjs) and are difficult to work with. This
implementation is fully written in Python with small snippets of Javascript.

Creating bindings is very easy, jQuery bindings are available. All the
thing is not much tested.

Also if you are interested in this topic, you might be interested by the
avaibility of asm.js in Firefox nightly. asm.js is a subset of JS, that can
be compiled by the browser, thus making solutions such as emscripten and
PyPy with an asm.js backend more interesting.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130323/10c59f7a/attachment.html>

More information about the Python-list mailing list