Pythonium: Python 3 to JavaScript translator
pypi.python.org
pypi.python.org
Pyjamas: http://pyjs.org/
Skulpt: http://www.skulpt.org/
and another one I forgot.
They are all are cool projects. They diligently solve 73.56% of the problem of Python to Javascript translation, and the other 26.44% remains a very hard task. This is not unlike many other problems in programming (well, even in real life). So it is not for the lack of knowledge, experience or hard work, it is just a very hard problem.
The generated JS:
https://github.com/pythonium/pythonium.github.io/blob/master...
Trying to understand what this would be used for besides basic object mapping, iterating, etc.
In Python, the "host environment" is generally CPython with the standard library. In JavaScript, the "host environment" is typically the browser with the DOM.
This is a project that translates code in Python syntax to JavaScript, so you would use XMLHttpRequest just as you would in JavaScript, but with Python syntax.
And after that, we can start writing and re-writing everything to "transpile" to PHP and use hip-hop to make it C++. I can't spend any more attention on random me-to JS without feeling like I'm waiting for my vestigial appendix to fall out.
We have lots of people writing very complex programs meant to alleviate some of the problems with JavaScript, when that effort could reasonably go into making Python a first-class web language by including a VM in browser distributions and writing bindings that allow DOM manipulation.
That's what motivated Google to create Dart, which just went 1.0
* forgot what
> I know CoffeeScript had some issues handling its certain attributes*
> within its constructors
Oh really? Do tell. class a
constructor: ->
# conventionally logs 3
console.log @c
class b extends a
c = 3
new b() # logs undefinedHere's the corrected version:
class a
constructor: ->
console.log @c
class b extends a
c: 3
new b() # logs 3[0] https://gist.github.com/amirouche/7768738 [1] https://gist.github.com/amirouche/7768858
That and i simply dont find JS to be all that bad.