3 ms·
This looks great and more advanced than the other Python to JavaScript translators on the market. Last year, I wrote a comparison of the ones I could find, but
by HerrMonnezza 14y ago
This looks great and more advanced than the other Python to JavaScript translators on the market.
Last year, I wrote a comparison of the ones I could find, but none of them actually was in very good shape: http://chargen.blogspot.com/2011/08/survey-of-python-to-javascript.html http://chargen.blogspot.com/2011/08/survey-of-python-to-java...
- streptomycin 14y agoSince you seem to be the expert, let me try to bother you... I'm in the very early stages of porting an app from Python to Javascript, and I have no illusion that it's going to work out of the box from a translator (lots of third party libraries, and switching from server side to client side). But it would be nice if at least some of the obvious syntax could be translated. However, all of the several translators I've tried simply die with a message like "this library is not supported" or "this language feature isn't supported" and then they produce absolutely no output, which isn't any help at all. Are there any translators that will simply skip over stuff they don't understand while translating stuff they do understand? Also, side note, those floating boxes on the right side of your blog make it impossible to grab the scrollbar thingie when it is under them, as it is near the top of the page, which is very annoying to me.
- HerrMonnezza 14y agoI'm afraid I'm no expert - I just reviewed the converters because I would have liked to use Python both on the client- and the server-side; however, I eventually abandoned the idea. I'm not sure how a converter could "skip over stuff it doesn't understand while translating stuff it does understand": it may make sense to work on "small" translation units (e.g., a function or method), but the code that comes out of the translation of a unit should be -at least syntactically- correct in the target language. Indeed, the more mature Python-to-C translators (e.g., Cython) do restrict the Python that are allowed in the source file, and refuse to compile the entire file if your code contains unsupported syntax. If you are willing to invest some effort into adapting a translator yourself, (besides Pyjaco! :-)) PJS and Py2Js are both very clean and easy to understand/patch. Although they are no longer developed, they might provide a good starting point to build the "simple minded" translator that you would like to have. (Thanks for the remark on the blog layout - I just picked one of the standard styles and did not pay much attention to the details.)