The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Bakul Shah via TUHS <tuhs@tuhs.org>
To: John Levine <johnl@taugh.com>
Cc: tuhs@tuhs.org
Subject: [TUHS] Re: uphill both ways, was Re: What would early alternatives to C have been?
Date: Tue, 11 Mar 2025 12:24:24 -0700	[thread overview]
Message-ID: <00F9A32D-C233-4458-B2D4-E0994C5EAC9F@iitbombay.org> (raw)


On Mar 10, 2025, at 7:26 PM, John Levine <johnl@taugh.com> wrote:
> 
> In my 1971 compiler course at Yale, Alan Perlis made us try to write a compiler
> that translated a subset of APL into Basic. He suggested we write it in APL,
> which was a terrible idea, so I wrote it in Trac, for which I happened to have
> written my own interpreter.
> 
> 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.

Tim Budd in his 1978 work made quite a few changes to APL to
ease compilation and used yacc. [I have the book somewhere....]

[1] I do not recall if Iverson's original APL had a context sensitive
grammar but modern APLs do.
 
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.

             reply	other threads:[~2025-03-11 19:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11 19:24 Bakul Shah via TUHS [this message]
2025-03-11 20:11 ` John R Levine
  -- strict thread matches above, loose matches on Subject: below --
2025-03-10  2:03 [TUHS] " Douglas McIlroy
2025-03-10  2:28 ` Charles H. Sauer
2025-03-11  2:26   ` [TUHS] Re: uphill both ways, was " John Levine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00F9A32D-C233-4458-B2D4-E0994C5EAC9F@iitbombay.org \
    --to=tuhs@tuhs.org \
    --cc=bakul@iitbombay.org \
    --cc=johnl@taugh.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).