🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3543

Re: Type Systems and Dynamic Binding

#3543
From: Dan Bernstein
Date: Tue, 16 Apr 1991 23:30
63 lines
3619 bytes
In article <3843@ssc-bee.ssc-vax.UUCP> dmg@ssc-vax.uucp (David M Geary) writes:
> ]]   Dan Bernstein claims to be able to implement dynamic typing on top of C:
>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

David, there is a big difference between claiming that a *particular*
example of dynamic typing can be implemented (directly) in C, and
claiming that *all* examples of dynamic typing can be implemented
(directly) in C. As you will realize if you reread your article, I have
claimed the former, for several particular examples. I have not claimed
the latter, though of course a more powerful preprocessor obviates this
argument. In other words, please stop misquoting me; it's getting rather
tiresome.

> ]If you had been keeping up with the discussion in comp.lang.misc, you
> ]would understand that giving the same name to variables in different
> ]structures does NOT imply any magical connection between those
> ]variables. In order to solve your problem as stated, you must make the
> ]connection explicit, like so (as per my structure as above):
>   Exactly what I was trying to say.  Dan Bernstein is *not* implementing
> dynamic typing on top of C.

Making an explicit connection between button->redraw and mouse->redraw
has absolutely nothing to do with dynamic typing. There are statically
typed languages where the connection IS explicit: "redraw" is (in
effect) a string which is sent as a message to the object, and by
declaring two different objects that support "redraw" you automatically
make them usable in the same context.

>   Since it appeared to me that Bernstein was claiming to be implementing
> dynamic typing on top of C,

For each EXAMPLE of dynamic typing that people put up, I showed how it
would typically be implemented (directly) in C. I hope you can see the
difference between this and what you're talking about.

>   No.  Wrong.  Not done.  Dan is using his own structure instead of those
> I provided in the example.  In the example above, each object in wlist
> must be a void*.

Ah. So you're saying ``Developer A provides an almost entirely useless
function. It lets you count the number of objects in a window, or test
whether another object you have happens to be in the window. Gee, Dan,
you can't use this function to redraw everything in the window!''

What a shock.

Are you trying to solve real programming problems, or whimper about how
you can't solve them? I've shown you how they would be solved in C.
You're saying ``no, no, you're not allowed to solve them, because your
solution uses your structure rather than my structure.'' Who tf cares?
It's a solution. You can write a trivial interface to convert between
the structures. It works. End of discussion.

> You cannot implement
> dynamic typing in C without writing an external preprocessor.

You can implement all real-world EXAMPLES---or, at least, every example
that's come up in this group---of dynamic typing directly in C. That's
exactly what I've been doing. People say ``hey, here's a use of dynamic
typing,'' and I show them how a C programmer would accomplish the same
result.

---Dan
Technical Details
Message-ID: <27313:Apr1623:30:0391@kramden.acf.nyu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!psuvax1!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd
References: <3843@ssc-bee.ssc-vax.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!psuvax1!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd
From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein)
Newsgroups: comp.lang.misc,comp.object
Subject: Re:  Type Systems and Dynamic Binding
Message-ID: <27313:Apr1623:30:0391@kramden.acf.nyu.edu>
Date: 16 Apr 91 23:30:03 GMT
References: <3843@ssc-bee.ssc-vax.UUCP>
Organization: IR
Lines: 63