Right-to-left (was: Re: entry at other than main)

Henry Spencer henry at utzoo.uucp
Sun Aug 27 08:11:07 AEST 1989


In article <230 at ssp1.idca.tds.philips.nl> dolf at 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 at zoo.toronto.edu



More information about the Comp.lang.c mailing list