RE: C to Eu translator

new topic     » goto parent     » topic index » view thread      » older message » newer message

> 
> How about only translating things that are safe and clear to do,
> e.g. replacing all symbols such as "//", "==", "++", "&&", "||", "~",
> and other stuff, thereby letting the C constructs that are not available
> in Euphoria such as goto, setjump, pointers, pass-by-reference,
> structures, etc. alone?
> 
> Then only the rest of the C program must be converted manually. Do you
> think that there are many C programs, where this would save a
> considerable amount of time, compared to converting the whole program
> manually? Or is it not worth the effort, to write such a
> "semi-translator"?
> 

Well, what is the ultimate purpose?  If you're doing something like the 
COM library or something where it is actually useful to mimic the 
C-style, then ok.

But you were talking about trying to learn from the code, but not 
understanding what it is doing.  If you have to do the important (hard) 
parts of the translation manually, you'll have to understand exactly 
what the C code is doing.  And once you understand that, it is much 
easier to just rewrite a Euphoria version from scratch (not a 
translation, but a re-expression of the same ideas in Euphoria) now that 
you know the things that need to be accomplished.

You can't translate C without understanding C, bottom line.  And if 
someone else made an auto-translator for you, the resulting Euphoria 
code would be no easier to understand than the original code...

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu