Newsgroups: rec.arts.int-fiction
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!cyclone.bc.net!logbridge.uoregon.edu!uunet!sea.uu.net!ash.uu.net!world!not-for-mail
From: buzzard@TheWorld.com (Sean T Barrett)
Subject: Re: what's wrong with some existing IF languages
Sender: news@world.std.com (Mr Usenet Himself)
Message-ID: <Gz2t3q.2os@world.std.com>
Date: Thu, 11 Jul 2002 08:33:26 GMT
References: <Xns924696F5A38E7edmewsicSPAMGUARDcom@199.45.49.11> <agfei1$l7p10$1@ID-60390.news.dfncis.de> <Xns924755A2D30A1edmewsicSPAMGUARDcom@199.45.49.11>
Nntp-Posting-Host: shell01.theworld.com
Organization: The World Public Access UNIX, Brookline, MA
X-Newsreader: trn 4.0-test72 (19 April 1999)
Lines: 41
Xref: news.duke.edu rec.arts.int-fiction:106020

Ed  <ed@mewsic.SPAMGUARD.com> wrote:
>All three use dynamic rather than static typing.

The thing is, dynamic "typing" a la Smalltalk--polymorphism
by "overloaded" message passing--is an incredibly good fit
for dealing with all the different types of simulated objects
in the world.

Interleaving that style of polymorphism with static typing
is difficult; Objective C does it, but message selectors have
global type signatures--if library X defines (I'll use C++
notation for clarity) a method that implements
    obj->doSomething(int)
and library Y defines
    obj->doSomething(string)
you can't link the two libraries together, since the message
types conflict.

There may be a better solution--possibly by doing something
more ML like and inferring the types being <integer> and
<string> in those cases, but I think you're basically stuck;
those messages become global. This might actually be ok in
IF, if all the objects are really used as simulation objects,
but it gets annoying when you also have topic objects and
menu objects and conversation response objects.

Moreover, even after this, you're now stuck with either cobbling
in a second, *different*, object-oriented system if you want
OO-ish behaviors from your base types like string and int, or
you're stuck treating them as primitives, that is, writing C code.

Actually, though, there's another issue. Most of these languages
allow the idea that you might say obj->foo and it returns a string,
but maybe it was a string or maybe it was actually a routine which
returned a string. This is awfully convenient in IF with all of
its singleton objects, and doesn't map onto any mainstream
languages, as far as I know, although I don't think there's any
reason it couldn't. (Self, a Smalltalk-inspired language, is the
only one I know of offhand besides pretty much every IF language.)

SeanB
