[antlr-interest] postmortem

Jim Idle jimi at temporal-wave.com
Wed Mar 12 12:37:45 PDT 2008


I think you miss the point. We can't 'know' that they did or didn't want a flat tree. Who is this someone that you are designating tasks like this to?

 

I would think that saying only 1% of ANTLR users would already know about ASTs is a bit light, but  I think it would actually annoy 100% of the time. If you don't know about ASTs then you don't know what it means and get annoyed if you are told to go buy a book. If you do know then you know what it means but must have wanted a flat tree at that point in your development cycle. I don't think that there is any problem to solve here, there are many more other warnings that need to be added before worrying about this I think. For a start, you have to turn on output=AST and that will surely prompt most people to ask themselves if they know anything about what one of these is?

 

I thought you said,, "And wouldn't the newbie be the authority on whether it's confusing or not?", so why are you asking me? ;-) It is obviously confusing if it tells you something that you don't know about, but can't really tell you what to do about it. I am all for improving error messages and warnings, but now I think you are arguing for this because you said it and are trying to defend it. I think it is an arbitrary example with no real need. It might just help one person in many hundreds, I can't say that it won't, but I can't really see it doing much for people. Now, improving "Can't find tokenRefBang.st" is (and was) worth some effort J

 

Try that and see what real users do when they don't get a message about having 0 ^ operators? Come on, you are just being contrary now. There are plenty of other examples that users hit all the time, the need to use ^ to generate a tree structure is hardly flooding the group with emails from "Confused of Springfield".

 

The book isn't designed to explain why you get a flat tree or really what an AST is. It does tell you how to go about building trees using ANTLR. The book would have to be about 500 pages longer to cover everything you need to know to start from scratch.

 

"I learned yacc without a book, and it was painful." Whereas it took me about a week because I had a decent book with some good examples and had already read the dragon book -  I hope you enjoyed the beer though J

 

"if it's just a person dig at me", no not you, Benjamin did not seem to ever post without requesting another piece of information that should be "right on the front page", I don't have any truck with you.

 

"I'm just suggesting that a small change to the tool or book can be worth 1000 wiki entries." Agreed that sometimes this can be the case. There are plenty of examples where the warnings need to be improved (or even supplied ;-) and they are mostly known about and will eventually get done I am sure. I guess I just get a bit on my high horse when there are lots of clamoring for docs and articles and so on, but few people actually want to put in any time doing it and when they do, a lot of people don't use the search to find it anyway.

 

Jim

 

PS: Post as long as you want about anything you want if you ask me, it ain't my list J

 

 

 

 

From: Andy Tripp [mailto:antlr at jazillian.com] 
Sent: Wednesday, March 12, 2008 11:55 AM
To: Jim Idle
Cc: antlr-interest
Subject: Re: [antlr-interest] postmortem

 

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/e9cfb70b/attachment-0001.html 


More information about the antlr-interest mailing list