IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 1 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New More Questions
bluke: In a MOO system, objects pass messages back and forth, in a FOO system objects execute functions on other objects. It leads to different paradigms and different ways of thinking.

Can you give some concrete examples of the different ways of thinking? You mention distributed systems in your message. Any others?

bluke: A MOO system cannot be statically typed because an Object in a MOO system can handle any message that it doesn't understand (e.g. not for it's type) in any way that it pleases.

Is this a hard requirement? Can you imagine a static type system that would allow MOO-like constructions? Would type inference (like in Haskell) help?
--
-- Jim Weirich jweirich@one.net [link|http://onestepback.org|http://onestepback.org]
---------------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
New Re: More Questions
bluke: In a MOO system, objects pass messages back and forth, in a FOO system objects execute functions on other objects. It leads to different paradigms and different ways of thinking.

Can you give some concrete examples of the different ways of thinking? You mention distributed systems in your message. Any others?


The ability to capture messages can be very useful. For example, undo/redo can be implemented using this (you trap every message sent and then you can either undo them or redo them quite easily as you have the original message). Logging security can be done with this facility as well.

The other place its shows is in areas like constructing new objects, conditional logic, etc.. In Java, you have a special keyword new and a constructor is called. In Smalltalk, all you do is send a message to the class object to create a new instance, perfectly logical. In Java if then else is a language construct. In Smalltalk it is a message send. When you think in terms of messages, it makes sense to send a message for everything including object creation and conditionals.


bluke: A MOO system cannot be statically typed because an Object in a MOO system can handle any message that it doesn't understand (e.g. not for it's type) in any way that it pleases.

Is this a hard requirement? Can you imagine a static type system that would allow MOO-like constructions? Would type inference (like in Haskell) help?


I am not an expert on type inference or Haskell, but I don't see how it would help. For example how would it handle a proxy object which can take any message and just forwards it somewehere? A static type system would just impose constraints. Of course, using DoesNotUnderstand is not the normal way of doing things in Smalltalk, so type inference might be useful in those other cases.

New Re: More Questions
bluke: The ability to capture messages can be very useful. [undo/redo and logging mentioned]

I agree with the above, however ...

bluke: The other place its shows is in areas like constructing new objects, conditional logic, etc.. [...]

