The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Doug McIlroy <doug@cs.dartmouth.edu>
To: tuhs@tuhs.org
Subject: Re: [TUHS] Happy birthday, Ken Thompson!
Date: Mon, 04 Feb 2019 18:42:08 -0500	[thread overview]
Message-ID: <201902042342.x14Ng8Q2023252@coolidge.cs.Dartmouth.EDU> (raw)

> Ken wrote ... ed(before regexp ed)

Actually Ken wrote a regexp qed (for Multics) before he wrote ed.
He wrote about it here, before the birth of Unix:
Programming Techniques: Regular expression search algorithm 
Ken Thompson 
June 1968 Communications of the ACM: Volume 11 Issue 6, June 1968 

This is the nondetermistic regexp recognizer that's been used 
ever since. Amusingly a reviewer for Computing Reviews panned
the article on the grounds that everybody already knew how to
write a deterministic recognizer that runs in linear time.
There's no use for this slower program. What the reviewer failed
to observe is that it may take time exponential in the size of
the regexp (and ditto for space) to make such a recognizer.
In real life for a one-shot recognizer that can easily be the
dominant cost.

The problem of exponential construction time arose in Al Aho's
egrep. I was an early adopter--for the calendar(1) daemon. The
daemon generated a date recognizer that accepted most any
(American style) date. The regular expresssions were a couple
of hundred bytes long, full of alternations. Aho was chagrinned
to learn that it took about 30 seconds to make a recognizer
that would be used for less than a second. That led Al to the
wonderful invention of a lazily-constructed recognizer that
would only construct the states that were actually visited
during recognition. At last a really linear-time algorithm!

This is one of my favorite examples of the synergy of having
sytems builders and theoreticians together in one small 
department.

Doug

             reply	other threads:[~2019-02-04 23:42 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-04 23:42 Doug McIlroy [this message]
2019-02-05  3:49 ` Larry McVoy
  -- strict thread matches above, loose matches on Subject: below --
2019-02-04  1:09 [TUHS] Happy Birthday " Doug McIlroy
2019-02-03 20:23 [TUHS] Happy birthday, " Dave Horsfall
2019-02-03 21:39 ` Greg 'groggy' Lehey
2019-02-03 22:07   ` Dave Horsfall
2019-02-03 22:33     ` Clem Cole
2019-02-04  2:03       ` Paul Winalski
2019-02-04  3:57       ` Jason Stevens
2019-02-04  6:25         ` Peter Jeremy
2019-02-04  7:59           ` Steve Nickolas
2019-02-04 15:04             ` Dave Horsfall
2019-02-04 15:39             ` Toby Thain
2019-02-04 17:08         ` Al Kossow
2019-02-03 22:39     ` Michael Kjörling
2019-02-03 22:55     ` Steve Nickolas
2019-02-03 23:37       ` Andy Kosela
2019-02-04  0:32     ` Larry McVoy
2019-02-04  1:00       ` Steve Nickolas
2019-02-04  9:43 ` Donald ODona
2018-02-03 21:46 Norman Wilson
2018-02-03 20:57 Dave Horsfall
2018-02-03 21:12 ` Donald ODona
2018-02-03 21:59   ` Andy Kosela
2018-02-04  0:52     ` Dave Horsfall
2018-02-04  1:07       ` Lyndon Nerenberg
     [not found]         ` <CAM4FNSvnR+ZkgMyJ-0+p7LKKAYzts-7268RgApteLoT9q=TtYA@mail.gmail.com>
     [not found]           ` <CAM4FNSu-eQkt=AeUJ=2uvEwN=BQe7qdWn6ZCQmfFjb9at6uf_w@mail.gmail.com>
2018-02-04  1:29             ` Daniel Camolês
2018-02-04  1:35               ` Lyndon Nerenberg
2018-02-04  1:14       ` Warner Losh
2018-02-04 13:59         ` Theodore Ts'o
2018-02-05 13:13     ` Tony Finch
2018-02-05 15:45       ` Bakul Shah
2018-02-05 16:19         ` Clem Cole
2018-02-05 17:41           ` Bakul Shah
2018-02-05 21:58       ` Andy Kosela
2018-02-05 22:47         ` Dave Horsfall
2018-02-05 22:52           ` Toby Thain
2018-02-05 22:54           ` Dan Cross
2018-02-06  4:58             ` Theodore Ts'o
2018-02-06  5:05               ` Gregg Levine
2018-02-03 21:35 ` Will Senn
2018-02-03 21:49   ` Arthur Krewat
2018-02-03 22:59     ` Dave Horsfall
2018-02-04  0:51       ` Steve Simon
     [not found]         ` <CAM4FNStCAj-iFfg_DxyhkZMQu3dTx_4SeSsimALb3e1ktav2KQ@mail.gmail.com>
     [not found]           ` <CAM4FNSv41x28yGYcmVLhwjh9LUNfBPNq=dpgtv5jSNuRemsY8A@mail.gmail.com>
     [not found]             ` <CAM4FNSvMXLciCPUqZqaWLz7i0OMGesSWcPvETM4+p2Gj0zMPZw@mail.gmail.com>
     [not found]               ` <CAM4FNSsNomfRc6LNzFLFeA8EvgAgL7suJ9Zy_1gbVFsU2tkDDw@mail.gmail.com>
     [not found]                 ` <CAM4FNSu-Ktx5e0UmBkw+ceJzZaM5Y-gWi1DT05jS3eTAoV=tcA@mail.gmail.com>
     [not found]                   ` <CAM4FNSvxCrOiS=Qg9ntGrDA6P-7MW4pqTis7GpzBcLtTmj5NaA@mail.gmail.com>
     [not found]                     ` <CAM4FNSsYZx3h35s1509M4La50Gc_AyGtU4SWzg9iQMziuBUDNw@mail.gmail.com>
     [not found]                       ` <CAM4FNSsYNpdohKZPUaYsyHxUvCTbJ59KgLObZcRcmdsKuRLr5Q@mail.gmail.com>
     [not found]                         ` <CAM4FNStyCWwPTYVoZ1pcEJqTn-60P-1PTZdv=+P5F38tpUiLqg@mail.gmail.com>
2018-02-04  1:51                           ` Daniel Camolês
2018-02-04 17:33                             ` Toby Thain
2017-02-03 20:00 Dave Horsfall
2017-02-04 12:38 ` Michael Kjörling
2017-02-04 12:44   ` Steve Nickolas
2017-02-04 13:15     ` Michael Kjörling
2016-02-03 17:38 Dave Horsfall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201902042342.x14Ng8Q2023252@coolidge.cs.Dartmouth.EDU \
    --to=doug@cs.dartmouth.edu \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).