Learning dolphin smalltalk

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Learning dolphin smalltalk [Long]

Chris Uppal-3
[Right, I'll have another try at replying to this, and maybe my machine won't
crash *this* time...]

Damon,


> Where can I find additinoal
> information on Smalltalk meta-programming Is a there a good reference
> on Smalltalk internals, and doing things like modifying its Parser and
> runtime environment?

You are getting into (or near) advanced territory here -- no reason why you
shouldn't except that you'll find tutorial material thin on the ground. Much of
the best stuff is research (or research-flavoured) reports on extensions to, or
advanced uses of, the Smalltalk object model.

However, by way of a road map for Smalltalk metaprogramming:

First you need to get your understanding of the Smalltalk object model
complete. You need to understand how class objects contain the "method
dictionaries" that determine how their instances behave. What the difference is
between a "message send" and invoking a method. (a message send is a lookup of
the Symbol (aka Selector) in the method dictionary to find a method, which is
then invoked -- one more level of indirection than in C++/Java). Most of this
stuff is defined in class Behavior (from which Class inherits).

Next step, perhaps, is to understand how to do reflection. E.g.to find out what
instvars an object has, and how to get/set their values. E.g. see
Object>>instVarAt: and the methods in category 'instance variables' of class
Behavior. About this point you'll have to explore the difference between
indexed variables (such as are used in Arrays and Sets, for instance) and named
instvars (which are used all over). Also the difference between objects with
slots holding object references and "byte objects" (like Strings) which hold --
unsurprisingly -- bytes. There are examples in the image since
inspectors/debuggers have to do this kind of introspection.

After than, look at metaclasses (a good keyword for Google). Very roughly, each
class is an instance of its metaclass. A metaclass an anonymous singleton class
of which the main class object is the sole instance (that's how classes have
individual "class-side" methods -- they are all instances of different
metaclasses). See the Chammond Liu book that I recommended earlier for the best
explanation (indeed the only non-bad explanation) of this that I've seen.

All this, taken together is often called the Smalltalk MOP (a term borrowed
from the COLS world, it's short for "meta-object protocol" -- IMO the term is
misapplied to Smalltalk, but at least "MOP" is short and memorable).

However, you also asked about Smalltalk internals, which is a broader question.
I think the classic Smalltalk book "Smalltalk-80 the Language" by Adele
Goldberg and David Robson, is your best bet here. It's a bit dated, but still
mostly valid, if only for the concepts. OTOH, wandering around the Web and
using/Googling the comp.lang.Smalltalk newsgroup will probably help as well.
*Most* information you'll find about other Smalltalk dialects is also
applicable to Dolphin, although, again, the concepts are more relevant than the
nitty-gritty. VW and Squeak are the nearest to "classic" Smalltalk (and to
Dolphin). VASt is less so, and SmallScript/S# not at all (for these purposes).

And, of course, feel free to ask questions here.

The parser, which you specifically mention, is not (yet) exposed as Smalltalk
code in
Dolphin (it's implemented in a DLL). In D5 the Refectory Browser's parser is
part of the image, but that's only used for syntax colouring and buggering-up
my
code's layout (oh, sorry, that should read: "performing automatic refactorings"
;-). Handy to have around, but you can't change the language by modifying it.

-- chris


Reply | Threaded
Open this post in threaded view
|

[OT] OE crashes

Ian Bartholomew-18
Chris,

> [Right, I'll have another try at replying to this, and maybe my
> machine won't crash *this* time...]

That sounds familiar :-(

Have a look at the "Help/About OutlookExpress" menu option and scroll
down through the list until you find mshtml.dll.  If it version 1141
then the cause of the crashes is a bug introduced in a February
InternetExplorer update.

There is an interim patch from MS that fixes it - but I can't remember
the url offhand.  If the dll is the problem then mail me and I'll get
the details again.

--
Ian


Reply | Threaded
Open this post in threaded view
|

Re: Learning dolphin smalltalk [Long]

Ted Bracht-2
In reply to this post by Chris Uppal-3
>
> However, you also asked about Smalltalk internals, which is a broader
question.
> I think the classic Smalltalk book "Smalltalk-80 the Language" by Adele
> Goldberg and David Robson, is your best bet here. It's a bit dated, but
still
> mostly valid, if only for the concepts.

The most appropriate section for this is however the removed chapters
between the blue and the purple version. They are online though:

http://users.ipa.net/~dwighth/smalltalk/bluebook/bluebook_imp_toc.html

Ted
www.tedbracht.co.uk


Reply | Threaded
Open this post in threaded view
|

Re: Learning dolphin smalltalk [Long]

Damon
In reply to this post by Chris Uppal-3
I want to thank everybody for taking the time and effort to help me
get started on Dolphin Smalltalk.  I really appreciate the thought and
resources that has gone into these posts. After trying Dolphin out and
after reading these articles, I think I made the right choice in both
language and development environment.

Damon


12