[comp.lang.c] Opinions on lex and yacc thus far....

kruger@16bits.dec.com (I've got 50nS memory. What did you say?) (03/02/88)

So far, everyone agrees that:

1)	lex is slow because it is so general.
2)	compilers usually do not need such a slow lex and can do better using a
	hand coded scanner.

all but one person agreed that yacc is:

1)	poor at error handling
2)	somewhat inefficient (although not as extreme as lex). Some said the
	tables were larger than necessary.

one person claimed that yacc is a high-quality tool, efficient, and robust.

Does this sound religious to you? ;=)
dov

henry@utzoo.uucp (Henry Spencer) (03/04/88)

> So far, everyone agrees that:
> 
> 1)	lex is slow because it is so general.

Not quite true:  lex is slow because its implementation is poor.  Van
Jacobson of LBL gave a paper at Usenix a year ago observing that if one
reimplemented lex for speed, it could consistently outrun hand-cooked
scanners.  Unfortunately, his paper didn't make it into the proceedings,
and he appears to have broken his promise to post it to the net.
-- 
Those who do not understand Unix are |  Henry Spencer @ U of Toronto Zoology
condemned to reinvent it, poorly.    | {allegra,ihnp4,decvax,utai}!utzoo!henry

tjt@ati.tis.llnl.gov (Tim Tessin) (03/05/88)

In article <1988Mar3.184732.1144@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
> > So far, everyone agrees that:
> > 
> > 1)	lex is slow because it is so general.
> 
> Not quite true:  lex is slow because its implementation is poor.  Van
> Jacobson of LBL gave a paper at Usenix a year ago observing that if one
> reimplemented lex for speed, it could consistently outrun hand-cooked
> scanners.  Unfortunately, his paper didn't make it into the proceedings,
> and he appears to have broken his promise to post it to the net.
> -- 
> Those who do not understand Unix are |  Henry Spencer @ U of Toronto Zoology
> condemned to reinvent it, poorly.    | {allegra,ihnp4,decvax,utai}!utzoo!henry

The LBL fast lex (flex) is currently in beta and they claim that a 
real, honest-to-god distribution version will be ready in March (this month).
The beta code is available from one of the lbl or berkeley machines via
ftp.  Unfortunately, I have deleted the article referencing which machine.
If you have good news archives, search for "flex" in most appropriate 
newsgroups.  It was about a month or so ago.  I have the code, but 
I hesitate to admit it lest I get deluged with request for it.  I haven't
tried it yet.

Tim Tessin - Lawrence Livermore National Laboratory 
Phone: (415) 423-4560 / 422-8971
ARPA:  tjt@ati.tis.llnl.gov
       tjt@lll-ati.arpa
UUCP:  {ihnp4,dual,sun}!lll-lcc!lll-ati!tjt

henry@utzoo.uucp (Henry Spencer) (03/06/88)

> The LBL fast lex (flex) is currently in beta...

The trouble with flex, as announced, is that it's not lex:  it's a rewrite
which is admitted to be not fully compatible.  That makes it a great deal
less interesting, because it means you can't count on being able to just
recompile to get the speed benefits.  This is really disappointing.  The
world does not NEED another incompatible variant of lex!
-- 
Those who do not understand Unix are |  Henry Spencer @ U of Toronto Zoology
condemned to reinvent it, poorly.    | {allegra,ihnp4,decvax,utai}!utzoo!henry