<story><title>Brython - Python to Javascript translator</title><url>http://www.brython.info/index_en.html</url></story><parent_chain></parent_chain><comment><author>fijal</author><text>I&apos;m genuinely shocked that this made it to the top of hackernews. I would expect better. While the idea of having the Python interpreter in the browser is very likely better than having a compiler Python -&amp;#62; JS (if we care about Python), the implementation here is both half assed and really bad. It takes quite a bit of effort to create a python interpreter that can be called python. This is nowhere near there. On top of it double-interpretation in dynamic languages is very slow and I doubt someone is willing to pay that price here. A good example of low quality is here:&lt;p&gt;&lt;a href=&quot;http://code.google.com/p/brython/source/browse/trunk/py_classes.js#140&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/brython/source/browse/trunk/py_clas...&lt;/a&gt;&lt;p&gt;this is both incorrect (exceptions are propagated, &lt;a href=&quot;http://paste.pound-python.org/show/28457/&quot; rel=&quot;nofollow&quot;&gt;http://paste.pound-python.org/show/28457/&lt;/a&gt;) and has wrong complexity. It&apos;s not even a dict at all!</text></comment>
<story><title>Brython - Python to Javascript translator</title><url>http://www.brython.info/index_en.html</url></story><parent_chain></parent_chain><comment><author>madhadron</author><text>If you want to do this kind of thing on the server side, Python provides enough introspection to turn functions in a live Python image into JavaScript. Here&apos;s a minimal example I tossed together a while back:&lt;p&gt;&lt;a href=&quot;https://gist.github.com/50d706081074aed8fcf6&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/50d706081074aed8fcf6&lt;/a&gt;&lt;p&gt;I have a bunch of notes somewhere on translating a big hunk of the basic language, including how to generate continuation passing style code in JavaScript from less ghastly Python.&lt;p&gt;The difficulty is providing all the class semantics and the standard library.</text></comment>