These examples are not so clear to me. Exactly how does the MOO-ness of a language contribute to object construction and conditional logic. For example, it is possible (although tedious) to do condition logic in Java (I've done it). However, most of the tedium would be aleviated by a simple anonymous closure syntax and relaxed type rules. Given those, I'm not sure how a message based system (ie. the ability to reify messages) would contribute.
--
-- Jim Weirich jweirich@one.net [link|http://onestepback.org|http://onestepback.org]
---------------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
New It relates more to the mindset
In a FOO like language you are calling functions, therefore to call a function like new is not out of synch with the language, in a MOO language where everything is messages then everything is messages including object construction.

Again, this is more related to mindset and feel then anythng concrete.
New In past discussions with Freep...
...one of the things that he talked about was the ability to use the mechanism to do some creative dispatching - specifically a mechanism that emulated multiple-dispatch or a Visitor type scenario.
New Where does polymorphism fit in?
I had a brief discussion with a colleague today about what polymorphism was. It seems to me that a MOO-type language would handle polymorphism better because the determination about what type of object it is occurs at invocation time, whereas in a FOO-type language, this could not be so because the compiler needs to know the object type.

Except it doesn't. C++ is a FOO-type language, but it supports polymorphism.

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New Polymorphism via inheritance/interface
Static languages achieve their polymorphism either through a common base class or an interface implemented by the class. In dynamic languages, you just call the method and it either responds or it doesn't. This means that the Types in dynamic languages are much more fluid.
New Example
GLORP (Generic Lightweight Object Relational Persistence) allows you to specify queries as blocks of code.

db readManyOf: User where: [:user | user username = 'Blanchard' && user password = 'passW0rd' ].

given a table: CREATE TABLE USER (USER_NAME varchar(60), PASSWORD varchar(60))

how can this work?

The second argument to readManyOf:where: is a block of code. The block is evaluated with a MessageLogger standing in for user. ie

readManyOf: aClass where: aBlock
| aMessageLogger |
aMessageLogger := MessageLogger forClass: aClass
aBlock value: aMessageLogger.

The MessageLogger's doesNotUnderstand is examining the messages and producing an equivalent SQL translation based on some attribute to column mapping data it has. Since even the operators are actually messages, this is relatively straightforward to do. In Smalltalk that is.

This is just plain impossible in Java/C++/Object Pascal/etc.




Smalltalk is dangerous. It is a drug. My advice to you would be don't try it; it could ruin your life. Once you take the time to learn it (to REALLY learn it) you will see that there is nothing out there (yet) to touch it. Of course, like all drugs, how dangerous it is depends on your character. It may be that once you've got to this stage you'll find it difficult (if not impossible) to "go back" to other languages and, if you are forced to, you might become an embittered character constantly muttering ascerbic comments under your breath. Who knows, you may even have to quit the software industry altogether because nothing else lives up to your new expectations.
--AndyBower
Expand Edited by tuberculosis Aug. 21, 2007, 05:45:22 AM EDT
New Re: Example
GLORP [...]

Fascinating. I've thought about this problem, but assumed that the code block would have to be parsed. Executing the block and tracing the messages is a great example of "out of the box" thinking.
--
-- Jim Weirich jweirich@one.net [link|http://onestepback.org|http://onestepback.org]
---------------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
New Statically Typed Smalltalk
Can you imagine a static type system that would allow MOO-like constructions? Would type inference (like in Haskell) help?


The project was called Strongtalk.

[link|http://www.cs.ucsb.edu/projects/strongtalk/pages/index.html|http://www.cs.ucsb.e.../pages/index.html]

"The Strongtalk system was developed in secret in the mid-90's by a small startup company. Before the Strongtalk system could be released, the company was acquired by Sun Microsystems, Inc. to work on the Java\ufffd virtual machine[1]. Development of Strongtalk was halted at that point, so very few people have ever had a chance to see the Strongtalk system in action."

There is some work going on in VM optimization to duplicate this and provide optional static typing. Optional static typing makes optimization much easier and consequently the thing can run faster by taking advantage of more highly optimized routines.






[1] - Fuckers.



Smalltalk is dangerous. It is a drug. My advice to you would be don't try it; it could ruin your life. Once you take the time to learn it (to REALLY learn it) you will see that there is nothing out there (yet) to touch it. Of course, like all drugs, how dangerous it is depends on your character. It may be that once you've got to this stage you'll find it difficult (if not impossible) to "go back" to other languages and, if you are forced to, you might become an embittered character constantly muttering ascerbic comments under your breath. Who knows, you may even have to quit the software industry altogether because nothing else lives up to your new expectations.
--AndyBower
Expand Edited by tuberculosis Aug. 21, 2007, 05:45:29 AM EDT
     Message Object Oriented vs Function Object Oriented - (JimWeirich) - (71)
         It's not so much a Language issue... - (ChrisR) - (28)
             Mind Games - (JimWeirich) - (27)
                 The biggest difference is how one treats the interaction - (ChrisR) - (26)
                     Now a Language Issue again - (JimWeirich) - (25)
                         Is it "missing methods" or "invalid messages" it handles? - (CRConrad) - (23)
                             Both. - (admin) - (22)
                                 Sorry, I don't think you quite understood what I meant. - (CRConrad) - (21)
                                     Needlessly pedantic, IMO. - (admin) - (20)
                                         OK, so why don't we do it that way, then... - (CRConrad) - (8)
                                             Lose the chip... -NT - (admin) - (3)
                                                 OK, bye, then. (Heard anything from Addison, lately?) -NT - (CRConrad) - (2)
                                                     Suit yourself. -NT - (admin)
                                                     You can do it (new thread) - (orion)
                                             FOO bad. MOO good. - (ChrisR) - (2)
                                                 Mooooooo. -NT - (admin)
                                                 Re: FOO bad. MOO good. - (JimWeirich)
                                             Re: OK, so why don't we do it that way, then... - (JimWeirich)
                                         Method VS Message - (JimWeirich) - (10)
                                             Sure. -NT - (admin)
                                             Re: Method VS Message - (tuberculosis) - (8)
                                                 Re: Method VS Message - (deSitter) - (7)
                                                     Didn't you finish that smalltalk history doc Todd showed us? - (FuManChu) - (1)
                                                         Re: Didn't you finish that smalltalk history doc Todd showed - (deSitter)
                                                     In theory yes, in practice no - (bluke) - (4)
                                                         You must cheat - but you must not get caught - (tuberculosis) - (3)
                                                             Yes exactly - (bluke) - (2)
                                                                 Hmmm sounds as if - (Ashton) - (1)
                                                                     Not *so* clever - (tuberculosis)
                         At that level, it is a language issue... - (ChrisR)
         DoesNotUnderstand - (tuberculosis) - (6)
             Reified Messages - (JimWeirich) - (1)
                 Sounds about right to me -NT - (tuberculosis)
             Re: DoesNotUnderstand - (deSitter) - (3)
                 nil is an object -NT - (admin) - (2)
                     Re: nil is an object - (deSitter) - (1)
                         Re: nil is an object - (bluke)
         ICLRPD - (static)
         It is a fundamental difference - (bluke) - (30)
             More Questions - (JimWeirich) - (9)
                 Re: More Questions - (bluke) - (3)
                     Re: More Questions - (JimWeirich) - (2)
                         It relates more to the mindset - (bluke)
                         In past discussions with Freep... - (ChrisR)
                 Where does polymorphism fit in? - (static) - (1)
                     Polymorphism via inheritance/interface - (ChrisR)
                 Example - (tuberculosis) - (1)
                     Re: Example - (JimWeirich)
                 Statically Typed Smalltalk - (tuberculosis)
             Statically Typed MOO - (JimWeirich) - (19)
                 The other possible avenue - (ChrisR) - (18)
                     Do you know how they do that? - (bluke) - (17)
                         Compiler generates the necessary calls - (ChrisR)
                         AspectJ is code generation - (tuberculosis) - (15)
                             A comment and a question ... - (JimWeirich) - (12)
                                 Not really - (tuberculosis) - (11)
                                     Pushing the limits of Blanchard's Law - (JimWeirich) - (10)
                                         I don't think the basic argument is so much - (ChrisR) - (8)
                                             Re: I don't think the basic argument is so much - (JimWeirich) - (7)
                                                 Should probably let Todd defend his Laws....but.... :-) - (ChrisR) - (6)
                                                     Still sounds arbitrary ... - (JimWeirich) - (5)
                                                         On par with "Eval" - (ChrisR) - (1)
                                                             Well said -NT - (tuberculosis)
                                                         No its not - (tuberculosis) - (2)
                                                             Ok, I get it. - (JimWeirich) - (1)
                                                                 Yep -NT - (tuberculosis)
                                         Oh yeah - (FuManChu)
                             What is your reasoning for this "law"? - (ben_tilly) - (1)
                                 OT re: coming to this thread late - (drewk)
         Litmus Test - (JimWeirich) - (1)
             Yes and No - (bluke)
         Interesting comp.lang.smalltalk thread on this - (bluke)

If this chat room were a game, it would be "half-life".
137 ms