[antlr-interest] postmortem

Andy Tripp antlr at jazillian.com
Wed Mar 12 11:55:26 PDT 2008


Jim Idle wrote:
>   
>> -----Original Message-----
>> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
>> bounces at antlr.org] On Behalf Of Andy Tripp
>> Sent: Wednesday, March 12, 2008 9:50 AM
>> To: antlr-interest
>>
>> * The original poster, having invested a few minutes to vent the
>> frustrations of himself
>>    and certainly at least a few others who didn't bother, goes on his
>> merry way. No
>>    ANTLR documentation has changed. 
>>     
>
>   
>> No warning message from ANTLR
>> saying
>>    "you don't have any ^ characters in your grammar, so you'll get a
>> flat AST, see the
>>    section on building ASTs in the book". 
>>     
>
> And just how is the tool supposed to know that that isn't what you want? Deus Ex Machina? :-) 
I don't see why anyone would ever want a flat AST.
If there are some such cases, then someone should try to get a feel for 
how many people really want flat ASTs vs.
those who don't.
> I see a lot of suggestions for warnings and errors and so on that surely seem reasonable to the requester, but in fact are specific to their particular situation. If you start spitting out warnings saying "You don't have any ^ characters", all you are going to do is annoy those who know about that, 
Right. So it may be that a warning would help 99% of the time and annoy 
1% of the time,
or vice versa. My guess is that 99% of the time, the flat AST is not 
what the person wanted.
And, of course, the added ability to silence warnings would solve the 
"annoy" problem - something very common
in many tools.
> and confuse those that don't. 
How would that message be confusing?
And wouldn't the newbie be the authority on whether it's confusing or not?
> Further, other than giving a link to a precise article on tree construction, 
Note that I never suggested giving a link to a precise article, I was 
careful not to.
> there isn't much information you can give out in a line or two of warnings. 
Well, I've just suggested a specific error message, I'm sure it could be 
improved.
Maybe it's not "much" information...but I think it would be useful 
nonetheless.
> Further still, at what point does this warning go away? When there are two ^ characters? 7? One on every production? Perhaps you were trying to illustrate a point, but the example isn't a good one.
>   
I would suggest the warning only appear if there are exactly zero ^ 
characters. But of course, an
optimal solution would be to try that and see how it works with real users.
>   
>> Just another newbie who
>> didn't
>> know how
>>    to enhance his grammar to build a decent AST. It's his own fault and
>> his own problem,
>>    because building parsers is hard, and he just wasn't up to it.
>>     
>
> Personally, I enjoy helping people get started and try to invest a little time in doing so. Perhaps this helps to curb my egotistical desire to take over the world Pinky. Most people are willing to take a bit of advice and a few pointers and invest their own time in learning. 
It's not that simple. Some people, such as this original poster, will 
read the basic documentation and maybe the books and maybe the wiki
and maybe even the mailing list. But with any software tool, it's best 
to catch any problems early and help the newbie along.
The guy called showTree() and got back something that didn't look like a 
tree at all. The fact that his answer is available
in the book, from the mailing list, or in the wiki is nice, but things 
could be better. Better to have the tool give him a
tree if it can, or at least give him a decent warning.
> I think that there are plenty of people on this list that are willing to help anyone. Some people though insist that they know everything already, are well versed in the field but despite this require someone else to write up everything they don't in fact know, for free, and make it available on a "front page". There isn't much you can do about that.
>   
I'm not sure how that relates, but if it's just a person dig at me, 
that's fine.
I'm happy to admit that I didn't know how to get a parse tree, and that 
I'm only willing to spend about 2 minutes looking through just
the book to figure it out before posting to the list. Sure, I probably 
could have spent more time and found my answer, but if I did
that then I wouldn't be providing the benefit of (subtly) pointing out 
that maybe the book should have this info.

