Re: language design implications for variant records in a pascal-like language

Martin Rodgers <mcr@wildcard.demon.co.uk>
Tue, 18 Jan 2011 14:20:45 +0000

          From comp.compilers

Related articles
[52 earlier articles]
Re: language design implications for variant records in a pascal-like compilers@is-not-my.name (2011-01-16)
Re: language design implications for variant records in a pascal-like gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-01-16)
Re: language design implications for variant records in a pascal-like robin51@dodo.com.au (robin) (2011-01-17)
Re: language design implications for variant records in a pascal-like torbenm@diku.dk (2011-01-17)
Re: language design implications for variant records in a pascal-like dot@dotat.at (Tony Finch) (2011-01-17)
Re: language design implications for variant records in a pascal-like genew@ocis.net (Gene Wirchenko) (2011-01-17)
Re: language design implications for variant records in a pascal-like mcr@wildcard.demon.co.uk (Martin Rodgers) (2011-01-18)
Re: language design implications for variant records in a pascal-like robin51@dodo.com.au (robin) (2011-01-19)
Re: language design implications for variant records in a pascal-like 9cn6w6402@sneakemail.com (Peter Canning) (2011-01-18)
Re: error reporting, was language design implications genew@ocis.net (Gene Wirchenko) (2011-01-19)
Re: language design implications for variant records in a pascal-like martin@gkc.org.uk (Martin Ward) (2011-01-24)
| List of all articles for this month |
From: Martin Rodgers <mcr@wildcard.demon.co.uk>
Newsgroups: comp.compilers
Date: Tue, 18 Jan 2011 14:20:45 +0000
Organization: Compilers Central
References: 10-12-040 10-12-043 11-01-005 11-01-025 11-01-038 11-01-041 11-01-049 11-01-072
Keywords: syntax, design
Posted-Date: 18 Jan 2011 10:29:35 EST

Gene Wirchenko wrote:


>> BBC Basic was also irritating to me because, unlike the earlier Basic
>> implementations that I knew on on micros, the ROM was large enough
>> to support both control structures, so why pick just one?
>
> Microsoft BASIC 5 had WHILE but not UNTIL.


Yes, that struck me as odd at the time.


> I always look for the philosophy of a programming language.


Yes, that's useful too. I like Paul Graham's question about the problems a
language is intended to solve. That's part of the philosophy, I guess.


We could probably ask similar questions about compilers...Error reporting
and recovery has always fascinated me, probably because I was frequently
frustrated by the unhelpfulness of the error msgs given by so many tools.


My first lexer buffered text at the line level and counted the
characters and lines read so far, then provided them to the error
reporting code so that the line number and the line itself could be
given to the user, along with a '^' under the character at which the
error was detected.


This only worked in my compiler because it ran in a single pass. When
I began writing multipass compilers, I had to save the line and offset
numbers in the parse and/or syntax trees. Yes, it does require extra
effort, but several decades later my compilers still use this
technique. The line text itself, however, was only ever used in error
msgs in my first compiler.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.