Magik is so much like Smalltalk...
When I first started using Magik it came very easily and naturally to me since I had lots of previous experience with Smalltalk. In fact the languages are so similar that I'm not sure why Magik was even developed. In a lot of ways I find Magik to be a step backwards from Smalltalk, certainly in terms of the default debugging tools that are shipped with it and the lack of version management built into the image (ala Envy in the Smalltalk world). There are some key differences in the languages, though.
First, there is no such thing as a class object in Magik. In Smalltalk classes are objects and new instances of that class are created by sending the class object a creator method (usually called "new"). The class object is a different object from instances of that class. The class object is an instance of the object type "Class." In Magik no class object is every created. What gets created instead is an exemplar - the first and base instance of the class in question. This is exactly the same object as any other instance of the class. New instances are created by copying (using the _clone keyword) this exemplar.
Because Magik doesn't have any class objects there are no class methods like there are in Smalltalk.
Magik allows for multiple inheritance just like C++ but unlike Smalltalk. There are pluses and minuses with multiple inheritance with the main minus being the potential to get really screwy class hierarchies and unneeded complication. This was the reason it was removed when Java was designed. Of course, merely having this capability doesn't cause any problems, but the Smallworld system is rife with multiple inheritance. I'll explore some examples of how this is handy in future posts.
Bill
First, there is no such thing as a class object in Magik. In Smalltalk classes are objects and new instances of that class are created by sending the class object a creator method (usually called "new"). The class object is a different object from instances of that class. The class object is an instance of the object type "Class." In Magik no class object is every created. What gets created instead is an exemplar - the first and base instance of the class in question. This is exactly the same object as any other instance of the class. New instances are created by copying (using the _clone keyword) this exemplar.
Because Magik doesn't have any class objects there are no class methods like there are in Smalltalk.
Magik allows for multiple inheritance just like C++ but unlike Smalltalk. There are pluses and minuses with multiple inheritance with the main minus being the potential to get really screwy class hierarchies and unneeded complication. This was the reason it was removed when Java was designed. Of course, merely having this capability doesn't cause any problems, but the Smallworld system is rife with multiple inheritance. I'll explore some examples of how this is handy in future posts.
Bill

1 Comments:
Bill, I have a GE Smallworld Magik position open here in Atlanta, GA. Do you know of anyone currently interested in a new position or where I might be able to find a user group down here in the Georgia area? Thanks for the help!
Cord Courrege
Recruiting Manager
Sapphire Technologies
770-664-6100
cord.courrege@sapphire.com
Post a Comment
<< Home