Live data from Hacker News

C to Java Translation. Automatic, Complete, Correct. Free for Open-Source.

mtsystems.ch

51–55 of 55 posts

Re: C to Java Translation. Automatic, Complete, Correct. Free for Open-Source.

#51
post #34

Earlier quoted context omitted.

No, why would I want to do that unless I have a specific need for that? At least if you're using a Unix-like system, then understanding POSIX is essential for knowing how things work starting on an intermediate level.

And why would I want to understand how things work down in the OS? Anyway, C is a horrible language. Between Fortran and Ada it's unclear to me why C should be chosen for anything, inertia and herdthink aside.

Because it intersects with most of what you're doing. Why is that process supervisor I'm using crashing? Oh, it's still using select(2) instead of a modern I/O multiplexing mechanism, and exceeding its FD_SETSIZE limit. What do all these calls mean in my tracing output?

All the infrastructure you're using goes through C/POSIX in one way or another. When things go haywire, you can only get by fixing it on the higher levels or just blindly restarting for so long.

Re: C to Java Translation. Automatic, Complete, Correct. Free for Open-Source.

#52

Main author here. Let me know if you have any questions. I’d be happy to answer.

I tried so hard to break main arguments (char argv), on my last try I sent char argv to a function and It wrapped main, and inserted program name to beginning and called the wrapped main with new arguments. I give up.

Hahaha, cool!

Re: C to Java Translation. Automatic, Complete, Correct. Free for Open-Source.

#53

Earlier quoted context omitted.

I saw that ;-) The translation is: do { to.set((from = from.shift(1)).get(-1)); } while(--count > 0); which looks correct to me. Hence my question what orodley thinks is wrong.

I think you might be looking at the wrong thing on the Wikipedia page. The core feature of Duff's Device is interleaved switch and do statements: n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } (extraneous register s…

That would be a bug in the translation. We'll investigate. Thanks!

Re: C to Java Translation. Automatic, Complete, Correct. Free for Open-Source.

#55

Earlier quoted context omitted.

I think you might be looking at the wrong thing on the Wikipedia page. The core feature of Duff's Device is interleaved switch and do statements: n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } (extraneous register s…

That would be a bug in the translation. We'll investigate. Thanks!

Yes indeed. We handled goto into do-while statements wrong. Fixed now. Thanks!
Post reply on HN