Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!titan!preston
From: preston@titan.rice.edu (Preston Briggs)
Newsgroups: comp.lang.modula2
Subject: Re: Operator Overloading/ size of compilers
Message-ID: <1856@brazos.Rice.edu>
Date: 2 Oct 89 16:56:59 GMT
References: <"89-09-30-16:28:26.15*UK4H"@DKAUNI2.BITNET>
Sender: root@rice.edu
Reply-To: preston@titan.rice.edu (Preston Briggs)
Organization: Rice University, Houston
Lines: 42

>Well, I don't doubt that Prof. Wirth's compilers are *small* and *fast*.
>But Turbo-Pascal isn't that much bigger, and contains a lot more than
>ordinary Modula-2 (or Oberon). Just think of the STRING type in Turbo

>Juergen Erhard

Well, the string stuff in turbo is pretty easy.  Given the source
to some M2 compiler, you could add it relatively quickly with
no big impact on the size or speed.

About this speed thing...
I don't know how fast a Ceres (Oberon host) is, but I've always
been impressed with Turbo Pascal on plain ol' 8088s.
How do they do that?

Some speculations...

  There's no error recovery (stops at 1st error).  This saves
  (in a recursive descent parser) passing around sets of recovery tokens
  (by value).  It also saves some sundry set manipulation.

  Minimal I/O.  That is, they always compile memory to memory.
  (Or used to, I'm no longer current.)  Even when compiling
  from disk, the file was just loaded, then compiled.

  No optimization.  Actually, given the "qualities" of the 8088,
  this is a fine idea.

  The "right" algorithms and implementations.  There have been a variety 
  of papers in different places on how to minimize the costs of scanning,
  parsing, etc...  I'm thinking primarily of a series by Waite
  in Software -- Practice and Experience.  The idea is that everybody
  uses linear-time scanners and parsers like they should; but how can
  we make them really fast?

Otherwise, I have no great thoughts.  Probably they worked hard
and we're seeing the results of a lot of tuning and re-implementation.
In the case of Oberon, we're seeing the same thing, though spead over
several languages (ALgol-W, Pascal, Modula, Modula-2, others?).

Regards,
Preston Briggs