[comp.lang.modula2] Operator Overloading/ size of compilers

UK4H@DKAUNI2.BITNET (JAE) (10/01/89)

Some thoughts... (have to add my stuff, too)

> I recently suggested operator overloading to Prof. Wirth. His argument is:
> the possibility you gain for coding programs does not justify the added
> complexity to the compiler. This guy is running for 'the smallest compiler
> in the world'-contest. His compilers are *really* small and *fast*.
> The Oberon compiler for the Ceres (NS32000 based) is just 39KB object code!
> It sure would be a nice feature to have, especially when you have object-
> oriented features (like in Object-Oberon). We're thinking about adding that
> to our Object-Oberon compiler...We'll see, just stay tuned.
>
>         Stefan

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
(I sometimes wish I had that in Modula-2)
I have mixed emotions regarding languages designed by Prof. Wirth.
I once was a total M2 fan, but now, after 2 years experience with it...
well, it can change once mind.
My "Language Of Choice" would be something like a mixture of ADA,
TopSpeed M2 and C++. Why? Well, ask me. (If I get enough requests, and
if I care to find out how to post FILES here, I might do it and post
a file here)

                  Juergen

Add: I'm new on EARN/BITNET/etc. so please don't get upset if I make
some mistakes. Better drop me a note.

Juergen Erhard
E-Mail: uk4h@dkauni2.EARN
Surface mail: forget it, this one's faster.
Phone: 0721/591602  (in Germany)

sludwig@ics.uci.edu (Stefan Ludwig) (10/02/89)

Juergen Erhard writes:
>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
>(I sometimes wish I had that in Modula-2)

I have to remind you that only the first versions of Turbo-Pascal were small:
40KB turbo.exe (and there was a good editor in it, too). But the new versions
with that 'UNIT' stuff, are also quite bulky. And the module construct in M2
is far better than that '#include' substitute of Turbo's.
One more thing about smallness: the Oberon operating system (multiple windows,
multi-task (single process, though :-(), with network software, multiple fonts,
garbage collector, and and and) is about 200KB. The whole operating system !!!
I'm always frustrated, when my small test programs on a UNIX machine add up to
200KB ...

>My "Language Of Choice" would be something like a mixture of ADA,
>TopSpeed M2 and C++. Why? Well, ask me. (If I get enough requests, and
>if I care to find out how to post FILES here, I might do it and post
>a file here)

If you'd have a mixture of ADA.... you'd end up with a compiler of ADA-size
and the slowness of those C-compilers on UNIX machines...
Besides, I hope, you just want to take the Class features of C--, not the syn-
tax (just being a pain in your POPO :-).
For ADA-like genericity, C-- classes and M2-Syntax, refer to Eiffel.

>                  Juergen

	Stefan

Stefan H-M Ludwig	"Don't flame my english, it's what
			 they teach us in Swiss schools"

E-MAIL:		sludwig@ics.uci.edu		until October 21st
		ludwig@badile.iis.ethz.ch	later

'TRUE'MAIL:	Stefan H-M Ludwig
		Hotel Engematthof
		CH-8002 Zurich, Switzerland

preston@titan.rice.edu (Preston Briggs) (10/02/89)

>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

MARKV@UKANVAX.BITNET ("MARK GOODERUM - UNIV. OF KANSAS ACS - MARKV@UKANVAX") (10/05/89)

One of the BIG reason's Turbo Pascal is so fast is it is a single pass
compiler.

My M2 system is also single Pass.  I can approach net speeds of a few hunred
to few thousand lines p/sec on a micro including imports.  I find the
inconvienice of FORWARD a small price to pay for the speed.

-Mark Gooderum
 MARKV@UKANVAX