Tuesday, May 16, 2006

 

Am I supposed to like Smalltalk?

When people talk in general about "high level, extensible, dynamic" languages on their blogs, they usually mention Smalltalk and Lisp in the same breath. Smalltalk programmers talk about their language in the same glowing terms as Lisp programmers; this prompts me to read about Smalltalk, and this weekend I tried out Squeak.

I think I'll stay with Lisp. I'm sure someone will say I didn't try it long enough, but there were a couple of issues I don't think will go away with extended use.

First of all is the environment/IDE. With Lisp/Emacs/Slime, or for that matter Java/Netbeans, to write method after method, you can just type. What I saw in Squeak was a bad combination of mousing and typing. You have to click in the '--all--' window of methods, then mouse down to the editing pane, and replace text, then save, then do it again for the next method. I'm sure this is a YMMV thing, but these mini-interruptions sure wouldn't keep me in 'flow' as much as just typing.

Second is the 'OOP all the way' flavor of the Smalltalk language. Sometimes a function is just a function, and doesn't need to be in a class. I prefer the options that Lisp provides, I use imperative, OO, and functional, depending on the problem.

All this is without bringing up macros, which I don't use that much now, but will do so more in the future, which will only widen the gap.

Have you tried Smalltalk, and why do you prefer Lisp?

Comments:
I had much the same experience with smalltalk. I thought the concept of "everything is an object" could be useful, and an integrated IDE has it's place, but being forced to use it for everything lost me. Sometimes, I just want to edit in vi.

That being said, GNU smalltalk focuses less on the IDE / GUI and more on just the "language", but if you look at the source files, they have a lot of extra artifacts added to support importation into the GUI.

I decided that I much prefer ruby's "everything is an object" model to smalltalk, which doesn't force any form of IDE and allows a much more natural coding flow. I don't like ruby better than lisp, but at the moment there isn't any language i'm very happy with.

If you thought Smalltalk was worth trying, i'd recommend looking at ruby instead / as well. It's interesting.
 
I found Smalltalk to be nice and simple, which was appealing. However, I agree that the "everything is an object" mentality is annoying. My experience says that stuffing everything into object form is counter-productive in some cases, so much so that one must perform mental contortions to think about the problem.

If I went back to Smalltalk, I'd miss macros. Macros are what make me love Lisp so much.

Still, I admire Smalltalk for what it brought to the table when it was introduced.
 
Same as you -- I just couldn't get past the IDE. I try it a couple of times per year, and each time my heart sinks with dread.
 
I pretty much had the same issues as everyone else. Language looked nice, with good built in libraries. But programs are composed of text, you shouldn't have to/be able to treat code structures as if they were visible,tangible objects.
 
I've used Squeak off and on for several years now. The interface doesn't bother me; in fact, I find myself often wishing other systems had a similar interface. Debugging code written in Lisp (with Slime), or Python, or whatever, is nowhere near as easy as with Smalltalk.

I haven't used it for "real world apps" for the several reasons. The main reason is the same for Lisp: I'd have an exceptionally difficult time finding a replacement programmer for anything I wrote in Smalltalk or Lisp. Even using python in Zope (my current work project) might be pushing it.

Secondly, Squeak lacks a jit. While I could rewrite critical pieces of code in C and use Squeak's plugin interface (pretty easy, actually), I'd now have to find a Smalltalk who's comfortable with Squeak's ffi. Or, I could use Cincom Smalltalk, but their business model probably won't work for me, at a startup.

So, I've used it for tiny personal projects, and that's about it.

I'm curious -- what makes you think you'd miss macros in Smalltalk?

Dylan was a good compromise: it was objects all the way down, and had a CLOS-like object system (meaning, methods aren't part of classes). It had macros, though not exactly like the Lisp ones (Dylan switched from a prefix syntax to an infix one during development). A lot of Lisp people worked on Dylan, including some who had previously worked at Symbolics. Apple Dylan was written in Common Lisp.

Apple pretty much killed the project in 1996, and relatively few people used the Windows or Linux implementations. Like Smalltalk, Apple Dylan had an IDE, and stored all the code in a database (though you could export/import code as files to edit with other editors).
 
That should read "I'd now have to find a Smalltalk programmer who's".
 
Just Tried smalltalk for the first time last night. Not sure of opinions about it. Im thinking EMCAScript may be my perfect language ;-)
 
I have used squeak from time to time, and generally have enjoyed the experience. Well, to a point anyway. I'm not a SmallTalk guru, nor a Squeak guru, so bear that in mind.

One of the things about smalltalk is the constant browsing a beginner does to find out what has been written that can be reused, coupled with the frustration of not understanding how to use what is found. That is me largely. I did develop a cut-list program for a carpenter friend of mine in Squeak (I needed fractions and Squeak does that nicely out of the box).

I don't use smalltalk for anything other than a toy to play with programming concepts because of 2 things:
1) I find other languages more approachable. I can understand how to install extra libraries and use them easier than I can in smalltalk.
2) I can deploy other languages easier than smalltalk. I tried to explain to my carpenter friend how to download all the pieces needed for Squeak on his windows platform, then how to get my code and run 'file-in' on it to get it in the vm, then how to open a workspace and start it. I gave up and rewrote it in java as an applet (including porting the fraction stuff to java - that was fun!) and telling him to point to a url. I could have done that with the squeak plugin, but then would have been back to the same thing with how to get/install the squeak plugin and hope it worked with my code.

