Compiler

Matthew Tuck matty@box.net.au
Sun, 08 Nov 1998 11:51:21 +1030


What do we want in a compiler?  I feel in the near future we'll have to start work on a rudamentary compiler, so it's worthwhile to start to talk about.  These are some of the things I believe in:

* cross-compilation

All platforms of the compiler should be able to generate for all target platforms.

* heavy optimisation

Pull out all the stops to get a small fast executable.

This means inter-module AND inter-procedural optimisation.  Most compilers don't do the former, I'm not sure about the latter.  If the user doesn't want these optimisations performed, they don't have to elect to do so.  But as a final-compile-for-release option, we can really get programs faster and smaller than other compilers by doing this.

It also means doing heaps of optimisations.  It might be worthwhile looking at "plugin" optimisers.  You could use more than one in sequence if you desire.

Optimisation is more important as general flexible higher-level language constructs are introduced.

* efficiency

Don't worry about compile-time efficiency or run-time efficiency at first.  Just get a well-featured language off the ground, then we can rewrite the compiler in Ultra, and then worry about erfficiency.  If it's slow at first, we've got more scope to improve!  =)

* long-term

As I've stated earlier, I like the idea of intelligent editors which edit parse trees rather than text files.  This would move the scanner, parser and possibly type checker into the editor.

The compiler would be integrated into the intelligent editor like a normal integrated development environment.  Since some of the compiling tasks are done as the program is written, there is less compiling to do.  Also, the compiling can be done in the background while the user is typing the program in, or editing it.


That's all I can think about at the moment.  Does anyone else have any other ideas?

-- 
     Matthew Tuck - Software Developer & All-Round Nice Guy
                              ***
       Check out the Ultra programming language project!
              http://www.box.net.au/~matty/ultra/