| Store | Cart

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

From: Amirouche Boubekki <amir...@gmail.com>
Sat, 23 Mar 2013 17:10:43 +0100
Héllo,

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.


Cheers,

Amirouche

-- 
http://mail.python.org/mailman/listinfo/python-list

Recent Messages in this Thread
Amirouche Boubekki Mar 23, 2013 04:10 pm