Newsgroups: comp.lang.java,comp.lang.c++,comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!newsfeed.internetmci.com!in2.uu.net!allegra!alice!ark
From: ark@research.att.com (Andrew Koenig)
Subject: Re: About ML and OO type systems (was Re: Will Java kill C++?)
Message-ID: <DqBGAp.2t1@research.att.com>
Organization: AT&T Research, Murray Hill NJ
References: <Dq0poC.3Iy@news.hawaii.edu> <BLUME.96Apr18103856@zayin.cs.princeton.edu> <317BF90E.226@netscape.com>
Date: Tue, 23 Apr 1996 13:04:01 GMT
Lines: 36
Xref: glinda.oz.cs.cmu.edu comp.lang.java:43082 comp.lang.c++:186308 comp.lang.smalltalk:37767

In article <317BF90E.226@netscape.com> David Christie <dc@netscape.com> writes:

> I've only read some of the literature on ML, never used it.  But isn't 
> it a strictly functional language?

No it's not.  It's easy to write conventional mutable variables
in ML (where they are called ``references'').

> My favorite quick test of a language's expressive power is, "could you 
> write a real operating system kernel in it?".

Yes and no -- in my opinion, the major difficulty would come from
the fact that all memory is garbage-collected in the typical implementation.
That makes it difficult to do things like guarantee quick response
to interrupts or fiddle the hardware directly.

> A 
> language without true objects -- in which values of a type can be 
> created but there is no such thing as a mutable object -- can get away 
> with a much simpler notion of type.

I don't think so.  Simpler, maybe, but not much simpler.

> What does intrigue me about ML is the idea of types that can be inferred 
> from their usage context, and so do not have to be declared explicitly. 
>  I have never fully understood how this works and whether it is relevant 
> to the design of OO languages as well as functional languages, or not.  
> Is it like structural type equivalence?

Not really -- that has little if anything to do with it.

It is true that ML type inference relies heavily on the fact that ML
has no automatic type conversions and only limited use of overloading.
-- 
				--Andrew Koenig
				  ark@research.att.com
