From: Piercarlo Grandi
Subject: Re: What other experimental languages connect to a windowing system? (was: Why is TCL successful ?)
Date: 
Message-ID: <PIERCARL.94Aug4194139@sabi.sabi.demon.co.uk>
>>> On Mon, 1 Aug 1994 14:54:06 GMT, ······@netcom.com (Henry G. Baker)
>>> said:

Henry> In article <··········@world.std.com> ·······@world.std.com
Henry> (Joseph H Allen) writes:

hbaker> ???????????  'Type inference' _hurt_ readability??  Perhaps you
hbaker> meant type declarations?

jhallen> IMHO, except for trivial programs, declarations improve
jhallen> readability because you can easily figure out what is stored in
jhallen> variables and arguments and don't have to trace constants or
jhallen> depend on operators not being overloaded.  You can jump into
jhallen> the middle of a program and start modifying it without
jhallen> comprehending all of it.

A very dangerous attitude indeed, in the general case. And where it
works it has nothing to do with the manifest/latent or static/runtime
typing issue, it can be done because the program is well modularized.

jhallen> It makes your programs less general perhaps, but definitly more
jhallen> readable.  Likewise, structures (records) are better than lists
jhallen> and tuples.

Agreed, lists and tuples are too general.

Henry> Aha!  We've finally smoked you out!  What you are complaining
Henry> about is the lack of a good code browser which would tell you
Henry> what a compiler knows about the various constructs that it sees.

Aha! We've finally smoked you out! You don't believe that programs are
about _communication_, i.e. texts that describe what the author
thinks. If you did, any extra annotations by the author are welcome,
because they enlighten the reader as to the assumptions of the author.

When I read a program I want to understand not what it does (using a
browser or a tracer), but what the author wanted to communicate with
it. _Then_ I shall check that the intent was correctly implemented.

When I see "const x" or "pure y", what I think is not "ah, a read-only
variable", I think "the author assumes that there will be no need to
change this variable's value". When I see "reducible proc p" I know that
in the author's intent the procedure's result only depends on its
arguments.

This is much more informative than just having a browser telling me
whether in fact a variable is or is not modified in a region of code
(and find a browser that will tell you whether a procedure is
reducible!). Of course I want the latter information too... But not
just that. I want to compare intent with actuality.

Henry> Rather than have to specify all this redundancy every time I
Henry> write a program, wouldn't it be better to have the program tell
Henry> me what it thought?

This redundancy is actually descriptive statements of the author's
intent. Communication, useful communication, about design choices. A
browser will not tell me anything about design choices, will only tell
me about what's there, not in the mind of the author.

Henry> This would be a much better tradeoff in terms of my time vs. the
Henry> computer's time.  For what it's worth, such a code browser is
Henry> much easier to write, due to (you guessed it) Lisp's trivial
Henry> syntax.

But I still want the author's annotations, perhaps compared to the
annotations synthetized by a browser.

All this assuming that the author agrees that the purpose of a program
text is to communicate a description to the reader, and puts in
descriptive annotations. A rare thing!

From: Ted Dunning
Subject: Re: What other experimental languages connect to a windowing system? (was: Why is TCL successful ?)
Date: 
Message-ID: <TED.94Aug6073825@lole.crl.nmsu.edu>
In article <·····················@sabi.sabi.demon.co.uk> ········@sabi.demon.co.uk (Piercarlo Grandi) writes:

   Henry> Rather than have to specify all this redundancy every time I
   Henry> write a program, wouldn't it be better to have the program
   Henry> tell me what it thought?

   This redundancy is actually descriptive statements of the author's
   intent. Communication, useful communication, about design choices.
   A browser will not tell me anything about design choices, will only
   tell me about what's there, not in the mind of the author.


what if my intent is to write a generalized and polymorphic procedure?

don't all those required type declarations get in the way of my
intent?
From: Joseph H Allen
Subject: Re: What other experimental languages connect to a windowing system? (was: Why is TCL successful ?)
Date: 
Message-ID: <Cu5KKw.6FI@world.std.com>
In article <················@lole.crl.nmsu.edu>,
Ted Dunning <···@crl.nmsu.edu> wrote:
>
>In article <·····················@sabi.sabi.demon.co.uk> ········@sabi.demon.co.uk (Piercarlo Grandi) writes:
>
>   Henry> Rather than have to specify all this redundancy every time I
>   Henry> write a program, wouldn't it be better to have the program
>   Henry> tell me what it thought?
>
>   This redundancy is actually descriptive statements of the author's
>   intent. Communication, useful communication, about design choices.
>   A browser will not tell me anything about design choices, will only
>   tell me about what's there, not in the mind of the author.
>
>
>what if my intent is to write a generalized and polymorphic procedure?
>
>don't all those required type declarations get in the way of my
>intent?

It depends on the language.  You could have a language which lets you
specify that a variable or function argument is any type, one of a set of
types (a union or ML style polymorphic type) or a type of a certain class.

The class method is particularly useful because then you could have any type
which has the proper attributes inherit the class specified for the argument
or variable.  The class name is then used for classifying which types are
allowed.  You could conceive of a system where integers are in the
whole-number class, the integer-class, and the exact-class, while floats are
in both the whole-number and integer-classes and additionally the
real-class, but not in the exact class.

A debate going on in other newsgroups is "sub-typing vs. sub-classing". 
Some think that a value of certain type should be usable in a variable if
the class specified for the variable has method names which are the same as
those of the class of the type.  This eliminates the need for inheritance
but I think it also prevents you from using class names as general attribute
specifiers.  I would be happier with the sub-classing idea if you had method
names which did nothing but indicate the presence of certain properties that
the type has.
-- 
/*  ·······@world.std.com (192.74.137.5) */               /* Joseph H. Allen */
int a[1817];main(z,p,q,r){for(p=80;q+p-80;p-=2*a[p])for(z=9;z--;)q=3&(r=time(0)
+r*57)/7,q=q?q-1?q-2?1-p%79?-1:0:p%79-77?1:0:p<1659?79:0:p>158?-79:0,q?!a[p+q*2
]?a[p+=a[p+=q]=q]=q:0:0;for(;q++-1817;)printf(q%79?"%c":"%c\n"," #"[!a[q-1]]);}