Live data from Hacker News

Smalltalk: Swimming with the fish

simberon.blogspot.nl

31–40 of 87 posts

Re: Smalltalk: Swimming with the fish

#31
post #21

Earlier quoted context omitted.

It is as if your application is always running inside the debugger. You can change anything at any time and those changes are made persistent. This is one reason why images are prunned for deployment.

Pruned? How do we do that? I mean, how do you distinguish the changes you want to deploy from the changes you want to drop?

Image pruning is really not a good way to do it, it's much better to take a clean base image and load your code into it as part of the deploy process. Pruning a development image is a very old fashioned way to create a production image.

Re: Smalltalk: Swimming with the fish

#32

Earlier quoted context omitted.

This is where my Blub programmer life bites me. I don't understand what you mean by "manipulate objects directly". I can't figure out the right abstraction level to put it at. For instance, let's say I have an Employee object that throws an exception. Clearly, if inspect that object and change the name member, Bob from accounting's name doesn't suddenly change to Gary. So I'm not acting directly on the object, but a…

> Clearly, if inspect that object and change the name member, Bob from accounting's name doesn't suddenly change to Gary. Yes it does. > So I'm not acting directly on the object, but a representation of the object. No, that is the object. Now, if it's backed by a relational database what you're saying might be true, but then you just change the name and then tell the object to save. You're thinking too data centric a…

First off, thank you for your through reply

> > Clearly, if inspect that object and change the name member, Bob from accounting's name doesn't suddenly change to Gary.

> Yes it does.

Okay. either I wasn't clear in my analogy or I'm actually further away from understanding Smalltalk than I thought. Let me put it a different way: If I open the Bob object in the inspector and set the "deceased" member to "true", will Bob claw his way out of his casket?

A lot of my confusion about whether it's the object or the representation of the object comes from this level. I tried to learn Smalltalk a few years ago. We started off with some GUI work and the teacher was quite adamant that we understand that the button on the screen was the object and not just a visual representation of the object.

If I'm understand what you've written properly, then the Smalltalk language isn't nearly as important as the Smalltalk environment. For a comparison point, during my day job, I write a large amount of Python in Emacs. This code is for an application that runs in a REPL. Emacs gives the the ability to highlight code and run it. I can call the "help" function on an object to see its documentation or the "dir" function to view all its members and methods. I can load code at run time and patch new members onto classes or objects.

Of course, that's the classic Blub programmer paragraph. At the very least, Smalltalk sounds like a nice environment and I'm jealous of having multiple, independent object inspectors. I'm also sure that the Smalltalk documentation is better written than what I usually get from "help". Still, I suspect that I'm missing something. Especially if I'm still wrong about what it means to work directly on an object.

Re: Smalltalk: Swimming with the fish

#33
post #26

Earlier quoted context omitted.

This is where my Blub programmer life bites me. I don't understand what you mean by "manipulate objects directly". I can't figure out the right abstraction level to put it at. For instance, let's say I have an Employee object that throws an exception. Clearly, if inspect that object and change the name member, Bob from accounting's name doesn't suddenly change to Gary. So I'm not acting directly on the object, but a…

What you're missing is that, in Smalltalk, the representation on which you're acting is indistinguishable from the object; in your example, when you change the name member, Bob from Accounting's name does suddenly change to Gary; not only do future accesses of the name member on that object return "Gary", but, for example, if you have an HR management frontend open on Bob when you make the change in the inspector, yo…

I understand that changing the name member of the Bob object to Gary will cause it to be Gary in every subsequent member access. Perhaps I've grown spoiled in my old age, but I'd be shocked at any system which didn't have this property. However, if I called out "Hey Gary!" down the hall, would he respond? Would his driver's license still read Bob?

The last time that I tried to learn Smalltalk, it was drilled into me that Smalltalk works directly with objects and not just their representations. For instance, the collection of black pixels on the screen was the Mouse object itself and not just a manifestation of a Mouse object somewhere in memory. A large amount of my confusion has possibly come from those lessons.

I agree that Lisp is an enlightening experience. I spent two years using Scheme as my primary programming language at work. Then again, I may just be stuck as a Blub programmer. I spent a year focused on Common Lisp, but never found any use for SLIME, despite using Emacs exclusively.

Re: Smalltalk: Swimming with the fish

#34
post #19

Articles about how great Smalltalk is usually remind me of articles about how great the Lisp Machine was. And there is a lot of merit to an entire system, hardware and software, designed to operate in a high-level language. My complaint is that neither of these things is coming back in a relevant way. Perhaps the biggest shift in software engineering in the last decade or two is the fact that no one writes entire sys…

>My complaint is that neither of these things is coming back in a relevant way.

Where is this directed? It sounds like a criticism of Lisp, Forth, Self, etc, but please correct. The fact that the ignorant masses flocked to C and Unix doesn't grant them one _iota_ of merit. C isn't even a good low-level language. And look at the most popular platform of them all - the web browser, if you want a good laugh.

Re: Smalltalk: Swimming with the fish