I wrote a billing automation program in lisp and it has been very robust and has weathered several changes (some on the fly) over the past two years, and I'm still running it on an old version of clisp. It was very easy to deploy.

Anyway, my $.02 -- if it's worth that much. :)

-- Jeff B.
 
To Jeff B:

Why didn't you just ship your customer the image file and VM?

Making him "download all the pieces" and file-in your code is a poor way to distribute a squeak application.

I hear you can integrate the VM and Image into one file, which would then be a single-file executable, But I have never done it.
 
Also on deployment:

I agree the documentation in Squeak often lags, but in this case, it is on the FAQ:

FAQ: Distributing Squeak Programs

http://minnow.cc.gatech.edu/squeak/3563
 
Have you seen this "Smalltalk for Lispers"

http://www.exept.de/exept//onlineDoc/english/programming/stForLispers.html

I suppose you know that the first version of Smalltalk was basically Lisp.
 
"I can deploy other languages easier than smalltalk. I tried to explain to my carpenter friend how to download all the pieces needed for Squeak on his windows platform, then how to get my code and run 'file-in' on it to get it in the vm, then how to open a workspace and start it."

Why the HELL would you do that? Hand the guy a zip archive with the image/changes/sources and vm.exe file in it and tell him to click the .image file. WTF?

The java equivalent experience would be to expect him to download java, tomcat, integrate with apache, deploy jar file. No end user will do all that either.
 
Maybe I can say on that:
1. As far as I know You can write in Vi or whatever You want including cell phone in Squeak case(they had that in mind when i left 4 years ago) it was named "headless"squeak if I remember for cel phone i think you should run some web service (Nebraska??) i never do anything of that so that is what I remember (or not:-) from mail list discusions.
To find someone who want to answer Your question (not something they want to tell You )documentation or standard is very different thing ...and in fact it is the worst about smalltalk/squeak.
2. Squeak have great graphics not IDE/GUI - in the begining it is not easy to make a difference .Squeak IDE is 30 years old idea ,and it is the worst I ever see it is provable it can't work... and around 1996-8 I saw VisualSmalltalk where IDE is what it should be ...It is possible to "write" complete application without writing a line of code ... VisualSmaltalk(last time i saw it was owned by Cincom) is not open and You can have idea what it is from documentation or VisualAge from IBM(but they find a way to "improve" it so it is not so intuitive ...).
3.Math of Smalltalk is much more interesting and natural for me but they invented objects, patterns ... to hide it so You have a choice to be treated as 8 years old semi-idiot and to take objects... or to look what's behind Yourself .Or to go with lambda calc ...:-).
4.Smalltalk is based on very best ideas of 50ies and 60ies and it is my personal opinion -it was not invented by Alan Kay but he was remarcably brave to insist on this ideas and it is great that he saved them for us in time when bad ideas like structured programming and FORTRAN controled the most of programers mind ...Alan Kay is one of the real heroes in software and I think that we all shold at least to try to understand his ideas best way we can
I have my own small war against Alan Kay and objects, and I always think for smalltalk as for a toy that shows what we can reach if try to do the right things...so nobody is supposed to like smalltalk ,but it is absolutely unimportant if we like it or not this is the very best in software and the wisdom and understanding it can give is priceless (i.e. one can mix in random proportions smaltalk lisp and maybe prolog ant to get Dylan Pyton Ajax or whatever but few of "mixed states" can't teach You much more than how to repeat their style ... in smalltalk and lisp You can learn how to think ... well , not exactly I saw people who tryed to think on IT in 70ies when I was 3 years old and I dont think that anyone in the world now know how to think (IT) much better than in 70ies...so you can learn only as little as it is known about , but that is all we have... and for thinking it is good to know that same thing could be expresed in more than one-lisp-way so that is value of smalltalk for lispers - smalltalk is complementary way of thinking - starting with lisp you can come to smalltalk or starting with smalltalk you can come (back) to lisp but both are complete and independant (well, different axioms for same theory ...at least I said it in my math language :-)
 
I don't get it. All the stupid parroting about lisp. They read about it having macros, REPL, HOFs, supports multiple paradigms of programming and CLOS. So it has to be better than anything else. How many of these features do they actually use/have used?
I wonder if any of the people mouthing off about lisp have actually used it for any non-trivial task. Or smalltalk for that matter before opinionating. I'm not even sure I like the PG converts - those that read his articles and start blabbering about lisp. Lispers are being nice these days after having a reputation of being intolerant. I think in cll they should be intolerant towards parrots blathering around.
I wonder if the phenomenon about people complaining about smalltalk's IDE way of doing things is similar to the one of people complaining about lisp's parentheses.
Listen to the best of the programmers - they'll say, learn all kinds of programming paradigms. Learn C, lisp, java, haskell, smalltalk, etc. I suppose they are the ones that aren't being driven by a weird kind of insecurity - a dumb drive to prove (to who exactly?) their chosen language is the best. Because they KNOW it.
 
Kn8hqW Your blog is great. Articles is interesting!
 
lJmVgD Nice Article.
 
Thanks to author.
 
Magnific!
 
Hello all!
 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?