Login

Smalltalk In Action

Explaining why Smalltalk developers like their images is a hard experience to convey to someone who's accustomed to working with files. Here's a video I found that shows what it is to work on a running program.

He's demonstrating some of the features of the refactoring browser on a running instance of the classic Asteroids game. He extracts a method to a component, changes the color of the asteroids, then shows off undo and redo. He does so while the game is running without ever having to break his flow with something as silly as a compile, debug, run cycle that we've all grown so accustomed to in most other languages.

It doesn't matter how fancy modern refactoring browsers get, as long as they're still working on dead files instead of a live running program, they'll never be able to compete with Smalltalk when it comes to developer productivity and maintaining flow.

Comments (automatically disabled after 1 year)

Jim Deville 6320 days ago

I totally agree. Even if you didn't work in a live environment like the video, having code that is so tied into the environment would be awesome. I would love to see/write an Environment that had the parse tree in memory as you wrote the code. I believe that done correctly it would knock NetBeans, Eclipse, VS, or anything else out of the park. I just I knew where to start from it. Right now my only starting point is the ParseTree project. ;)

Mark Miller 6320 days ago

For anyone interested, Bob Westergaard has a screencast of a test version of a port of Doom for Cincom Smalltalk. I know the focus of this post was on the dynamism of Smalltalk, but I thought this game project was neat.

The framerate is pretty slow, but he said what you see is just a straight port of some of the original C code to Smalltalk, and that he still needs to finish the port, optimize it for Smalltalk, and get the bugs out.

Nicolas Petton 6319 days ago

Hi Ramon,

you're right, and I don't know why, but most of developers don't understand that. When I try to explain, I always have the answer "Ok, that's fun, but how do you get an executable ?"

David Mitchell 6319 days ago

Look at Sophie. Sophie is installable on Windows, Mac, and Unix. The Unix download actually runs on all three. The Windows download uses a Windows installer. You wouldn't know you were using Squeak Smalltalk. VW, Dolphin, and even Visual Age have their own ways of bundling up apps. There was a recent thread on Squeak-dev on creating a USB stick version of Squeak that can move cross-platform that went into detail on it. You can also look up installers on the wiki.

Ramon Leon 6319 days ago

Yea, I don't understand the "how do I get an executable" question either, I guess people don't realize that you can name the vm exe anything you like and treat the image as just a data file.

People just don't like change, that's all I can figure, and those are the people you just lie to.

Lars 6319 days ago

F# can compile code into a running image:

http://channel9.msdn.com/Showpost.aspx?postid=234889

blog 6318 days ago

Operationen am lebenden System mit Smalltalk

Anhaenger von imagebasierten Programmiersprachen wie Smalltalk oder LISP betonen zuweilen, dass es bei diesen Systemen moeglich sei, am laufenden Programm zu arbeiten; wie so etwas aussehen kann, kann man sich hier unter dem link 'Here is a video I ...

Mark Miller 6318 days ago

Re: running in an image vs. an executable

I'm hearing the same sort of criticism elsewhere. People not are used to the idea that you can modify your executable inside itself. They think you have to compile a "dead" executable, separate from a VM, and then run the exe on the VM. Where the "how do you generate an executable?" probably comes from is they think you're running the program in a development or prototyping environment, not a production system.

To understand this concept, people will have to wrap their head around the idea that an exe is an image with only the dependencies the program needs to run. It's a subset. In the Squeak world the closest way we have to do that (I think) is to use the Spoon image. From what I understand you load it with your Smalltalk classes, and it automatically goes to the web and downloads the dependencies for them, thereby giving you just enough of the code you need to run your app. in the image--an exe.

There are obviously many developers out there toiling in ignorance, thinking "this is as good as it gets". I looked at the reddit comments to this post, and one guy said, "I didn't see any programming going on. Just some guy pressing a bunch of buttons." Le sigh...

The way most developers operate is they don't know something unless someone comes to them and shows it to them. They're not going to bother with trying to learn and investigate it themselves. I know. I used to be one of those people.

Ramon Leon 6318 days ago

You Mark? Noooo... you couldn't have been one of them!

Actually, I think wanting the exe stems from wanting to compile the code into a non source form for distribution. Just rename the VM, and ship the image without a changes file and you get pretty much what they want. Just tell them the image is a data file and the VM is the app.

Mark Miller 6317 days ago

Yep, I was. I used to have OSS guys mock and bash me for it, too. Funny how most OSS people one hears from are into doing that rather than trying to educate people a little. It's like they'd rather vent than try to build the community. Maybe they think people like that are "too far gone". They have no idea where to begin. It's like, "That was so bad, you're not even wrong."

 6311 days ago

You know Ramon I love Smalltalk more than languages like ML, Q or Scheme only because of image.

CubiclePrisoner 6306 days ago

Dear Ramon,

Another find example of ANOTHER PERSON'S tutorial on your blog. How typical. You have your elevated thoughts on programming and traits of languages, but the single example of your work is this blog - and it displays incorrectly in IE, on your platform of choice.

If I had a penny every time I bumped into an armchair expert on the internet, I'd be rich. I'd just need to spot the clue - rehashed opinions, generalities, unawareness of real-world issues, and total lack of one's own work to show.

Here's an idea. Stop preaching and start working on something. Not a toy application or a demo, but a real product that people will want to use. Then your word will mean something. Until then, you may as well run a blog on being a mother, cos you're equally qualified for that.

Ramon Leon 6305 days ago

Ah, another fine example of an anonymous clueless critic who samples a few articles and thinks he knows me. Here's a clue, if you don't like my blog, LEAVE.

Paolo Bonzini 6303 days ago

I disagree. The strength of Smalltalk is in its reflection abilities, not in working "live" within an image.

In fact, for me, the ultimate Smalltalk environment would be one where I can do the things shown in the screencast while running two images -- one running the browser, and one running asteroids. This is similar to what Spoon does.

But to be really "ultimate" for me, both sets of classes would be loaded onto an empty image when you start them; if you want, you could save an image as a sort of "cached executable", but if you'd rather not, you could restart from an empty image anytime.

Then, when you exit the browser, it would tell you: "you modified classes Asteroids and AsteroidsSprite, which reside in files Asteroids.st and AstSprite.st respectively. Do you want me to checkout your changes to those files?"

Needless to say, you can do the same with two images running two browsers, so that putting a bug in the browser does not crash your development environment, but allows you to go on debugging "remotely" the buggy browser.

Ramon Leon 6303 days ago

They are both great strengths. I never said Smalltalk was great "only" because of the images, only that they are something hard to explain to those from other languages.

Most modern languages have reflection, though not necessarily to Smalltalk's extent, but people get reflection, they don't get images.

W^L+ 6300 days ago

Even some mainstream developers are starting to tire of files as a metaphor. See for example Rick Jelliffe's post: http://www.oreillynet.com/xml/blog/2007/08/thefallofthedesktopandth.html

As for the anonymous CubiclePrisoner, I think you have it backwards. In most areas, self-promotion makes someone appear to be an "expert." Do you really think that any of your heroes are really better than everyone else at what they are doing?

In reality, most people DOING the same work will have about the same level of knowledge, even if they cannot all express it well. That being true, you can pay thousands of dollars to go to a conference where someone using the language of the day will tell you these same things (but without using Smalltalk) or you can read Ramon's writings for free. In either case, if you open your ears and mind, you might learn something.

about me|good books|popular posts|atom|rss