🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #216

Re: Algol 68

#216
From: Stefan Monnier
Date: Mon, 19 Oct 2026 03:34
52 lines
4196 bytes
Anton Ertl [2026-10-18 14:08:34] wrote:
> My take is that BNF was a big success in formalizing a part of a
> language.  So what do you do when you are successful?  You try to
> follow up on that.  So they wanted to formalize more of the language,
> and go beyond the limits of BNF (context-free grammars) with Vw
> grammars.  This was technically successful, but from a usability POV
> it was not.

Yup.  That was before type systems.

> Standard ML has been formally specified, and, given the audience of
> this language, if any programming language may have success going
> there, it should be a language like ML.  There is a first revision
> (1990) and a second revision (1997), and SML seems to have reached the
> end of its evolution there.

FWIW, I don't think the end of SML's evolution is a consequence of its
having a formal spec, but admittedly, some of the factors that made it
have a formal spec may have also been factors in the end of
its evolution.

> Concerning terms like "semantic errors" or "static semantics" they
> make it appear that there is a fundamental difference between syntax
> and "static semantics" (the part that is not context-free and that is
> checked by the compiler).  It seems to me that that's just a matter of
> what is expressed in the BNF.

Agreed.  The dividing line between lexical analysis, syntactic analysis,
and "static semantics" mostly comes down to what is most convenient
for a given set of tools: those things that work well with a regexp/DFA
get handled in the lexical analysis, then those which work well with
BNF/PEG are done in the syntactic analysis, and whatever's left over is
dumped into the "static semantics".

> E.g., in Algol 60 the computation of conditions for if-statements have
> special BNF rules, whereas some later programming languages have
> a boolean type and putting a non-boolean between IF and THEN produces
> a type error, not a syntax error.

Because in the mean time, people realized that moving it to types makes
for a simpler grammar and in return they let you have a more flexible
language where you can precompute those booleans into a variable that
you later test in the if-statement.

A related example would be `break` statements in C, which are allowed to
occur only in loops and switch statements: you could encode that detail
directly in the grammar, but it's usually considered easier to do it
later on as a "static check" (more clear, less code).  Not only it's
simpler but it also makes it easier to emit meaningful error messages.


=== Stefan
Technical Details
Message-ID: <jwvfqy2qsxc.fsf-monnier+comp.arch@gnu.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <2026Oct13.104347@mips.complang.tuwien.ac.at> <11au1vu$3ks5m$2@dont-email.me> <11aunpn$8c6$1@reader2.panix.com> <1792257076-5857@newsgrouper.org> <11b0bd3$b5b$1@reader2.panix.com> <1792265982-5857@newsgrouper.org> <11b0nak$iems$9@dont-email.me> <kqg9dl5oj9l0dih5kvnrif2fv91ns8lgs3@4ax.com> <2026Oct18.160834@mips.complang.tuwien.ac.at>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Stefan Monnier <monnier@iro.umontreal.ca>
Newsgroups: comp.arch
Subject: Re: Algol 68
Date: Sun, 18 Oct 2026 23:34:22 -0400
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <jwvfqy2qsxc.fsf-monnier+comp.arch@gnu.org>
References: <2026Oct13.104347@mips.complang.tuwien.ac.at>
	<11au1vu$3ks5m$2@dont-email.me> <11aunpn$8c6$1@reader2.panix.com>
	<1792257076-5857@newsgrouper.org> <11b0bd3$b5b$1@reader2.panix.com>
	<1792265982-5857@newsgrouper.org> <11b0nak$iems$9@dont-email.me>
	<kqg9dl5oj9l0dih5kvnrif2fv91ns8lgs3@4ax.com>
	<2026Oct18.160834@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Mon, 19 Oct 2026 07:08:33 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1938021"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19n5H4ga8oMizFsEQH0yAjIreBeTM11PPM="; posting-host="8e25fd6c44108343be23cbdfdc37dcf9"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:mZnjAcOhIIwHmk05hJUz0YwdQpE=
	sha1:NQDAnHooEDLjeEicYovf4iMXZ4c= sha256:Oc5W7PusFXlCHENwHOVL3DBovmO7ztT/d1RuixWKe9s=
	sha1:nFa+NYxHHp3vgs4/IiWoJdcTGJM= sha256:+V1fhxjQopuPSUqJdSZbOJL74VHPYZP0ien2Wrn3g3g=
In-Reply-To: <2026Oct18.160834@mips.complang.tuwien.ac.at> (message from anton@mips.complang.tuwien.ac.at (Anton Ertl) on Sun, 18 Oct 2026 14:08:34 GMT)