Post #110,761
7/21/03 7:01:43 PM
8/21/07 5:42:37 AM
|
Re: Method VS Message
I think there is a difference between method and message. The method is the code that gets executed in response to receiving a message (Todd, does that jive with Smalltalk usage?) Yes - you send messages - they are handled by methods. A Smalltalk object is a lot like a web server in that respect - send it a message - if its got a handler mapped to what you asked then you get it, otherwise you get the not found page (#doesNotUnderstand:). So even the lowly integer is a whole server in Smalltalk. From here - its not hard to extend this behavior across a network transparently if you like using proxies on either end of the wire.
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
Re: Method VS Message
I think there is a difference between method and message. The method is the code that gets executed in response to receiving a message (Todd, does that jive with Smalltalk usage?) Yes - you send messages - they are handled by methods. A Smalltalk object is a lot like a web server in that respect - send it a message - if its got a handler mapped to what you asked then you get it, otherwise you get the not found page (#doesNotUnderstand:). So even the lowly integer is a whole server in Smalltalk. From here - its not hard to extend this behavior across a network transparently if you like using proxies on either end of the wire.
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
|
Post #110,806
7/21/03 11:42:24 PM
|
Re: Method VS Message
Is that literally how it is handled internally?
I thought Scott literally meant, one can implement messaging behavior with appropriate generation of functions.
-drl
|
Post #110,817
7/22/03 12:49:34 AM
|
Didn't you finish that smalltalk history doc Todd showed us?
I know you got at least halfway through. ;) Yes, that's how it's handled. Absolutely true that, for example, an integer is a server. Grok that and you've got the gist.
I'm gonna go build my own theme park! With Blackjack! And hookers! In fact, forget the park!
|
Post #110,818
7/22/03 12:59:53 AM
|
Re: Didn't you finish that smalltalk history doc Todd showed
Haven't even really started it - busy days. It's near the top of the list. I'm taking it to Atlanta with me next week...
-drl
|
Post #110,828
7/22/03 6:01:52 AM
|
In theory yes, in practice no
The VM will optimize out the actual messages etc. in most cases to improve performance if it is not needed
|
Post #110,862
7/22/03 10:19:58 AM
8/21/07 5:44:33 AM
|
You must cheat - but you must not get caught
Dan Ingalls said that I think - referring to optimization of certain messages (like ifTrue:) by the compiler. The compiler will cheat on certain highly used messages to improve performance - but its generally not visible to the developer that this is going on.
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
|
Post #110,864
7/22/03 10:29:29 AM
7/22/03 10:31:22 AM
|
Yes exactly
It is clear that the VM is not going to actually send a message for a := 5 + 3. the performance would be horrible. The VM cheats where appropriate and hopefully the developer doesn't notice a difference (which is why Smalltalk can present everything as an object including so called primitive types like integers, etc., and still offer good performance, the VM knows that 5 is an integer and therefore treats it differently in most cases). The various Smalltalk VM's are very good at this (in fact the whole Hotspot compiler idea came from a Smalltalk implementation).
Edited by bluke
July 22, 2003, 10:31:22 AM EDT
|
Post #111,003
7/22/03 9:19:49 PM
|
Hmmm sounds as if
Smalltalk's efficacy relies critically upon a very Smart Wise compiler. One wonders how wisdom + Boolean ever once came to be comingled. And if such stellar virtuosity could ever again occur. From the gossip read over years - I gather that this was a Fluke, given the variety of C-class and other successors' non-Wisdom.. so frequently dissected and railed about.
OK.. never mind. No credentials here.
Ashton
|
Post #111,008
7/22/03 9:49:03 PM
8/21/07 5:51:46 AM
|
Not *so* clever
There is a table of a few selectors that are handled specially by the compiler. You can change the table and recompile everything in the system. Of course, only the VM/compiler tweakers do this. But the language itself is dead simple.
For those interested in the original book detailing how it all works:
[link|http://users.ipa.net/~dwighth/smalltalk/bluebook/bluebook_imp_toc.html|http://users.ipa.net...book_imp_toc.html]
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
|