On Tue, 11 Mar 2025, Bakul Shah wrote:
I think my
compiler was the only one that worked, and it was pretty clever,
turning the APL array expressions into structures with array boundaries and
example expressions, with no array temporaries. It only generated the loops to
evaluate the expressions when storing into another array.
Someone got a PhD in 1978 for a similar compiling technique but in 1971 I was a
17 year old twerp so what did I know?
R's,
John
Pretty impressive for a 17yo!
Isn’t APL syntax rather context sensitive[1]? Neither yacc nor
a RD parser would’ve helped! Unless the subset was limited to a
context free subset.
APL at the time had a very simple syntax, once you got past all the
special characters. I wrote my compiler on a PDP-10 with ASCII terminals
so I just used keywords like IOTA.
Tim Budd in his 1978 work made quite a few changes to
APL to
ease compilation and used yacc. [I have the book somewhere....]
There's a copy at the Internet Archive. He and I were at Yale at the same
time and we knew each other a little, but neither of us was aware that
we'd come up with such similar techniques.
Given an expression ‘x y z’, its parse depends on the
types of
x, y & z. Example: y(x,z) if y is a dyadic verb, x & z are values,
x(y(z)) if x & y are monadic verbs, z a value etc.
You do need to know whether a symbol is a variable or some kind of
function, but that's not hard.
Regards,
John Levine, johnl(a)taugh.com, Taughannock Networks, Trumansburg NY
Please consider the environment before reading this e-mail.
https://jl.ly