Systematic programming: an introduction

Today I found a small envelope in the mail. As far as I remember, I did not order anything of this size, lately. So I looked at the envelope. The front was filled with stamps. And my name and address in print. The back was empty, apart from a small ZIP code in writing: "3062 XE 15". For my SatNav this is good enough to knock on that door within the hour. But I'm not sure if that makes sense.

In the envelope was the book in the picture on the right. A collectors item. Yet, nothing in the envelope or the book itself that could give me a clue about the "why?" of it it all. Apparently some one wants to surprise me. And I can guarantee: you succeeded. I am surprised. Pleasantly surprised.

Thank you, Mr X!

Thank you for this book. I will cherish it and protect it with my life, if necessary.

But, you may say, why not contact the person who lives at "3062 XE 15"? Well, I will send this person a postcard. But I wouldn't be surprised if that person is not aware of the envelope. It doesn't make sense to send a book anonymously, and then put you zipcode on the return address field...

What's in the book? Easy: this seams to be the precursor, the forefather, of all later compiler construction and programming styles tutorials. The book dates back to 1973. The year I wrote my first lines of BASIC on a TeleType based computer. Here's the contents of the book:

  1. Introduction
  2. Fundamental notions
  3. The structure of computers
  4. Programming aids and systems
  5. Some simple programs
  6. Finiteness of programs
  7. Sequential notation and programming languages
  8. Data types
  9. Programs based on recurrence relations
  10. The FILE data structure
  11. The ARRAY data structure
  12. Subroutines, procedures and functions
  13. Transformations of number representations
  14. Processing of text using ARRAY and FILE structures
  15. Stepwise program development
Appendices:
  1. The programming language PASCAL
  2. The ASCII character code
This is an intriguing book and I will pay some extra attention to it in the coming summer. So check back to see how I progress. To start with: I retyped the first three chapters and put it online. Consult the navigator frame for the link.

Programming in Modula-2

This is the masterpiece that every serious Modula-2 programmer is after. The english version is the original, but it has been out of print for over a decade.
So mow it pays off to live in a small country near Germany: learning the language of the biggest foreign country is ideal to me. The english versions of PIM (Programming In Modula-2) may be unreachable, the german versions (which are equally good) are still available.

I got this copy through www.amazon.de. The book is in mint condition yet second hand. It has never been opened for reading. This book was money well spent. For me.

A small excerpt from the book. Mind you, this book was written in 1978, years before most of us bought their first computer:

This book assumes there is a basic knowledge of computers and the ways in which these are programmed. Still, it may be suitable to start with shedding some light on concepts and terminology. We know that -with few exceptions- programs were written, or rather: designed, in order to have them interpreted by a computer. This computer then carries out a process (a sequence of actions), based on the specification as described in the program. This process is also referred to as a calculation.

The program itself is a text. And since it usually describes a rather complicated process, which must be executed with utmost care and precision, this text in itself also must be very precisely defined. This kind of precision requires a very strict formalism. This formalism was coined the term 'language'. We use the word language, although languages normally are spoken and are much less strictly defined. Our target here is to describe the formalism (or language) Modula-2.

[...]

To summarize:

I should have entered the full first chapter, but you get an understanding of how the book was written.

The chapters are as short as possible and the examples are programmed as simple as possible, but not simpler. Here is one example from chapter 9:

MODULE Fractions;

FROM  InOut  IMPORT  Write, WriteLn, WriteString, WriteInt;
  
CONST  Base = 10;
          N = 32;


VAR    i, j, m, rem       : INTEGER;
       d                  : ARRAY [1..N] OF INTEGER;
       x                  : ARRAY [0..N] OF INTEGER;
			 

BEGIN
   FOR i := 2 TO N DO
      FOR j := 0 TO i - 1 DO  x[j] := 0  END;
      m := 0;
      rem := 1;
      REPEAT
         INC (m);
	 x[rem] := m;	 
         rem := Base * rem;
	 d[m] := rem DIV i;
	 rem := rem MOD i
      UNTIL x[rem] # 0;
      WriteInt (i, 6);
      WriteString (" 0.");
      FOR  j := 1  TO  x[rem] - 1  DO  Write (CHR (d[j] + ORD ("0")))  END;
      Write ("'");
      FOR  j := x[rem]  TO  m  DO  Write (CHR (d[j] + ORD ("0")))  END;
      WriteLn
   END
END Fractions.

And the output:

