3 ms·
I put 'compiler' in quotes because I was thinking of a research project a few years back which converted the Python byte code (parsed by CPython itself) into C
by dalke 15y ago
I put 'compiler' in quotes because I was thinking of a research project a few years back which converted the Python byte code (parsed by CPython itself) into C code, along with a small bit of peephole optimization. I don't think it's worthy enough to be called a transpiler.
The generated C code is still a stack machine. You could replace that with C code, but if you wanted to program to a stack machine then you likely wouldn't have been coding in Python in the first place.
Part of the nuisance in replacing that C code would be wading through all of the extra code Python generates, just to add two numbers.