Re: is lex useful?

trd@murlibobo.cs.mu.OZ.AU (Tyson Richard DOWD)
30 Jun 1996 16:46:07 -0400

          From comp.compilers

Related articles
[15 earlier articles]
Re: is lex useful? Scott.Nicol@infoadvan.com (1996-06-27)
Re: is lex useful? 72510.2757@CompuServe.COM (Stephen Lindholm) (1996-06-27)
Re: is lex useful? kanze@lts.sel.alcatel.de (1996-06-27)
Re: is lex useful? bart@time.cirl.uoregon.edu (1996-06-30)
Re: is lex useful? Robert.Corbett@Eng.Sun.COM (1996-06-30)
Re: is lex useful? leichter@smarts.com (1996-06-30)
Re: is lex useful? trd@murlibobo.cs.mu.OZ.AU (1996-06-30)
Re: is lex useful? WStreett@shell.monmouth.com (1996-06-30)
Re: is lex useful? dmr@bell-labs.com (1996-06-30)
Re: is lex useful? clark@quarry.zk3.dec.com (1996-07-01)
Re: is lex useful? bromage@cs.mu.OZ.AU (1996-07-02)
Re: is lex useful? kanze@lts.sel.alcatel.de (1996-07-02)
Re: is lex useful? colas@aye.inria.fr (1996-07-04)
[1 later articles]
| List of all articles for this month |

From: trd@murlibobo.cs.mu.OZ.AU (Tyson Richard DOWD)
Newsgroups: comp.compilers
Date: 30 Jun 1996 16:46:07 -0400
Organization: Comp Sci, University of Melbourne
References: 96-06-073 96-06-105
Keywords: lex

kelley@phys.ocean.dal.ca says...
>So, my question is: if lex is useful, why isn't it used? Is there
>some snag (speed problems, perhaps, or difficult to port code?) that
>makes it smart to avoid lex?


Scott.Nicol@infoadvan.com (Scott Nicol) writes:
>The most common complaint is speed, but I don't think that is relevent in
>most applications. With a typical compiler (especially an optimizing
>compiler), scanning is among the cheapest components, consuming perhaps 5% to
>10% of the total compile time. Even if you bring the scan time down to 0,
>you have only speeded up the compiler 10%.


But it's probably a very cheap 10%. And if you sped the rest of the
compiler up, that scanning time is going to look more and more
attractive (eg speed rest of compiler up by factor of 2, now scanning
is nearly 20% of time). Of course, 10% is probably an overestimate for
a compiler that does a significant amount of work, as you've stated.


--
              Tyson Dowd
    trd@mundil.cs.mu.oz.au
http://www.cs.mu.oz.au/~trd
[For what it's worth, Ken Thompson's very fast Plan 9 C compiler hard coded
both the lexer and the parser for speed. -John]


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.