Eric S. Raymond
esr at thyrsus.com
Wed Nov 8 04:01:43 UTC 2017
Gary E. Miller via devel <devel at ntpsec.org>:
> Maybe simple, maybe not, Maybe someone with Go skills has a clue?
Go skills aren't going to help. Those error messages are quite revealing - they
hint strongly that the translation is done by running a buttload of regexp
transformations on the input source code.
I'm quite familar with the advantages and limitations of that technique; I
once wrote a crude C-to-Python translator implemented similarly.
Knowing what I now do, I get why they dodn't document c2go and try to
finish it. Bashing source code with regexps is easy, flexible,
comment-and-whitespace-preserving, and can get you 80% of the way
to translation. But the wall you hit at 80% is impenetrable.
The problem is that the hard parts of language translation really need a
parser making an AST (Augmented Syntax Tree), then a transformation on the
AST generating a report in the target syntax. That's what you hit in the
last 15% - it's difficult to so and very difficult to integrate with
The Go guys gave up. They were almost certainly rightv to do so.
We should not expect c2go to be helpful.
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
My work is funded by the Internet Civil Engineering Institute: https://icei.org
Please visit their site and donate: the civilization you save might be your own.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 811 bytes
Desc: not available
More information about the devel