News for hackers. Stuff that matters.
Re:C to Java Translation. Automatic, Complete, Correct. Free... by raverbashing on Wednesday April 29, 2015 @08:09AM (#9457671)
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?

Re:C to Java Translation. Automatic, Complete, Correct. Free... by marco2357 on Wednesday April 29, 2015 @08:56AM (#9457907)
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.

Re:C to Java Translation. Automatic, Complete, Correct. Free... by loopbit on Wednesday April 29, 2015 @09:04AM (#9457949)
> 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.

Re:C to Java Translation. Automatic, Complete, Correct. Free... by emsy on Wednesday April 29, 2015 @08:12AM (#9457683)
The main problem being undefined behaviour that is actually undefined and varies from compiler to compiler!
Re:C to Java Translation. Automatic, Complete, Correct. Free... by raverbashing on Wednesday April 29, 2015 @08:31AM (#9457777)
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)

Re:C to Java Translation. Automatic, Complete, Correct. Free... by TorKlingberg on Wednesday April 29, 2015 @09:18AM (#9458029)
You are free to assume that undefined behavior never happens. Unless you want to support invalid c programs.