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.
Point taken that it is still a compiler.
41–47 of 47 posts
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.
Point taken that it is still a compiler.
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.
I for one am just waiting for the cis piler.
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.
No need to phrase it so nastily.
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
Well, you could always begin another scope with each assignment. auto var = // this type can't be inferred because it's not used { auto var = 2; } I'm too exhausted to think why this may not be applicable.
x = 2
if stringy: x = '2'
print x+x # 4 or 22???
C++: int x = 2;
if(stringy) string x = "2";
print x+x; // 4 (string x is out of scope)Earlier quoted context omitted.
This is how C++ templates work. They are a form of polymorphism through how you use the object and not based on its type. If you pass a type that cannot be used with the Being able to do this is part of why C++ templates are much more powerful than Java/C# generics and why they enable a different (and alternative) form of polymorphism to inheritance and explicit interfaces.
I see. In e.g Swift, you'd have to define before hand that T1 could be used with I assume this just duplicates the method for each type at compile time instead of at runtime try to figure it out? Damnit, now I wanna rewrite back to C++.
Earlier quoted context omitted.
I for one am just waiting for the cis piler.
An optimizing cispiler sounds really interesting. Something that applies all the optimizations that the compiler would do when translating your C to machine code but showing you the results in C. Of course not all optimizations are representable in C (calling conventions for instance) but many are.
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.
I'd defend the word 'transpiler' and I did my masters and PhD on language implementation, and that's where I work professionally now, so I'm not ignorant of compilers. I think it implies a translation from one high level language to another (not that 'high level' is well defined either), with only desugaring and maybe type-checking - no real lowering or optimisations. That's a useful subset of compilers, so can have…