On an Extension of Functional Languages for Use in Prototyping CIP-Gegevens Koninklijke Bibliotheek, Den Haag
Total Page:16
File Type:pdf, Size:1020Kb
On an Extension of Functional Languages for Use in Prototyping CIP-Gegevens Koninklijke Bibliotheek, Den Haag Dorp, Hendrik Dick van On an extension of functional languages for use in prototyping / Hendrik Dick van Dorp. - [S.l. : s.n.]. - Ill. Proefschrift Enschede. - Met lit. opg. - Met samenvatting in het Nederlands. ISBN 90-9007594-1 Trefw.: programmeertalen. c Copyright 1994 by H.D. van Dorp, Leiden Het contact met Twente is deels mogelijk gemaakt door een regeling in het kader van de “Studie- faciliteitenregeling Rijkspersoneel” d.d. 26 maart 1984. Het drukken van dit proefschrift is finan- cieel mogelijk gemaakt door de Stichting BAZIS te Leiden. De ge¨entameerde vervolgonderzoeken zijn deels gefinancierd door de heer en mevrouw Van Dorp-Bos te Bussum. On an Extension of Functional Languages for Use in Prototyping PROEFSCHRIFT ter verkrijging van de graad van doctor aan de Universiteit Twente, op gezag van de Rector Magnificus, prof. dr. Th.J.A. Popma, volgens besluit van het College voor Promoties in het openbaar te verdedigen op donderdag 22 december 1994 te 16.45 uur. door Hendrik Dick van Dorp geboren op 8 september 1946 te Hilversum. Dit proefschrift is goedgekeurd door de promotoren: prof. dr. ir. A.J.W. Duijvestijn en prof. dr. A. Ollongren, en de assistent-promotor: dr. G.F. van der Hoeven. Preface The seeds of this dissertation originated in the Vertalergroep environment in the late sixties. There were long discussions on the rigour of Algol and the pleasures of Lisp, “the queen of programming languages” (Strachey), on the sturdiness of syntax and the charm of semantics,1 and on the Backus–Naur Form for fully describing a language’s outside, and five small functions for completely describing a language’s inner machinations. These discussions set me on a func- tional, declarative, course: the important thing being what has to be achieved, not how it has to be done, that is the other, orthogonal course, an imperative one. Other ideas that were set to ripe in those days are: ‘the general confusing of efficiency with efficacy’, or an effect does not have to be the desired effect, “... our unfortunate obsession with form over content, which Minsky deplored in his Turing Lecture ...”2 (and in this obsession forgetting to be really formal), and the ‘one-architect rule’ with its corollary, the ‘mythical man month’. These discussions might also have contributed3 to the character of the language used in these pages, as is so aptly described by Willard Orman Quine:4 “Good purposes are often served by not tampering with vagueness. Vagueness is not incompatible with precision. [...] Also, vagueness is an aid in coping with the linearity of discourse. An expositor finds that an understanding of some matter A is necessary preparation for an understanding of B, and yet that A cannot itself be expounded in correct detail without, conversely, noting certain exceptions and distinctions which require prior understanding of B. Vagueness, then, to the rescue. The expositor states A vaguely, proceeds to B, and afterwards touches up A, without ever having to call upon his reader to learn and unlearn any outright falsehood in the preliminary statement of A.” Heeding the wise advice of Professor Max Breedveld just before my graduation, “Being an engineer, you should first do some practical work before thinking of a dissertation”, it took quite some time before I started on it. However, as Lisp’s song ended in day to day business, its melody lingered on. So in the early eighties reading on functional languages and their practical use started, when I found in Professor Arie Duijvestijn a very interested, but busy, audience. The ensuing discussions in the mid-eighties with him and Gerrit van der Hoeven, Stef Joosten and Henk Kroeze, on linking Twentel with the outside world, in particular with a normal-sized 1 “ See the little phrases go, / Watch their funny antics, / The men that make them wriggle so, / Are teachers of semantics. ” Quoted from memory; source lost (Comm ACM , Tennent, ...). 2 R.W. Floyd, “The Paradigms of Programming”, Comm ACM 22(8) (Aug 1979): 455–460, (1978 ACM Turing Award Lecture, 4 Dec 1978), also on pp 131–142 of R.L. Ashenhurst and S. Graham (eds) ACM Turing Award Lectures — The First Twenty Years, 1966 – 1985. ACM Pr Anthology Ser, ACM Pr, New York / Addison– Wesley, Reading MA, 1987. In this book one can also find Marvin Minsky’s 1969 Turing Award Lecture, on pp 219–242, first published as “Form and Content in Computer Science”, JACM17(2) (Apr 1970): 197–215. 3 Another contribution might be a too early exposure to the Bommel saga, especially to the vocabulary of Terpen Tijn. 4 W.V.O. Quine, Word and Object. MIT Pr, Cambridge MA, 1960 (11th pr, Apr 1979), p 127. v relational database (“Backus meeting Codd”), set the course for the work to be done. I thank them for these stimulating discussions. For various reasons however, it was Lewis Carroll’s The Hunting of the Snark rather than his Alice, that lurked in the early footnotes: “Then you softly and suddenly vanish away, and never be met with again”. However, just before Professor Arie Duijvestijn’s Valedictory Lecture on 3 November 1989, it became clear that my Snark did not have to be a Boojum after all. So my debt to a great many people can finally be written. It is a paradoxical situation described by Duijvestijn in saying: “You have to do it all by yourself.” You do, but it can’t be done. My own set of helping bystanders (none of them owning a Cretan barbershop) runs as follows, to all of them I must express my gratitude for helping, encouraging, teaching and stimulating me in whatever way they did: Anticipating the first lines of Section 2.1, Margreet, Eveline and Henri¨ette, enduring my bodily presence when I was away on my quest for ‘referential transcendency’, supplied me with a warm, supporting environment, without that this would not have been possible. They urged me on when I needed so, and this in a very direct way, showing me the relativity of it all. Yet, how much they valued this work shows in the sacrifice of most of their 1994 summer holidays; As is clear from above Professor Arie Duijvestijn, my promotor, has been with this for well over a decennium. I owe him for this patience. He taught me the real meaning of ‘efficiency’, constraint, practicality and graphs, squares, &c, and once remarked on the work of the programmer: “An algorithm must not need oral explanation, it should speak for itself”; Though I appreciate and understand the ‘Leyden Prohibition’ regarding one’s promotor,Ido not choose to follow it: Professor Alexander Ollongren contributed many a incisive comment on structure, and clarified things by apparently simple questions, in short he added to the quality of my work. As a side effect of the process, he showed me the way to philosophy in informatica, marking the start of Chapter 1; Hans van Berne was in it longer than anyone else, because of his early influence on my education. Later he gave his precise comments on all my drafts, found a spurious bracket and kept the link to language and meaning in general by his witty marginal notes and by his laugh with a comment as follow up. Finally, he saved a large part of this work by proposing a shift in attention; Gerrit van der Hoeven, always showing the right amount of scientific doubt in a minimal number of words with a very good sense of humour, spotted immediately when ‘one doesn’t do it like that’ in a maze of words; Wim van Dam, (Slavonic) linguist, supervised my English and my comma’s and proved an enthusiastic reader — everything twice —; yet his influence stretched far beyond the English, though not as far as his celestial paraphysics; Gerard te Meerman asked the question, “Why?”, thus urging to take my position, and critically commented on large parts of this work; Henk Kroeze and Martin van Hintum supplied me with Twentel and were present when I needed advice and error corrections; vi Willy Schulte constructed some solutions that are mentioned in Chapter 5, also helped in other ways, besides, he was there to talk programming, birds and other matters; My parents, realising the importance of being functional, sponsored part of my further endeav- ours in this area; Paul Hendriks, though busy, could read early drafts and suggested many improvements; Vanja Rejger suggested a very good idea, its realisation definitely improved the form; Stef Joosten, Professors Gerrit Blaauw, Peter Naur and John Lansdown, Arthur Elias, Klaas van den Berg, Peter Asveld and Ahmed Patel provided me with literature, references, background material and supporting comments; And my colleagues within Spirit, especially Laurens Rijneveld who took over during all my holi-(writing)-days, and John Caubo and Arend Halfmouw who let me read their books; Finally, there are many people belonging to the class that Joost Engelfriet describes as “those whose ideas one uses unwittingly after many, many years”, I also acknowledge their contribution. This acknowledgment also holds for the class of people “whose contributions one uses and forgets to mention”. It is of course a gotspe to produce a dissertation on a subject related to functions and ‘referential transparency’ with TEX. For my gratitude to Jan Vanderschoot with respect to this language, I refer to the Colophon. Nevertheless, learning another exotic language — far from the mainstream — (like Lisp, Snobol, Trak and Prolog) with the full power of a Turing machine (as the common, business oriented languages cannot offer you, because they do not have recursion) turned out to be another good reason for procrastination.