Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #14491

Re: RfD: Make ENVIRONMENT? obsolescent

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: RfD: Make ENVIRONMENT? obsolescent
Date 2012-07-29 01:07 +0200
Organization 1&1 Internet AG
Message-ID <jv1rav$744$1@online.de> (permalink)
References (14 earlier) <jupo05$ll7$1@online.de> <2012Jul26.161626@mips.complang.tuwien.ac.at> <juv0ic$iji$1@online.de> <7xboj0x0g1.fsf@ruckus.brouhaha.com> <XOCdndlRuvP2eo7NnZ2dnUVZ8mCdnZ2d@supernews.com>

Show all headers | View raw


Andrew Haley wrote:

> Paul Rubin <no.email@nospam.invalid> wrote:
>> Bernd Paysan <bernd.paysan@gmx.de> writes:
>>>> Concerning the Design Patterns book, I tried, but it always put me
>>>> to sleep.
>>> :-).  Yes, it isn't well written.
>> 
>> Be careful, Lispers and FP'ers tend to mock that book as illustrating
>> how bureaucratic and broken Java is, to make you do that stuff. 
>> Quite a few of the "patterns" are trivialities in functional style.
> 
> They are, but they're still useful patterns.

Actually, if a pattern is a triviality, it means that the programming 
environment gets it right.  I've no problem to accept that Java is 
broken and bureaucratic; it is.

I want to make this discussion in order to understand what people need - 
both from an OOP system as well as from the underlying implementation.  
Anton said, he thinks Forth as it is is good enough to build such a 
system, but he complained that scopes or namespaces are too complicated 
to implement (or rather impossible to implement in the subsection of 
Anton Forth and standard Forth, given that Anton doesn't like state-
smart words, and the standard offers no other way to implement such 
constructs).

Doug says that most of the time, he doesn't need polymorphism, but when 
he needs it, he wants it fully flexible as duck-type polymorphism.  I 
don't, I'm quite fine with a bit more bureaucratic approach to first 
declare interfaces and then be sure that I know at compile-time which 
part of the class hierarchy I'm dealing with.

However, when I think about this, it's actually a false dichotomy.  It's 
just that standard OOP vocabulary doesn't get it right:

You don't just have early and late binding.  You have two steps to bind, 
not just one.  The first step is to find out which part of the class 
tree you are in.  The second step is to find out which particular class 
you are in.  Thus you implement your methods via vtables (ordinary, 
dense tables), *and* you also implement them as hash table (which may 
produce an index into the vtable, so you can share the hash of a 
superclass).  Multiple interfaces (or multiple inheritance) means that a 
particular object can have more than one vtable, so the first step also 
needs the information which vtable implements the method.

If you don't know the object at all, or if you prefer to have all 
selectors visible (global scope), you use the duck type method - you 
take the effort to do the hash lookup, and then do the table call.  if 
you know the class hierarchy, you don't need that - it's an 
optimization.  Ideally, the system does that optimization for you when 
it can proof that this optimization is correct.  It can also compile 
early binding when it can proof that there is only one possible class 
receiving this message.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: RfD: Make ENVIRONMENT? obsolescent Doug Hoffman <glidedog@gmail.com> - 2012-07-20 11:15 -0400
  Re: RfD: Make ENVIRONMENT? obsolescent Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-20 20:18 +0200
    Re: RfD: Make ENVIRONMENT? obsolescent Doug Hoffman <glidedog@gmail.com> - 2012-07-20 16:27 -0400
      Re: RfD: Make ENVIRONMENT? obsolescent Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-21 00:21 +0200
        Re: RfD: Make ENVIRONMENT? obsolescent Doug Hoffman <glidedog@gmail.com> - 2012-07-20 19:49 -0400
          Re: RfD: Make ENVIRONMENT? obsolescent Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-21 15:42 +0200
            Re: RfD: Make ENVIRONMENT? obsolescent Doug Hoffman <glidedog@gmail.com> - 2012-07-23 21:02 -0400
            Re: RfD: Make ENVIRONMENT? obsolescent Doug Hoffman <glidedog@gmail.com> - 2012-07-23 21:31 -0400
        Re: RfD: Make ENVIRONMENT? obsolescent mhx@iae.nl - 2012-07-21 01:18 -0700
          Re: RfD: Make ENVIRONMENT? obsolescent Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-21 11:59 +0000
          Re: RfD: Make ENVIRONMENT? obsolescent Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-21 14:43 +0200
            Re: RfD: Make ENVIRONMENT? obsolescent Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-21 19:36 +0000
              Re: RfD: Make ENVIRONMENT? obsolescent Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-21 21:41 +0200
                Re: RfD: Make ENVIRONMENT? obsolescent Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-22 14:13 +0000
            Re: RfD: Make ENVIRONMENT? obsolescent mhx@iae.nl (Marcel Hendrix) - 2012-07-22 09:11 +0200
        Re: RfD: Make ENVIRONMENT? obsolescent anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-23 15:34 +0000
          Re: RfD: Make ENVIRONMENT? obsolescent Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-23 20:05 +0200
            Re: RfD: Make ENVIRONMENT? obsolescent anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-25 12:52 +0000
              Re: RfD: Make ENVIRONMENT? obsolescent Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-25 23:21 +0200
                Re: RfD: Make ENVIRONMENT? obsolescent anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-26 14:16 +0000
                Re: RfD: Make ENVIRONMENT? obsolescent Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-27 23:18 +0200
                Re: RfD: Make ENVIRONMENT? obsolescent Paul Rubin <no.email@nospam.invalid> - 2012-07-27 16:13 -0700
                Re: RfD: Make ENVIRONMENT? obsolescent Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-07-28 08:21 -0500
                Re: RfD: Make ENVIRONMENT? obsolescent Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-29 01:07 +0200
                Re: RfD: Make ENVIRONMENT? obsolescent Doug Hoffman <glidedog@gmail.com> - 2012-07-29 07:47 -0400
                Re: RfD: Make ENVIRONMENT? obsolescent Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-30 00:50 +0200
        Re: RfD: Make ENVIRONMENT? obsolescent Doug Hoffman <glidedog@gmail.com> - 2012-07-23 21:10 -0400
          Re: RfD: Make ENVIRONMENT? obsolescent Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-24 13:38 +0200
            Re: RfD: Make ENVIRONMENT? obsolescent anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-25 13:58 +0000
              Re: RfD: Make ENVIRONMENT? obsolescent Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-25 23:22 +0200
                objects (was: RfD: Make ENVIRONMENT? obsolescent) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-26 14:49 +0000
            Re: RfD: Make ENVIRONMENT? obsolescent Doug Hoffman <glidedog@gmail.com> - 2012-07-26 04:30 -0400
            Re: RfD: Make ENVIRONMENT? obsolescent Doug Hoffman <glidedog@gmail.com> - 2012-07-26 04:48 -0400
              Re: RfD: Make ENVIRONMENT? obsolescent Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-27 23:31 +0200
                Re: RfD: Make ENVIRONMENT? obsolescent Doug Hoffman <glidedog@gmail.com> - 2012-07-30 04:40 -0400
    Re: RfD: Make ENVIRONMENT? obsolescent Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-21 10:57 +0000
      Re: RfD: Make ENVIRONMENT? obsolescent Doug Hoffman <glidedog@gmail.com> - 2012-07-23 21:20 -0400

csiph-web