[TUHS] v7 K&R C

Steffen Nurpmeso steffen at sdaoden.eu
Sun May 17 09:53:08 AEST 2020


Tony Finch wrote in
<alpine.DEB.2.20.2005142316170.3374 at grey.csi.cam.ac.uk>:
 |Larry McVoy <lm at mcvoy.com> wrote:
 |>
 |> It's got some perl goodness, regexps are part of the syntax, ....
 |
 |I got into Unix after perl and I've used it a lot. Back in the 1990s I saw
 |Henry Spencer's joke that perl was the Swiss Army Chainsaw of Unix, as a
 |riff on lex being its Swiss Army Knife. I came to appreciate lex
 |regrettably late: lex makes it remarkably easy to chew through a huge pile
 |of text and feed the pieces to some library code written in C. I've been
 |using re2c recently (http://re2c.org/), which is differently weird than
 |lex, though it still uses YY in all its variable names. It's remarkable
 |how much newer lexer/parser generators can't escape from the user
 |interface of lex/yacc. Another YY example: http://www.hwaci.com/sw/lemon/

P.S.: i really hate automated lexers.  I never ever got used to
use them.  For learning i once tried to use flex/bison, but
i failed really hard.  I like that blood, sweat and tears thing,
and using a lexer seems so shattered, all the pieces.  And i find
them really hard to read.

If you can deal with them they are surely a relief, especially in
rapidly moving syntax situations.  But if i look at settled source
code which uses it, for example usr.sbin/ospfd/parse.y, or
usr.sbin/smtpd/parse.y, both of OpenBSD, then i feel lost and am
happy that i do not need to maintain that code.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


More information about the TUHS mailing list