Path: news.f.de.plusline.net!news-fra1.dfn.de!news.tele.dk!feed118.news.tele.dk!postnews.google.com!e65g2000hsc.googlegroups.com!not-for-mail
From: Marshall <marshall.spight@gmail.com>
Newsgroups: comp.databases.theory
Subject: Re: more closed-world chatter
Date: 5 May 2007 13:17:35 -0700
Organization: http://groups.google.com
Lines: 62
Message-ID: <1178396255.293864.297010@e65g2000hsc.googlegroups.com>
References: <Bh6_h.155482$aG1.143414@pd7urf3no>
   <Wl6_h.155487$aG1.62925@pd7urf3no>
   <4639315f$0$4019$9a566e8b@news.aliant.net>
   <lCl_h.156056$DE1.84607@pd7urf2no>
   <f1croj$oii$1@orkan.itea.ntnu.no>
   <jnH_h.159449$aG1.54991@pd7urf3no>
   <f1i97b$ps0$1@orkan.itea.ntnu.no>
   <1178391422.291226.290880@l77g2000hsb.googlegroups.com>
   <l45%h.189$D52.60@trndny04>
NNTP-Posting-Host: 24.7.53.249
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1178396255 22326 127.0.0.1 (5 May 2007 20:17:35 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 5 May 2007 20:17:35 +0000 (UTC)
In-Reply-To: <l45%h.189$D52.60@trndny04>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: e65g2000hsc.googlegroups.com; posting-host=24.7.53.249;
   posting-account=s2xCFw0AAAD2mIwYYHAqjdsecwG0axmW
Xref: news.f.de.plusline.net comp.databases.theory:43810

On May 5, 12:40 pm, "David Cressey" <cresse...@verizon.net> wrote:
> "Marshall" <marshall.spi...@gmail.com> wrote in message
> > On May 5, 8:50 am, Jon Heggland <jon.heggl...@idi.ntnu.no> wrote:
>
> > > > when it comes to the advantage of sub-typing in dealing with
> > > > my question.
>
> > > I don't know about "advantage"; I just don't see how you can avoid it.
>
> > It's easy to avoid: just don't put subtying in the language design.
>
> > Much of the talk in language design in the last ten years or more
> > has focused on various mechanisms for subtyping, but it's an
> > entirely optional language feature. That's easy to forget when
> > it's all anyone's talking about, but it is possible to just leave it
> > out.
> > It's also possible to leave a static type system out entirely.
>
> You've lost me here.  As Bob pointed out a few days ago,
> all types can be considered subtypes of the universal supertype.
> Doesn't that mean that all typing is, in reality, subtyping?
>
> If so,  how can you implement typing without
> implicitly implementing subtyping?

Be sure to distinguish between a theoretic view of a formal
system that is outside the system, and the system itself.
We can analyze any type system with set theory, and
speak of the universal set, but that doesn't mean the
universal set is a concept within that system.

Imagine a programming language with exactly two types:
int and string. The language is statically typed, in that every
term in a program can be categorized as having one of
those two types. Functions arguments are either ints, (+ - * /)
or strings (append, length.) Some functions might take
one argument of each type: left("hello", 2). Any attempt
to use a term of one type as an argument that requires
the other type is a compile time error.

This language is statically typed, but has
no subtyping whatsoever.

Now, we can certainly speak of the set of all ints
and strings, but we can't express anything about
that set *within* this language.

Similarly, we can imagine a typed relational language
in which every attribute of every relation has a type;
all types are disjoint, and any attempt to join two
relations that have attributes with the same name
but different types yields a compile time error. Is
this the nicest thing you could do for the programmer?
Probably not, but then again this language can be
implemented quite easily and could produce
very efficient code.

As always, it's a tradeoff. :-)


Marshall

