Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #3762

Re: A tiny self-hosting compiler used for teaching

From Christopher F Clark <christopher.f.clark@compiler-resources.com>
Newsgroups comp.compilers
Subject Re: A tiny self-hosting compiler used for teaching
Date 2026-09-07 23:26 +0300
Organization Compilers Central
Message-ID <26-09-010@comp.compilers> (permalink)

Show all headers | View raw


While I agree with our esteemed moderator's point about aesthetics, it
is worth noting that Wirth intentionally made Pascal easy to parse.
Thus, the Pascal declaration notation was designed to be parsed with a
one pass compiler.
Thus, arguing that the syntax is easy to read and understand has some
objective support.

However, it is worth noting that picking up C declaration syntax is
for the most part also simple and intuitive if one ignores pointers to
functions where we have both a prefix and a suffix operator that need
to be disambiguated as to their precedence.  But C's notation does
have the nice aspect that declaration syntax matches usage.

And, one can get both, although it looks a bit tortured to my eyes,
but it might just be that I'm not used to it, yet
You follow C's convention, but put the result type where the variable
goes in usage and then string the operators around it.
Moreover, If all the operators are suffix operators, there is also no
ambiguity over precedence..

a: int->[10] //  a pointer an array of 10  ints
b: int [10] -> // an array of 10 pointers to ints

******************************************************************************
Chris Clark                      email:
christopher.f.clark@compiler-resources.com
18 Meadow Rd               Web Site: http://world.std.com/~compres
Bolton, MA  01740 USA  voice: (508) 435-5016
------------------------------------------------------------------------------

Back to comp.compilers | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: A tiny self-hosting compiler used for teaching Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2026-09-07 23:26 +0300
  Re: A tiny self-hosting compiler used for teaching ram@zedat.fu-berlin.de - 2026-09-08 09:14 +0000

csiph-web