Path: utzoo!attcan!uunet!world!esegue!compilers-sender From: meissner@osf.org Newsgroups: comp.compilers Subject: time to write a compiler Keywords: Fortran, question Message-ID: <9011051653.AA04571@curley.osf.org> Date: 5 Nov 90 16:53:11 GMT Sender: compilers-sender@iecc.cambridge.ma.us Reply-To: meissner@osf.org Organization: Compilers Central Lines: 67 Approved: compilers@iecc.cambridge.ma.us In-Reply-To: roman@gaudi.ccsf.caltech.edu's message of 31 Oct 90 18:06:32 GMT | From: roman@gaudi.ccsf.caltech.edu (Roman Salvador) | | I would like to find out the time it takes (more or less) to write a | compiler (i.e. a Fortran 90 one). It depends on lots of different factors, such as: the skill level and experience of the person(s) doing the work; the complexity of the language proper; the complexity of the library (if provided); the tools available; doing 'just' a front end and using an existing back end, or writing the whole ball of wax; the target machine(s); the desired optimization level(s). As another data point, I wrote the front end for the Data General MV/Eclipse C compiler from scratch to plug into the common language code generator and optimizer. It took about 9 months from the start of the project until I had a reasonable compiler (and another couple of years until it was rock solid). I seem to recall the library took about 4-6 months for the first cut, but since I didn't do much of this work, and we eventually rewrote a lot of it to tie in with a UNIX emulation library developed elsewhere, I may be off on this. I had a free hand in writing the front end, since the previous person on the project had left before doing much code development and I nuked what was left. Some things that I remember about this: I had to develop the compiler in PL/1, and it took some time to learn the language. I had to relearn C, since I had last used the V6 C compiler, and the language had changed since then. I was still a new programmer (I had graduated about 1-2 years previously). The parser generator that I used had some severe restrictions in the early days, since it was originally run in 16-bit mode, and could not handle 16 levels of precedence + the rest of C, so I had to do operator precedence in PL/1 rather than in the grammar. The reference manual (K&R) had some subtle flaws in it (you couldn't derive a function which returned a pointer to a function and took some arguments from the grammar). Convincing the code generator and optimizer to add new features that C needed (notably the ?: operator). Convincing the debugger to expand the common symbol table format, to handle user defined types, and C specific items. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142 -- Send compilers articles to compilers@iecc.cambridge.ma.us or {ima | spdcc | world}!esegue!compilers. Meta-mail to compilers-request.