Path: utzoo!attcan!uunet!husc6!cmcl2!brl-adm!umd5!mimsy!chris
From: chris@mimsy.UUCP (Chris Torek)
Newsgroups: comp.lang.misc
Subject: Re: What makes a language "easy" to program in?
Message-ID: <11829@mimsy.UUCP>
Date: 6 Jun 88 09:02:44 GMT
References: <10216@sol.ARPA> <1818@hubcap.UUCP> <29190@cca.CCA.COM>
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 49

>In article <1818@hubcap.UUCP> mrspock@hubcap.UUCP (Steve Benz) gives
two code fragments:
>>	int i,a[10];
>>	for (i = 0; i < 10; i++) a[i]=0;
and
>>	int *p,a[10];
>>	for (p = a+10; p != a; *--p = 0);

In article <29190@cca.CCA.COM> g-rh@cca.CCA.COM (Richard Harter) writes:
>What is wanted in this case is really something like ... or even
>	a = 0;
>... the quoted forms specify too much, and too little.  They specify
>too much in that they specify the details of the calculation, and too
>little in that the desired result is not explicit, but must be inferred
>from the results of the calculation.

That is, they say `how' (at some level) and not `what'.

>... The best programming language only has one instruction:
>	"Do what I want"

This is, alas, unrealistic.  We have enough trouble telling
(supposedly :-) ) intelligent people what we want done!

Something that would be interesting would be a semi-automatic system to
turn `how' into `what'.  Suppose you had an system language, where
you might feed in the original loop:

	for (i = 0; i < 10; i++) a[i] = 0;

and the system would ask, `Did you really mean set a[0] to 0, then
a[1], etc., or did you just mean to set all of a to zero?'  If you
answered the latter, it might `create' a construct:

	concept  /* set all of a to zero */;

then ask for a name for the concept and perhaps a parameterisation
(always `a', or any array? always all? etc.).

Clearly this sort of thing, being rather AIish (an optimisation expert
system---it is at least conceivable), is a bit beyond the state of the
art in conventional compilers.  But it would be nice to somehow get rid
of the notion of having to find vector-able FORTRAN loops, by replacing
them with the intended operation.  While the proposed FORTRAN 8X
standard gives some hope towards this, I would like to see something
more ambitious done.  (Not that I am going to do it! :-) )
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris