Hacker News new | ask | show | jobs
by raverbashing 4068 days ago
Interesting how gotos are translated to switches

90% of C should be pretty easy to translate, but of course, the devil (and a lot of functionality in existing libraries) is in the details.

There would be probably money in translating COBOL to Java, but maybe there are solutions already?

3 comments

Yep, supporting 90% of C took 10% of the time. Or even much less time.

Native C libraries (libc, libmath, ...) are just directly used from Java, not translated.

Yes, there is a lot of money in Cobol/Fortran to Java. Many tried, none successful (I know many stories). We'll look into those two languages in the future. But creating real translators takes years.

> There would be probably money in translating COBOL to Java, but maybe there are solutions already?

There is, Proyect NACA (http://developers.slashdot.org/story/09/06/24/1915205/Automa...).

Have a look at the generated codeif you want a good laugh, it translated COBOL code to Java line by line.

The main problem being undefined behaviour that is actually undefined and varies from compiler to compiler!
Yeah, you might need a config switch to configure what would you want to do with the most common undefined behaviours (or "just change" your C code)

(Because "just change" usually ends up creating other problems. Been there, done that, "code is wrong but works" and when you try to fix stuff breaks)

You are free to assume that undefined behavior never happens. Unless you want to support invalid c programs.