9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Bruce Ellis" <bruce.ellis@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] Replacements for lex
Date: Sat, 20 Jan 2007 20:08:25 +1100	[thread overview]
Message-ID: <775b8d190701200108meaf9b99we39445c5dbd8bcce@mail.gmail.com> (raw)
In-Reply-To: <20070120084735.GD84021@mero.morphisms.net>

I taught a course in advanced compiler construction where the
students were required to write a lisp interpreter in C and then
write a rudimentry C compiler in their lisp.

The "bits you don't have to do" included the c lex function which
was presented to them in lisp as a (c:token) function.  I've written
a lot of lex-ers and it was just the same code again (in c) which
stopped the students from spending all of their time trying to do
the same in lisp.  This enabled them to concentrate on the more
interesting tasks (I also supplied the lisp alloc and gc code).

It was a fun course and I hope things were learnt.

For most stuff something like lex is fine.  Have a try at getting
<integer/float constant> reg-exp useable and I'll type in a lex-er
faster than you can debug the reg-exps (a chore i decided was
a waste of time for the course).

brucee

On 1/20/07, William Josephson <jkw@eecs.harvard.edu> wrote:
> On Fri, Jan 19, 2007 at 02:26:47PM -0500, Joel Salomon wrote:
> > >I think that most people roll their own lexical analyzers under Plan 9.
> > >That's typically not too hard to do, though.
> >
> > That's likely what I'll do for the final project (probably yet another
> > C complier, but I might try my hand with [a subset of] D), but the
>
> You'll learn a lot more if you don't try anything like C
> let alone C++ or D.  For a semester-length project, you'll
> learn far more if you work on a much smaller language --
> ideally domain specific, in my opinion -- and really see it
> through in detail.
>


  reply	other threads:[~2007-01-20  9:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-19 18:58 Joel Salomon
2007-01-19 19:12 ` Dan Cross
2007-01-19 19:26   ` Joel Salomon
2007-01-19 20:35     ` C H Forsyth
2007-01-19 21:06       ` erik quanstrom
2007-01-19 21:09       ` Taj Khattra
2007-01-19 21:18         ` Brantley Coile
2007-01-20  8:47     ` William Josephson
2007-01-20  9:08       ` Bruce Ellis [this message]
2007-01-19 19:13 ` Brantley Coile
2007-01-19 19:18 ` erik quanstrom
2007-01-19 19:24   ` Federico Benavento
2007-01-20  8:44 ` William Josephson

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=775b8d190701200108meaf9b99we39445c5dbd8bcce@mail.gmail.com \
    --to=bruce.ellis@gmail.com \
    --cc=9fans@cse.psu.edu \
    /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).