Penguin
Blame: AlgolWCompiler
EditPageHistoryDiffInfoLikePages
Annotated edit history of AlgolWCompiler version 8, including all changes. View license author blame.
Rev Author # Line
7 AristotlePagaltzis 1 !!! Retrocomputing project: an Algol W [Compiler].
5 GlynWebster 2
8 GlynWebster 3 I have written an Algol W [Compiler], [__aw2c__ | http://tiddly-pom.com/~glyn/], for historical reasons [1]. One reason: Algol W was the first language to support [DataStructure]s as types, that was a fairly significant step. There are OpenSource implementations of Algol 60[4] and Algol 68[5] but none for this third dialect, Algol W. --GlynWebster
4
5 __aw2c__ appears to be reliable: it has been used to compile the [a68h | http://mtn-host.prjek.net/projects/a68h/] Algol 68 compiler, which in turn produces correct output, I've been told.
6
7 According to Knuth's __aw2c__ ["Man or boy test" | http://en.wikipedia.org/wiki/Man_or_boy_test] __aw2c__ is a manly Algol compiler.
8
9 Read more about the compiler here: http://tiddly-pom.com/~glyn/
5 GlynWebster 10
11 !! What is Algol W?
12
7 AristotlePagaltzis 13 Algol W is [one of the first language designs | http://www.inf.ethz.ch/~wirth/projects.html] of NicolasWirth. Algol W is [Algol 60 | Algol] with string handling, complex numbers and dynamically allocated records, with some of Algol 60's syntactic idiosyncrasies stripped away. It kept Algol 60's "call by name" argument passing style, and is the probably the only other language to have used it. NicolasWirth presented it to the committee that was designing the successor to Algol 60, but it was rejected as a design basis in favour of a set of vague ideas that later became Algol 68. Which was a shame really, because Algol 68 turned out to be so difficult to implement it never really got off the ground, so programmers were left slogging along with [Fortran] and [COBOL] for long time.
5 GlynWebster 14
15 ! Why did Algol W disappear?
16
8 GlynWebster 17 It was not [Pascal]. Then it was not [C]. OS/360 is not that popular a platform anymore. Algol W was rejected as the template language for Algol 68. NicolasWirth went on to invent [Pascal], which superseded Algol 60 and Algol W in schools. The Stanford Algol W [Compiler] seems to have had annoying (but possibly unavoidable) limitations. And there was that whole "Is this GoTo really necessary?" thing. Historical reasons, like I said. :-)
5 GlynWebster 18
19 ! A little Algol W sample:
20
8 GlynWebster 21 <pre>
5 GlynWebster 22 __comment__ statements can be procedure parameters;
23 __begin__
24 __procedure__ vectoroperation (__integer__ j; __integer__ __value__ n; __procedure__ p);
25 __begin__
26 j := 1;
27 __while__ j <= n __do__
28 __begin__
29 p;
30 j := j + 1
31 __end__
32 __end__ vectoroperation;
33
34 __integer__ i;
35 __real__ __array__ a, b, c (1::10);
36 __real__ prod;
37
38 ''(initialize a and b here)''
39
40 vectoroperation (i, 10, c(i) := a(i) + b(i));
41 ''(''c'' is now the sum of vectors ''a'' and ''b'')''
42
43 prod := 0.0;
44 vectoroperation (i, 10, prod := prod + a(i) * b(i));
45 ''(''prod'' is now the product of vectors ''a'' and ''b'')''
46 __end__.
8 GlynWebster 47 </pre>
5 GlynWebster 48
7 AristotlePagaltzis 49 !! The [Compiler]
5 GlynWebster 50
8 GlynWebster 51 The __aw2c__ [Compiler] generates [GNU] [C] intermediate code. [Algol]- and [Pascal]-like languages can be translated into [GNU] [C] simply and directly because of [GNU]'s extensions to the [C] language: statement expressions, nested functions, variable length arrays and inline functions. They fit so well to this task that I think this is the very reason [GNU] added them. __aw2c__ does not extend the Algol W language but the [Compiler] does allow inline [C] code; this is for interfacing to existing [C] libraries and replacing [System 360 | http://en.wikipedia.org/wiki/System_360] assembly code, not general Algol W programming. The limits placed on the language by the Stanford [Compiler] have been lifted, nowadays we have the privilege of working on much more powerful computers.
5 GlynWebster 52
8 GlynWebster 53 I was originally thinking of modifying the [GNU Marst | http://www.gnu.org/software/marst/][4] [Compiler] to accept Algol W, but there were too many differences between the languages to make this practical.
5 GlynWebster 54
8 GlynWebster 55 !! Documents!
5 GlynWebster 56
8 GlynWebster 57 I have translated the ''Algol W Language Description'' from a partially [OCR]ed photostat[3] into [LaTeX], but I have not yet obtained permission to republish it. (I jumped the gun there.) But a good PDF of the original man can be found here: [Historic Documents in Computer Science | http://www.fh-jena.de/~kleine/history/history.html].
5 GlynWebster 58
59 ----
60
7 AristotlePagaltzis 61 [1] This isn't so odd, people restore old cars and computers, also go look at the [Retrocomputing Museum | http://www.pdc.kth.se/~jas/retro/retromuseum.html]
5 GlynWebster 62
8 GlynWebster 63 [3] [Stanford University Technical Report CS-TR-71-230.pdf | ftp://reports.stanford.edu/pub/cstr/reports/cs/tr/68/89/CS-TR-68-89.pdf] [[3.5MB], "This manual refers to the version of the Algol W [Compiler] dated 1.6 January 1972". It has a formal description of the language and a manual for its standard library is in the back, which is good. (This document was a print-out that sat in a ring-binder for years before someone scanned it with some weird OCR system that starts with a bitmap of the page, then replaces as many characters as it can with PDF text after guessing at their fonts. The system must work well on laser-printed documents, but electric-typewriter and ball-point documents seem to be just on the point were its effectiveness begins to break down. The result is readable but quite weird in places.)
5 GlynWebster 64
7 AristotlePagaltzis 65 [4] [GNU Marst | http://www.gnu.org/software/marst/] is 100 pages of very clear, simple [C] code, heavily and helpfully commented. I've printed it out and I'm reading it in bed. (Have you tried this? A really ''good'' piece of code is readable, and enjoyable. I'm sure I'm learning things. There are several signs of the author being an ''experienced'' hacker: he refers to RAM as "main core" for example :-)
5 GlynWebster 66
7 AristotlePagaltzis 67 [5] Marcel van der Veer's [Algol68G | http://www.xs4all.nl/~jmvdveer/algol68g.manual.html] and Sian Leitch's [Algol68toC port | http://www.sleitch.nildram.co.uk/algol68.html]
5 GlynWebster 68
69 ----
70 This is a subpage of [Projects].

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 2 times)