Hacker News new | ask | show | jobs
by marco2357 4064 days ago
I've seen many research papers on Java -> C translation during my PhD. Some of them came with a prototype tool. But as with previous work on C -> Java translation, none of the tools actually really worked completely.

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.

1 comments

Thanks for the post. What was the big sticking point with the Java -> C translators?
It's easy to do a minimal prototype when doing research. But writing real translators means to get all the details right. In research we usually don't have the time for that.

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.

It certainly does. I can't imagine even starting on a project like this.