#35
post #19

Articles about how great Smalltalk is usually remind me of articles about how great the Lisp Machine was. And there is a lot of merit to an entire system, hardware and software, designed to operate in a high-level language. My complaint is that neither of these things is coming back in a relevant way. Perhaps the biggest shift in software engineering in the last decade or two is the fact that no one writes entire sys…

>My complaint is that neither of these things is coming back in a relevant way. Where is this directed? It sounds like a criticism of Lisp, Forth, Self, etc, but please correct. The fact that the ignorant masses flocked to C and Unix doesn't grant them one _iota_ of merit. C isn't even a good low-level language. And look at the most popular platform of them all - the web browser, if you want a good laugh.

This is true of any new system. There is a huge complexity in supporting even the standards that most people would consider basic. Just to surf the web you need TCP/IP, HTTP(S), HTML, JavaScript, JPEG, etc. Implementing all of these from scratch is a huge pain.

Re: Smalltalk: Swimming with the fish

#36
post #26

Earlier quoted context omitted.

What you're missing is that, in Smalltalk, the representation on which you're acting is indistinguishable from the object; in your example, when you change the name member, Bob from Accounting's name does suddenly change to Gary; not only do future accesses of the name member on that object return "Gary", but, for example, if you have an HR management frontend open on Bob when you make the change in the inspector, yo…

I understand that changing the name member of the Bob object to Gary will cause it to be Gary in every subsequent member access. Perhaps I've grown spoiled in my old age, but I'd be shocked at any system which didn't have this property. However, if I called out "Hey Gary!" down the hall, would he respond? Would his driver's license still read Bob? The last time that I tried to learn Smalltalk, it was drilled into me…

> However, if I called out "Hey Gary!" down the hall, would he respond? Would his driver's license still read Bob?

Yes and no, respectively.

Perhaps a heavily contrived example might help: Consider a system in which there is exactly one representation of an object member's value, which is stored in that object; when you call an accessor method, what you actually get is a reference, which is instantiated with an observer attached that listens for a notional "change" event, fired whenever the referred value is modified, and whose event handler updates whatever context exists around the reference, regardless of its nature, so that the displayed value matches that newly assigned to the object member.

...and now perhaps you can see why people familiar with Smalltalk think so highly of it; what in, for example, Javascript, would require an enormous amount of manual infrastructure and completely fail to generalize, in Smalltalk happens entirely transparently. It's not so much that you don't have to think about it; it's that there's nothing there to think about.

> I spent a year focused on Common Lisp, but never found any use for SLIME, despite using Emacs exclusively.

And now you've lost me. How can this possibly be the case? What was your Lisp workflow like? I mean, I can understand not getting the appeal of Lisp if you're just talking to the REPL and not working in an actual Lisp environment of the sort you get with Emacs Lisp or SLIME, but I have trouble understanding how anyone could work with those tools for a year without recognizing their potential.

Re: Smalltalk: Swimming with the fish

#38

A while back I backed an IndieGoGo project dedicated to bringing Smalltalk to the JVM: http://www.indiegogo.com/projects/redline-smalltalk-v1-0 I really hope this project pans out, because I would love to be able to program in Smalltalk for practical purposes. (In fact, even the thought of being able to write a single application in both Lisp (Clojure) and Smalltalk (Redline) is making me giddy. We're still a long wa…

Redlines smalltalk on the JVM is cool. You can also use Smalltalk on the web browser through Amber: http://amber-lang.net/

Re: Smalltalk: Swimming with the fish

#39

Earlier quoted context omitted.

>My complaint is that neither of these things is coming back in a relevant way. Where is this directed? It sounds like a criticism of Lisp, Forth, Self, etc, but please correct. The fact that the ignorant masses flocked to C and Unix doesn't grant them one _iota_ of merit. C isn't even a good low-level language. And look at the most popular platform of them all - the web browser, if you want a good laugh.

This is true of any new system. There is a huge complexity in supporting even the standards that most people would consider basic. Just to surf the web you need TCP/IP, HTTP(S), HTML, JavaScript, JPEG, etc. Implementing all of these from scratch is a huge pain.

What is true of any new system? I don't know what point you're trying to make.

Re: Smalltalk: Swimming with the fish

#40
post #19

Articles about how great Smalltalk is usually remind me of articles about how great the Lisp Machine was. And there is a lot of merit to an entire system, hardware and software, designed to operate in a high-level language. My complaint is that neither of these things is coming back in a relevant way. Perhaps the biggest shift in software engineering in the last decade or two is the fact that no one writes entire sys…

There is great danger in learning OOP with Smalltalk. Everything fits together so elegantly, the first time I opened a book about C++, I closed it in disgust (after seeing the bit-shift operator being used for console output, wtf?!), only to give the language a second chance 8 years later. I even learned Java before giving C++ a try.

When a young programmer asks me for advice about the next language to learn is, my advice is to go for the language that feels most alien. C++ won't enlighten a Java programmer significantly. Forth will.

Post reply on HN