Path: utzoo!attcan!uunet!husc6!cca!g-rh
From: g-rh@cca.CCA.COM (Richard Harter)
Newsgroups: comp.lang.misc
Subject: Re: What makes a language "easy" to program in?
Message-ID: <29190@cca.CCA.COM>
Date: 6 Jun 88 02:31:11 GMT
References: <10216@sol.ARPA> <1818@hubcap.UUCP>
Reply-To: g-rh@CCA.CCA.COM.UUCP (Richard Harter)
Organization: Computer Corp. of America, Cambridge, MA
Lines: 44

In article <1818@hubcap.UUCP> mrspock@hubcap.UUCP (Steve Benz) writes:

>  Just as with any other sort of optimization, there are ways to make
>things easier on the optimizer.  I'll demonstrate my point from analogy,
>consider these for loops (written in C):

>{	int i,a[10];
>	for (i = 0; i < 10; i++) a[i]=0;

>	--==*==--

>{	int *p,a[10];
>	for (p = a+10; p != a; *--p = 0);

>  I feel certain that the second for loop would run at least as fast
>as the first on a PDP-11.  Some optimizers would pick up on the
>fact that the first solution wasn't that great and would output
>something more closely resembling the second for loop.

	As a side point, this examples illustrates a comon deficiency
in programming languages -- they force the user to specify too much.
What is wanted in this case is really something like

	for i in {0,...,n-1} a[i] = 0;

or
	for all i in range of a, a[i] = 0;
or even
	a = 0;

	The point is that 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.  I would think
that a language would be easier to program in to the extent that you
can specify what you want the result to be directly.  The best pro-
gramming language only has one instruction:

	"Do what I want"
-- 

In the fields of Hell where the grass grows high
Are the graves of dreams allowed to die.
	Richard Harter, SMDS  Inc.