71 karma · joined Jan 20, 2015 (11y ago) · 23 submissions
comment 11y ago · link · parent
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.
comment 11y ago · link · parent
But the approach is to get the correct translation first, and then - if needed - bottlenecks can be removed manually. This should lead to a better migration/upgrading experience.
comment 11y ago · link · parent
But I heard there are C++ to C translators. I don't know how good they are and how the resulting code looks like. But if they're decent, you could do C++ -> C -> Java :)
comment 11y ago · link · parent
Translating Java - in my experience - is very hard because of the extensive runtime system (reflection, base classes, synchronization, ...). E.g. if your application does System.out.println("Hello"); you already need the System and PrintWriter classes. They in return depend (among many other things) AWT which needs the security classes. And so on. A HelloWorld pulls in 1208 classes of the base library. They in return depend on java.dll which you have to re-implement from scratch. Or you rewrite all base library classes which is even harder.
I hope this gives you a basic idea of the problem.
comment 11y ago · link · parent
Translated applications still need to be thoroughly tested and usually some bugs are still found.
So we didn't formalize and verify our translation. Interestingly enough, we run into bugs in javac and ecj (Eclipse Java Compiler) surprisingly often. So verifying our translation would still lead to translations with bugs ;-)
Another fun fact: Since our translation knows the limits of allocated memory (and many other things), we found many illegal memory accesses in C programs that were unknown before (libgmp, micro httpd, vim, ...) since they didn't (or only very seldomly) lead to segfaults.
comment 11y ago · link · parent
I actually wrote a Java -> Eiffel translator:
http://se.inf.ethz.ch/research/j2eif
Based on that experience I can say it would be quite a big effort to write a Java -> C translator. But not impossible.
comment 11y ago · link · parent
Feel free to send us an email and we'll be happy to send you the other programs you're interested in.
You can also ask for translations of open-source software we didn't translate yet if you want to see the translation of a specific project.
20.
C to Java Translation. Automatic, Complete, Correct. Free for Open-Source.(mtsystems.ch ↗)
55 points · by marco2357 · 11y ago · 54 comments
comment 11y ago · link · parent
It's an automatic translation of the C version.
Like tomp said 4 hours ago: Like vim, just slower.™