bash-2.05$ Fractions
     2 0.5'0
     3 0.'3
     4 0.25'0
     5 0.2'0
     6 0.1'6
     7 0.'142857
     8 0.125'0
     9 0.'1
    10 0.1'0
    11 0.'09
    12 0.08'3
    13 0.'076923
    14 0.0'714285
    15 0.0'6
    16 0.0625'0
    17 0.'0588235294117647
    18 0.0'5
    19 0.'052631578947368421
    20 0.05'0
    21 0.'047619
    22 0.0'45
    23 0.'0434782608695652173913
    24 0.041'6
    25 0.04'0
    26 0.0'384615
    27 0.'037
    28 0.03'571428
    29 0.'0344827586206896551724137931
    30 0.0'3
    31 0.'032258064516129
    32 0.03125'0
bash-2.05$
   
OK, now you all figure out what this program text is about and what the output actually does.

The school of Niklaus Wirth

This book is a tribute to professor Wirth, written by former students, assistant professors and admirers. ALl of them have spent considerable time with professor Wirth.

Learn who made which part of which system. Who designed the hardware and why. Read about how Philips made big profits by using the then ultra modern Lilith workstations.
Lilith and Ceres workstations were extremely powerful machines with fast and reliable operating systems and user programs. The reliability was caused by the fact that all over ETH people used them. And when there as some kind of problem, students could simply get the source, fix the error and recompile.
Now, that is something different from using MS Windows, like all the rest of the world did at universities.

The book contains many chapters and each one is from a different author. Many stories are told, clarifying some of the development trees of the Wirthian languages.
All stories are well written, whitty and a pleasure to read. Read about the introduction of the internet in 1983 by Diser AG. But they were too far ahead of their time... The ideas were there. The Lilith computers could do it all (graphics, mouse, laserprinter, network cards) but the network system wasn't there yet.

If you admire Professor Wirth, you must buy this book. You won't regret it. I bought mine via www.amazon.co.uk.

The table of contents:

  1. Niklaus Wirth, a pioneer of computer science.
    - Gustav Pomberger
    - Hanspeter Moessenboeck
    - Peter Rechenberg
  2. From programming language design to computer construction
    - Niklaus Wirth
  3. On the transitive closure of a wellfounded relation
    - Edsger W Dijkstra
  4. Oberon - The overlooked jewel
    - Michael Franz
  5. Compiler construction - The art of Niklaus Wirth
    - Hanspeter Moessenboeck
  6. Medos in retrospect
    - Svend Erik Knudsen
  7. Learn systems in an intrinsically complex world
    - Peter Schulthess
  8. Learning the value of simplicity
    - Stephan W Gehring
  9. Compiler construction versus Lotus Notes; a strange battle
    - Juerg Gutknecht
  10. Modules and components - Rivals or partners?
    - Clemens Szyperski
  11. A compiler for the Java Hotspot virtual machine
    - Robert Griesemer
    - Srdjan Mitrovic
  12. Designing a cluster network
    - Hans Eberle
  13. Programming with functional nets
    - Martin Odersky
  14. Lilith meets the world of business
    - Bernhard Wagner
  15. The chipcompany that made $ 100M with Modula-2
    - Robert Burton
    - Farrell Ostler
    - Thom Boyer
    - Fon Brown
    - Matt Morisse
  16. FFF97 - Oberon in the real world
    - Dr Josef Templ
  17. Serendipity
    - Kathleen Jensen
  18. Daily life with N. Wirth
    - Jirka Hoppe
  19. Third millenium culture
    - Ann Duenki

Algorithms and datastructures with Modula-2

Again, the english versions of this book were out of print and the current owners where keeping their copies. Which is perfectly understandable since I would (and will) do the same.

So I got myself a used copy in german language. Germany is just around the corner here so most dutch engineers and programmers speak and read german. Writing is a completely different story though.

The book explains in detail about the essence of computers and how to deal with this while programming the machines. It tells about datatypes, data representations, and data mining techniques long before those words were published in the Byte issues of the 90's.
Professor Wirth did it again: he taught about mining data, using fast and flexible algorithms, in the programming language that needs no comment lines.

I got this copy via www.amazon.de

The table of contents:

  1. Fundamental datastructures
  2. Sorting
  3. Recursif algorithms
  4. Dynamic datastructures
  5. Key transformations

Geek of the millenium

Professor Wirth was interviewed by a professional (and knowledgable) journalist where Professor Wirth spills his beans about modern day programmers and the involved languages. This is a must read for everyone who is serious in programming: http://www.simple-talk.com/content/article.aspx?article=747 . In case the link is dead, get yourself a copy of th PDF file I created and stored locally: Niklaus Wirth, Geek of the Week.

Page created June 2004,