Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: Right-to-left (was: Re: entry at other than main)
Message-ID: <1989Aug26.221107.25606@utzoo.uucp>
Organization: U of Toronto Zoology
References: <19173@mimsy.UUCP> <207600032@s.cs.uiuc.edu> <19218@mimsy.UUCP> <10731@riks.csl.sony.co.jp> <230@ssp1.idca.tds.philips.nl>
Date: Sat, 26 Aug 89 22:11:07 GMT

In article <230@ssp1.idca.tds.philips.nl> dolf@idca.tds.PHILIPS.nl (Dolf Grunbauer) writes:
>For those unknown to APL: do you know that APL is so compact that an
>algorithm to get the first N primes can be written in just *ONE* expression
>(of about 25 characters), including the reading of N from the terminal ?

Yes, and a month afterward, even its author can't understand it without
half an hour of study.

I recall seeing an APL guru -- I think it was Iverson himself, in fact --
turn a straightforward algorithm (polynomial multiplication, I think) into
a single line of APL.  Quite impressive.  Also impressive that said line
was quadratic in space and exponential in time, where the original was
linear in both.	 (I may have some details wrong, this was long ago.)

>Another interresting thing of APL is that it is impossible to write a
>compiler for APL, and that is why there are only interpreters for APL.

There are some quite impressive APL compilers, actually.  As with many
such languages, the interpreter has to be around in the general case,
but most real programs can be compiled quite satisfactorily.  A really
aggressive compiler can even produce something quite efficient.
-- 
V7 /bin/mail source: 554 lines.|     Henry Spencer at U of Toronto Zoology
1989 X.400 specs: 2200+ pages. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu
