Live data from Hacker News

Show HN: Python to C++14 transpiler

github.com

1–10 of 47 posts

Re: Show HN: Python to C++14 transpiler

#3
post #2

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.

This seems to me to be very close to what Pythran [0] is doing (since 2011), except that Pythran includes some type inference and bridge with Python code.

So view through that lens I'm not really seeing the novelty right now?

[0]: http://github.com/serge-sans-paille/pythran/

Re: Show HN: Python to C++14 transpiler

#5
post #4

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.

... and unpython, spyke .... all very cool and with their own spin. What is a little worrisome is the rate at which these get abandoned and how many of them target some specific subset of Python. I particularly liked unpython's take.

Re: Show HN: Python to C++14 transpiler

#7
post #6

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.

> It is called a compiler even it outputs code in another language

Indeed and most compilers do exactly that. Cant help getting a little annoyed whenever I hear this 'transpiler' word. I guess the ship has sailed, oh well !

Re: Show HN: Python to C++14 transpiler

#8
post #6

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.

You are right. C++ is quite different to Python and so it should be called a compiler.

But it fits the project since I don't have any background or experience in compiler design.

Re: Show HN: Python to C++14 transpiler

#10
post #6

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.

From what I've noticed, these "transpilers" output code that is readable (the code itself is written as though a human wrote it) where as "compilers" output code that has been optimized and show effects of name mangling in the code itself, etc. Just an observation.

I think it makes sense to use a different term for this "compiler"-esque behavior. For example, I might edit the output of CoffeeScript generated Javascript whereas I wouldn't know how to modify the output of gcc.

Post reply on HN