6 ms·
At first glance this seems to be for Python what Coffeescript is to Javascript, and I love Coffeescript (mostly). I would be interested to see some performance
by zniperr 12y ago
At first glance this seems to be for Python what Coffeescript is to Javascript, and I love Coffeescript (mostly).
I would be interested to see some performance comparisons with regular Python.
- Foxboron 12y agoNo not at all. Coffeescript is a transpiler. It converts its own code directly into javascript code. This project converts its code to AST, not Python code itself. You can generate the Python code off from the AST, but it dosnt always imply the resulting Python code is runable.
- CGamesPlay 12y ago> You can generate the Python code off from the AST, but it dosnt always imply the resulting Python code is runable. I believe this is incorrect. Can you show an example of a valid abstract syntax tree that could not be represented in the grammar of the original language?
- breuleux 12y agoI know that variable names in Python's AST can be any string, so for instance you could declare and use a variable named "+a-b$ $$?", even though that's not valid Python code. That's pretty minor, though, so I'm curious if there's anything more significant.
- Foxboron 12y agoWe got this very "problem" in Hy. AST allows for several characters as Names, where python does not. A great example is with gensym, here we will make an ast.Name node with a prefix ":", if you run astor over this, you produce AST containing that very character. What happens if you try run this Python code? Syntax error. There is also a few other cases i can't think off right now.