I have seen a tool (Shed Skin) to translate one high-level language to another high-level language. Apart from knowing those languages what are the other areas of technical knowledge required to develop this kind of translators?
-
One could say the most dangerous parts of such translations is in the edge cases. Those cases which one expects (as everything else did) to act the same. ... Which is a problem with non standardized languages, whose behaviour somewhat varies from implementation to implementation.– RookOct 7, 2011 at 12:05
-
1I dont see the point of these programms. You should use the right language for the job– Tom SquiresOct 7, 2011 at 12:25
-
@Tom Squires - Well, I thought the same .... but after seeing this SO question stackoverflow.com/questions/1189535/…, my mind is little on-required side :-)– droidsitesOct 7, 2011 at 13:37
1 Answer
You are developing a compiler here (a program that translates from one language into another), so I'd consider a firm background in compiler theory both crucial and sufficient to do the job.
Any further knowledge depends on the scope of the job. Compiling Java to C++ would, for example, be mostly trivial when you have a garbage collector implementation at hand. Haskell to C seems to be a much more complicated matter, judging from the slow progress of the ghc.
-
-
@TomSquires - Is it even possible to write a compiler without unit tests? How can you claim that the compiler works if you cannot say it works between cases -n and n+1?– RamhoundOct 7, 2011 at 13:08
-
2@Ramhound: You could prove it. If you write the compiler in a language with a sufficiently expressive type system, you could even have the type checker do the proof for you. (Remember: per the Curry-Howard-Lambek Correspondence, type checking is basically equivalent to theorem proving.) Note: I'm not saying that this is practical, though :-) Oct 7, 2011 at 14:37