Doesn't seem to be under active development anymore but you could check out pynarcissus, http://code.google.com/p/pynarcissus/source/browse/trunk/jsparser.py
Seems like a binding to V8 (JavaScript interpreter in Google Chromium) is available also, http://www.advogato.org/article/985.html
Answer from basicxman on Stack Overflow
» pip install esprima
Doesn't seem to be under active development anymore but you could check out pynarcissus, http://code.google.com/p/pynarcissus/source/browse/trunk/jsparser.py
Seems like a binding to V8 (JavaScript interpreter in Google Chromium) is available also, http://www.advogato.org/article/985.html
There is one, of an unknown level of completeness, written in RPython (a subset of Python, that is to say, it runs as normal Python): https://bitbucket.org/pypy/lang-js/overview
» pip install javascripthon
I don't want to use the term concise/terse, because many people take that to be a synonym for clever/confusing.
But Python is said to be a very readable language, due to syntax, whitespace rules, lack of {} etc, and is said to be 'executable pseudocode'. ES6 was a huge advance for JS and I find it a great mix of power and expressiveness.
Python:
def square(n): return n*n square2 = lambda x: x**2 def adder(x): return lambda y: x + y
ES6:
function square(x) { return x*x }
const square2 = x => x**x
const adder = x => y => x + yMaybe its because I'm used to it, but I find the JS versions easier to read/understand. Interestingly, the regular function syntax in python isn't more verbose than the lambda unlike in JS. Is there any difference between the Python version of square and square2?
I know python has things like list comprehensions and probably other things I'm not aware of that make it more powerful, and I'm curious how the 2 compare today.