> I also personally object to rambling and slightly insulting posts that don't name the tool correctly, are chock full of spelling errors (which isn't really excusable these days), grammatical errors (well, we are not all good at grammar, but one is trying to use a language recognition tool), and are written with the expectation that everyone should drop what they are doing and instantly help. Typos are one thing, I am as guilty of producing those as much as anyone, as I type at 3 million characters a minute but 95% of them are BS :-). However, can one not take a little care over the quality of the post? Is offering a little respect dead in the world?
>   
OK, well, I'm more worried about making the tools better (if you count 
my lame criticism as "helping") than about
spelling and grammar. There's certainly no reason to be insulted by bad 
grammar, spelling or naming of the tool.
> In all of this there seems to be a tacit assumption that people volunteering their time here did so to help people learn to write recognizers with language recognition tools. 
No, no, no! Not at all. In fact, I think the opposite: the helpful 
people here (and you clearly get the award for most helpful on the list)
are a great service. But can't we lighten their load with a few 
improvements to the tool? Don't you get tired of answering
these questions and wish for a few improvements?
> For the most part, this isn't true other than its use within a formal education curriculum. So attacking documentation and how-tos, or the fact that no one addressed issue xyz raised by abc doesn't really make any sense. The wiki is open to anyone to add documentation at any level they like and many people don't attack but wish someone would write up a few things, which is an eminently reasonable hope. Some people even write up a few things in their own time.
>   
Yes, well, sounds  like ye olde Open Source theory: since anyone can 
contribute, everything will be fine.
Well, in this instance, I would try having ANTLR produce the parse tree 
as an AST rather than a flat one.
Yet I'm not technically able/willing do that. Even if I could, by 
producing a fork of ANTLR, no one would use my version.
My only recourse is to try to convince Terence. Same with adding a 
paragraph to the book to show how to get a parse tree.
> It also seems reasonable to me that if you want to do anything seriously with such a free and necessarily quite complicated tool, that you might invest a few bucks in a book that will save you a lot of trouble. Sure, it doesn't cover every aspect of everything that everybody needs, but it is a hell of a good starting point. When I first needed to write something with yacc, I had the choice of buying a book for 40 quid, or 93 pints of best bitter (it was a long time ago ;-). So, I had to sponge of friends for the beer.
>   
I agree, but in this case, I don't think the book is going to really 
help explain the flat AST, without a very thorough reading.
That's just reality, as you can tell from the original post. Blame it on 
the individual if you want, but it's not uncommon
for people to avoid reading the whole book. I learned yacc without a 
book, and it was painful. Even though I'm sure
there are zillions of mailing list answers about how to use yacc, I'm 
sure it's still painful, because the tool is just not
user-friendly. ANLTR, of course, is far away from yacc on the 
user-friendly spectrum, but I'd like to see it go further.
> Nobody is saying "It's his own fault, it is hard", just that it is hard, and that the tool and the site aren't really geared up to be a training ground for this kind of knowledge; it is a bit unfair to berate people for not handing out free training. Not that you personally are saying that particularly, but you have spent an awful lot of time here debating the meaning of words like "syntax", which is no doubt interesting to you, made a presentation about ANTLR (more power to you), but I don't see anything in the Wiki from you that says "All your question about trees belong to us." I don't expect you to have done so, but I don't see why anyone should EXPECT anyone to do so unless they are paying for it.
>   
I'm not EXPECTing anyone specific to do anything without me paying for it.
I'm SUGGESTING and HOPING, but I realize there's no way that Terence 
could or should focus
on usability and documentation for newbies. I certainly don't mean to 
"berate" anyone.

As for me contributing more, I'm just not an expert on building trees in 
ANTLR, or anything else in ANTLR really.
I spend time with these long posts because I enjoy it (and used to think 
it was helpful, but having doubts now),
but I don't enjoy explaining stuff that I think could be
better covered by a warning message in the tool or a paragraph in the book.

I admire and appreciate people like you who know stuff in depth and put 
time into answering questions.
I'm just suggesting that a small change to the tool or book can be worth 
1000 wiki entries.

Andy

> Jim
>
>
>
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080312/91f634da/attachment-0001.html 


More information about the antlr-interest mailing list