Are there any languages targeting JavaScript (like CoffeeScript) and written in Python? I found Pyjamas, but it’s GWT of Python as I see. I want a language that doesn’t need heavy runtime library and is able to be compiled to JavaScript. I found Mascara also, and it very satisfies my requirements except it’s license. CoffeeScript is ideal for me except it’s written in CoffeeScript itself. I have to compile [CoffeeScript-like language] source codes into JavaScript statically in Python application.
-
@Lion Oh, thanks. I removed it.minhee– minhee2011-12-18 06:13:57 +00:00Commented Dec 18, 2011 at 6:13
-
1"CoffeeScript-like" as in "it's just JavaScript"? Because that's the primary purpose of CoffeeScript: Do what JS does, just in a nicer way. Please elaborate on what defined this "non-JavaScript-language". If the sole problem with CoffeeScript is that it's not written in CoffeeScript, you can run from Python via V8.user395760– user3957602011-12-18 07:21:29 +00:00Commented Dec 18, 2011 at 7:21
-
@delnan I wanted to say a language do what JavaScript does in a nicer way.minhee– minhee2011-12-19 06:09:10 +00:00Commented Dec 19, 2011 at 6:09
-
7@Lion They are not "strictly prohibited" throughout the site, that is ludicrous. However, the majority of the community seems to discourage them. meta.stackexchange.com/questions/5029/… and meta.stackexchange.com/questions/2950/…Derek Litz– Derek Litz2011-12-19 07:01:53 +00:00Commented Dec 19, 2011 at 7:01
-
stackoverflow.com/questions/683462/… -This might be helpful.Sajib Mahmood– Sajib Mahmood2011-12-23 20:42:08 +00:00Commented Dec 23, 2011 at 20:42
3 Answers
You might want to have a look at pyjaco (python to javascript compiler).
Here's an example to get you started with manipulating the DOM in Python using jQuery: https://github.com/chrivers/pyjaco/tree/devel/examples/jquery
Comments
Check this:
PyvaScript: http://www.allbuttonspressed.com/blog/django/2010/07/PyvaScript-Pythonic-syntax-for-your-browser
Pyjs: https://github.com/anandology/pyjs
Pyjamas: http://pyjs.org/
Comments
One part of Pyjamas is pyjs, which is decribed this way in the project overview:
pyjs translates Python code to Javascript by walking the Python abstract syntax tree and generating Javascript.
Sounds like it should fit the bill: no need to use the other parts of pyjamas you don't need.