info-sather
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sather: templates necessary?


From: Norbert Nemec
Subject: Re: Sather: templates necessary?
Date: Tue, 10 Oct 2000 08:44:14 +0200
User-agent: Mutt/1.0.1i

On Sun, Oct 08, 2000 at 12:05:11AM +0100, address@hidden wrote:
> Recently I've been reading about Sather and Dylan; Sather for its
> different features (full overloading, subtyping/inclusion separation,
> iterators, etc.) and Dylan originally because I understand that it
> does not use templates.
> 
> Instead (AFAIK) Dylan uses a more general 'polymorphic system' which
> includes the functionality of templates into (IMO) a cleaner system.

Be careful: 'templates' as known in C++ and 'parameterized classes' in 
Sather are two distinct concepts: templates are something like a 
cut'n'paste mechanism. A template really only becomes a meaning at 
instantiation time. It is not "complete" before you tell the compiler 
what it should use for the template parameters. One of the results is 
that, quite often, you get ton's of error messages once use first 
instantiate a template, just because they could never be checked before 
by the compiler.

Parameterized classes on the other hand, could (if the compiler did 
work properly, which ours probably does not at the moment) even be 
compiled without being instantiated: Since every parameter of the class 
is known to fit some abstract class ($OB if none is specified), every 
occurrence could be just handled as a reference to a object of that 
type. Therefore you could have a precompiled library containing code of 
a parameterized class. Of course there is much optimization possible 
once the the class is instantiated, but that's another matter.

> My first question is whether Sather could move to using such a
> system (or not).

For that, it would be necessary to know the Dylan approach. In my 
experience, Sather hardly ever showed a real lack in such questions 
once it was checked properly. Where would I find infos about Dylan?

> Secondly, is multiple-polymorphism possible in Sather?
> Multi-methods?

What is it? Sounds strange to my ears, but it may well be, it is just 
called differently or included in some larger concept.

(The obove does not mean, that Sather is the most complete language, 
but rather, that many OO-languages are equally "complete". The concepts 
behind are very similar, but they show up in very different ways. 
Often, what is mentioned as *the key-feature* of one language is 
silently included as a minor detail in another language. Language 
design is less about creating concepts, but about picking the best of 
the existing and compose them to a aesthetic whole.)

Ciao,
Nobbi

-- 
-- ______________________________________________________
-- JESUS CHRIST IS LORD!
--          To Him, even that machine here has to obey...
--
-- _________________________________Norbert "Nobbi" Nemec
-- Hindenburgstr. 44  ...  D-91054 Erlangen  ...  Germany
-- eMail: <address@hidden>   Tel: +49-(0)-9131-204180



reply via email to

[Prev in Thread] Current Thread [Next in Thread]