Re: How long does it take to build a compiler?

bj@hatch.socal.com (Brendan Jones)
Sat, 30 Oct 1993 21:59:47 GMT

          From comp.compilers

Related articles
How long does it take to build a compiler? ywlee@sparc0a.cs.uiuc.edu (Youngwhan Lee) (1993-10-27)
Re: How long does it take to build a compiler? lenngray@netcom.com (1993-10-29)
Re: How long does it take to build a compiler? bj@hatch.socal.com (1993-10-30)
Re: How long does it take to build a compiler? ywlee@sparc0a.cs.uiuc.edu (Youngwhan Lee) (1993-11-01)
Re: How long does it take to build a compiler? ryer@dsd.camb.inmet.com (1993-11-01)
Re: How long does it take to build a compiler? neitzel@ips.cs.tu-bs.de (1993-11-04)
Re: How long does it take to build a compiler? graham@pact.srf.ac.uk (1993-11-05)
Re: How long does it take to build a compiler? xjam@ginkgo.CS.Berkeley.EDU (1993-11-09)
Re: How long does it take to build a compiler? pardo@cs.washington.edu (1993-11-09)
[1 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: bj@hatch.socal.com (Brendan Jones)
Keywords: design, debug
Organization: Hatch Usenet and E-mail. Playa del Rey, CA
References: 93-10-124 93-10-139
Date: Sat, 30 Oct 1993 21:59:47 GMT
Content-Length: 2313

Youngwhan Lee (ywlee@sparc0a.cs.uiuc.edu) wrote:
: Now, I want to build a compiler on top of it. I'll enhance an existing,
: simple and well-defined language in mind to immitate.
: ... I need to estimate the time period for the project.


I couldn't find the full text original posting, so don't know what your
question was. If however you were looking for a description of "how long
it takes to build a compiler", the answer is, once you know what you are
doing... not very long at all.


:nostalgia mode begins.


Depends what grammar you are using. Because they are easy to code and my
languages fit the grammar, I always write LL(1) recursive descent parsers.
These are *very* easy to do, and easy to extend.


I wrote my first compiler when I was 18, with a buddy of mine. We started
at 8pm and had it finished by 4am.


Then I wrote a pascal-like compiler (it wuz *fast*) for the old Commodore
Vic 20 and Apple ][, complete with an inbuilt editor. These days a
debugger *is* essential, but "in those days" (1983) I think they were
unheard of. The runtime library took about two weeks. The compiler
itself no more than a week and a half. And this is with really lousy
tools, and in old-fashioned BASIC and in hand-coded assembley (yes, I
memorised the numbers and wrote them down by themselves). So, with lousy
tools on a machine with 16k RAM I was able to write a pascal-type language
with a development system in about three weeks. The Apple ][ port took a
similar amount of time.


Recently, I wrote a demo compiler for a friend. Using a PS/2 with Turbo
C++ I was able to throw together the skeleton LL(1) parser in three hours.
The catch was that the OBJ format that Microsoft uses is *really* *really*
messy. If I was to pump this thing into a full language I figure I would
spend most of the development time trying to understand the OBJ format.
Aside from that, it struck me how darned easy and quickly I was able to
put the compiler skeleton together. I figure if you know what you're
doing, you could belt out a new compiler... less the debugger... in about
a week. Nifty stuff like optimization and the like you can add as you
find the time.


Incidently, most of my data file are now in LL(1) format. It is that
easy, and once you've mastered it... fast!


cheers,
bj.
--


Post a followup to this message

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