11

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.

minhee
  • 5,688
  • 5
  • 43
  • 81
  • @Lion Oh, thanks. I removed it. – minhee Dec 18 '11 at 06: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](http://code.google.com/p/pyv8/). –  Dec 18 '11 at 07:21
  • @delnan I wanted to say a language do what JavaScript does in a nicer way. – minhee Dec 19 '11 at 06:09
  • 7
    @Lion They are not "strictly prohibited" throughout the site, that is ludicrous. However, the majority of the community seems to discourage them. http://meta.stackexchange.com/questions/5029/are-taglines-signatures-disallowed and http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts – Derek Litz Dec 19 '11 at 07:01
  • http://stackoverflow.com/questions/683462/best-way-to-integrate-python-and-javascript -This might be helpful. – Sajib Mahmood Dec 23 '11 at 20:42
  • Do you exclude running a javascript engine from your python app? – Guillaume86 Dec 27 '11 at 16:49

3 Answers3

6

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

Boden Garman
  • 2,455
  • 2
  • 20
  • 17
jcollado
  • 39,419
  • 8
  • 102
  • 133
0

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.

Dominique Eav
  • 195
  • 1
  • 1
  • 7