notpushkin/pyrract

Look into pyxl

notpushkin opened this issue · 1 comments

https://github.com/gvanrossum/pyxl3 (Python 2: https://github.com/dropbox/pyxl)

Allows to write html-like code right in Python, just like JSX for JavaScript:

print(<html><body>Hello World!</body></html>)

One caveat is that it isn't much configurable (tags start with x_, output is only HTML, custom elements must be a subclass of x_element etc). I guess if we want to use it, we'll have to fork it.

(Suggested by @vutran. Thanks!)

This brings another strange idea back to my mind: it would be really great if we has a Babel-like transpiler for Python. Not only just for this pyxl syntax, but also maybe for some bleeding edge features, like async def@asyncio.coroutine decorator etc, or maybe even 3to2 translations.