[antlr-interest] acceptance of new ideas (was philosophy about translation)
Kay Roepke
kroepke at classdump.org
Thu Oct 12 14:04:01 PDT 2006
On 12. Oct 2006, at 22:17 Uhr, Andy Tripp wrote:
> I think the "it's ok to generate less-than-perfect code" mindset is
> especially hard to get
> for someone in the compiler crowd.
Of course it depends. Clearly, no one can expect a code translator
that can convert huge programs
flawlessly, in every instance. Those who expect that probably have no
inkling about the problem domain,
even if they are successful compiler engineers. The sad thing is,
most of the time they are just pointing to
the really hard stuff and ignore the 90% of the work you can take off
their shoulders. Stupid behavior, if you ask
me.
What really interests me are automatic code refactoring (how I hate
that word) tools for a variety of languages (including
script languages that have a very implicit type system, like Perl).
In particular for Objective-C, since that has the immensely
fascinating mixture of both early and late binding,
the latter inherited from Smalltalk.
In that problem domain, accuracy is a must and it is a hard problem
to prove correctness of transformation, if you
cannot completely rely on types. You don't want to mess with code
that will be failing in obscure ways at runtime.
The effects of rearranging code can be hard to visualize so there
must not be any foul surprises lurking behind the corner.
Coming from that direction, your work interests me immensely, and
your success gives me the hint that it indeed is
feasible to try for something like I'm aiming at.
In that respect, it is of course valuable to know your motivations
for avoiding a tree based approach, and be it just
for seeing a different approach which causes me to reflect my
presuppositions, which is always good.
> Lex and Yacc where around for, what? 20 years
> before ANTLR came along? 20 years of people using lex and yacc, and
> getting things
> to work by trial-and-error because the generated code was
> unreadable? That's crazy!
> Thank goodness Terence came along and saw the value in generating
> readable code.
All hail the chief! :) BTW, I totally agree.
-k
More information about the antlr-interest
mailing list