4 ms·
Maybe I am too timid, but the closing word saying that once the transpiler is ready they could switch overnight seems a bit optimistic. I feel that splitting a
by seren 8y ago
Maybe I am too timid, but the closing word saying that once the transpiler is ready they could switch overnight seems a bit optimistic.
I feel that splitting as much as possible the project into chunks/components and then replacing them one by one sounds more realistic (with the appropriate test harness). Maybe that is the plan but it is not touched in the post.
And then maybe an issue that is not that bad, but you are going to have a hard time comparing old_codebase with new_codebase once you've switched. If you have to maintain old branches, porting the fix to recent branches will be more time consuming that simply do a merge.
- smt88 8y agoI think "a bit optimistic" doesn't go far enough. Even some excellent transpilers need manual intervention, and most transpilers I've used have weird edge cases that you can only catch through thorough unit testing. It sounds like the author has never transpiled a large code base into D before.
- Skunkleton 8y agoFor real. It is hard enough to port a project between compilers for the _same_ language, let alone transpiling to a different language.
- trishume 8y agoThere 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