by pjmlp on 1/18/2016, 7:35:36 AM
by haberman on 1/18/2016, 5:36:04 AM
Key sentence: "The goal is to showcase the power of C++14 templates and not to create a fully functional transpiler."
Viewed through that lens, this is a really novel and cool demonstration.
by Sharlin on 1/18/2016, 8:48:14 AM
Should be noted that this only works on a "statically typeable" subset of Python where every variable has a de facto static type inferred at the first assignment. For instance, the following valid Python code would output invalid C++:
var = []
var = 2
by Fede_V on 1/18/2016, 6:34:06 AM
There's a few similar process. Shedskin, Nuitka, Pythran, etc. They are all pretty cool projects, and worth looking into just to learn new techniques.
by seivan on 1/18/2016, 8:58:12 AM
Would someone be kind to explain how the transpiler/compiler knows that num of T1 generic(?) type can be used with the <= operator? Or that something the user themselves have to define?
Wouldn't be something like "T1 where T1 is Numeric"?
Thanks!
by techdragon on 1/18/2016, 2:44:38 PM
Writing something like this for Python 2 is like throwing a urine filled water balloons at all the progressive developers working hard to get the Python community transitioned to Python 3.
Don't have enough reasons to stick with shitty old Python 2, well then here's another anchor for your boat!
Edit: The first pull request was for Python 3 support, hooray.
It is called a compiler even it outputs code in another language, transpiler is some neologism from JavaScript developers without a background in compiler design.