[Grace-core] Grace feedback

Andrew P. Black black at cs.pdx.edu
Mon Nov 8 00:25:28 PST 2010


On 4 Nov 2010, at 15:46, Dan Grossman wrote:

> * As others mentioned at the panel, a language that can be dynamically
> or statically typed from day 1 is probably still a research challenge.

I think that this is eminently doable.  All that is necessary is that we stick rigidly to our principle that types should not interfere with the language semantics for correct programs.  They do, of course, change  the kind of error message that one gets from an incorrect program, and when one gets it.

Why to I think that making types optional is doable?   Because, in essence, Emerald did it.  We allowed checking to happen at compile time or at run time, depending on how much was known.    Emerald did insist on syntactic markers at every place where type-checking was to be deferred, but this was a cosmetic decision, not a fundamental one:  we _wanted_ the programmer to feel that they were getting static checks, unless they turned them off.

However, I don't know how to do ADTs without types.  ADTs fundamentally need types to achieve the encapsulation.  Objects, in contrast, use procedural encapsulation, and work fine without types.   Objects are quite easy to teach to someone familiar with web services, or distributed systems, so I don't see that as a problem.  But I'm sure that you are right: some people will not like being forced to  use objects.

Of course, people can program around this.  A common response is to create "objects" that expose /all/ of their internal structure through methods.   I teach my students not to do this, but it is certainly possible.

One thing that we have not discussed is whether there should be some sort of "protect" or "narrow" operation that hides some operations on an object from certain clients, while exposing them to other clients.  This would let, for example,  the implementation of intersection to use an operation that enumerates the elements of a set in a well-defiend but arbitrary order, while hiding that same operation from the rest of the world.  

	Andrew


More information about the Grace-core mailing list