4 ms·
There is precedent for this, even within D. The DMD compiler was originally written in C, and someone went to the effort to write a C to D transpiler, worked on
by trishume 8y ago
There is precedent for this, even within D. The DMD compiler was originally written in C, and someone went to the effort to write a C to D transpiler, worked on it until it was flawless, then ran it overnight and did the transition all at once: https://github.com/dlang/dmd/pull/4923 https://github.com/dlang/dmd/pull/4923
I think the Go compiler did something similar.
It certainly requires iteration of continuously attempting the translation until it works, and fixing bugs either in the transpiler or in the original codebase. But once everything seems to be in order, you can do the transition all at once.
- WalterBright 8y agoDaniel Murphy is the one who wrote the translator.
- atombender 8y agoThe original c2go Go transpiler used to transform the original C compiler to Go wasn't able to produce identically-behaving code, last I heard. It required manual editing. It's no longer maintained, but the fork [1] is much more ambitious, and aims to produce compilable, working programs. [1] https://github.com/elliotchance/c2go https://github.com/elliotchance/c2go