News for hackers. Stuff that matters.

Remember Smalltalk? (2008)

http://blogs.gartner.com/mark_driver/2008/10/09/remember-smalltalk/

I’ve often referred to Smalltalk as the ‘Latin’ of modern OO languages. Most owe a tremendous debt to Smalltalk but the language itself has been relegated to a small niche of technology elites for several years now.

Here a simply equation. In terms of mental fortitude…

( 52 comments | 29 points | on HN )
Re:Remember Smalltalk? (2008) by gaius on Wednesday February 12, 2014 @01:49PM (#7226377)
It's simple. Java was free, Smalltalk was $50,000/seat.
Re:Remember Smalltalk? (2008) by morty16 on Wednesday February 12, 2014 @02:28PM (#7226655)
Gartner also had an active hand in killing Smalltalk in the enterprise.

CTOs would pay Gartner millions of dollars to have them confirm their bias to go 100% Java/Windows/IBM.

Not that ParcPlace did themselves any favors.

Re:Remember Smalltalk? (2008) by mark_l_watson on Wednesday February 12, 2014 @02:40PM (#7226750)
Basically correct, except for the price of $50K. In the early 1980s I had a Xerox Lisp Machine (cost about $25K with extra RAM). Xerox let me use a Smalltalk license for a while for evaluation - I forget the exact price, but it was about $5K.

Now, nearly all programming languages are free :-)

Pharo Smalltalk (based on Squeak) is very nice, and runs on Mac, Windows, or Linux box using very little resources.

Re:Remember Smalltalk? (2008) by gaius on Wednesday February 12, 2014 @05:53PM (#7227959)
I learnt Java in '95 and was getting paid for it in '96 - the option to become a Smalltalk developer simply never existed for me - you already had to be one, to get access to it! That it faded into irrelevance is completely unsurprising, where was the fresh blood supposed to come from?
Re:Remember Smalltalk? (2008) by mark_l_watson on Wednesday February 12, 2014 @06:23PM (#7228164)
I rode the Java wave early on also. A good ride.

Smalltalk is still used, as is Common Lisp, Scheme, etc. Just because languages are only used for < 1% of commercial projects does not mean that people skilled in their use shouldn't use them. My go-to languages right now are Clojure, Java, and JavaScript, but, I still like to code occasionally in Pharo Smalltalk (good online tutorials, BTW, if you want to play with Pharo).

Re:Remember Smalltalk? (2008) by rongenre on Wednesday February 12, 2014 @02:45PM (#7226783)
I started my professional career doing Smalltalk in the early 90's. The experience of development as a conversation in which I persuade a system to behave was really formative.

In a lot of ways, I'm still programming in Smalltalk... just in other languages.

Re:Remember Smalltalk? (2008) by angersock on Wednesday February 12, 2014 @02:04PM (#7226484)
So, what's the advantage of Smalltalk over Ruby?

It seems like Ruby is a better Perl than Perl, a better Smalltalk than Smalltalk, and a better Python than Python.

It's slow (though that's getting better) but otherwise it allows genuinely beautiful system design.

Re:Remember Smalltalk? (2008) by masklinn on Wednesday February 12, 2014 @02:55PM (#7226851)
> So, what's the advantage of Smalltalk over Ruby?

Smaller language, more coherent, first-class blocks, clearer messaging syntax, message cascading, conditions, …

> a better Smalltalk than Smalltalk

Not by a long shot no.

> and a better Python than Python

Not that one either.

Re:Remember Smalltalk? (2008) by akavi on Wednesday February 12, 2014 @02:33PM (#7226691)
>a better Python than Python

As someone who's quite the Ruby fan, this is the only one on the list I'd object to.

There's a very real philosophical difference between the two, which I'd identify as being their attitude to "magic". Ruby is OK with a certain level of increased complexity and semi-hidden behaviour if it means more expressivity. Python, on the other hand, prefers simplicity and explicitness.

It's not the most radical divide, and I don't really think either one is the One True Philosophy; they're just different. And neither is better at embodying the other's philosophy.

Re:Remember Smalltalk? (2008) by Avshalom on Wednesday February 12, 2014 @02:38PM (#7226736)
Well I mean that's Smalltalk: Things that look like magic in Ruby look as simple and explicit as Python in Smalltalk.
Re:Remember Smalltalk? (2008) by rgrau on Wednesday February 12, 2014 @02:33PM (#7226692)
The environment.

If you think pry is a cool tool for Ruby, you gotta see any smalltalk platform.

Re:Remember Smalltalk? (2008) by pjmlp on Wednesday February 12, 2014 @04:16PM (#7227382)
Lets see.

The concepts of live coding originated in Lisp and Smalltalk environments.

Smalltalk was the birth of IDEs and unit testing. Also its sucessors StrongTalk and SELF were the first environments to have JIT compilers.

Finally, having Smalltalk as OS made the computers quite interactive.

Re:Remember Smalltalk? (2008) by agumonkey on Wednesday February 12, 2014 @02:44PM (#7226780)
I remember a rubyconf talk from a ST veteran saying if they'd only look at its VM nobody would ever say 'Ruby is slow' again. So all things being equal, that's one advantage.
Re:Remember Smalltalk? (2008) by protomyth on Wednesday February 12, 2014 @02:49PM (#7226816)
I do believe it was the Gemstone folks (http://maglev.github.io)
Re:Remember Smalltalk? (2008) by agumonkey on Wednesday February 12, 2014 @02:57PM (#7226873)
Re:Remember Smalltalk? (2008) by cconroy on Wednesday February 12, 2014 @02:26PM (#7226635)
Anyone else love Smalltalk's message syntax. Objective-C uses it too. It has got to be the best syntax invented for a programming language. To see what I mean compare the normal procedural code vs. the OO version:

(a) drawRect(50, 50, 10, 21)

(b) aRect drawAtX: 50 andY: 50 width: 10 height: 21

Re:Remember Smalltalk? (2008) by joe_the_user on Wednesday February 12, 2014 @04:38PM (#7227518)
It sounds neat. I've wanted this kind of thing when I programmed in languages that didn't have it.

But having gone from c++ to Ruby to C++, I think the benefits of this expressiveness may not really be there.

This construction makes each line of the whole program that much longer, it asks that every functions arguments be meaningful outside the context of the function as well as within. Basically, this syntax may show you that certain calls are wrong but there are many other calls it won't prevent and it gives you larger amount of code to page through to find those other errors.

Remember, a good program wouldn't be using 10 as a function input except if there was some reason it's meaning was clear. And a rect would take two points rather than four ambiguous ints.

So what you can have is drawRect(Pt(screenLeft, screenTop), Pt(screenRight, screenBottom) if you want a rect covering the screen and you want expressiveness.

Re:Remember Smalltalk? (2008) by benjComan on Thursday February 13, 2014 @04:20AM (#7230354)
In Smalltalk you define points with '@' so you could do...

    drawRectOrigin: 50@50 extent: 10@21.

    drawRectOrigin: 50@50 corner: 60@71.
If you really wanted, on class Point you could define method ',' with parameter 'otherPoint' as follows...

    , otherPoint
        ^ Rectangle origin: self corner: otherPoint.
then you could do draw rectangles like this...

    drawRect: (50@50),(60@71).

    drawRect: (screenLeft@screenTop),(screenRight@screenBottom).
Re:Remember Smalltalk? (2008) by noblethrasher on Wednesday February 12, 2014 @02:35PM (#7226705)
C# isn't too terribly worse:

    aRect.Draw(x:50, y:50, width:10, height:21);
Re:Remember Smalltalk? (2008) by protomyth on Wednesday February 12, 2014 @02:51PM (#7226828)
I look at those commas and wonder why? Is there a reason other than "must keep separators from normal function call"?
Re:Remember Smalltalk? (2008) by noblethrasher on Wednesday February 12, 2014 @03:27PM (#7227032)
Labeled parameters are optional. In fact they're so optional, that you don't even have to label all of the parameters at a call site (just the ones that appear after the first labeled parameter).

So with that (mis)feature, eliding commas would make a lot of code harder to reader.

Re:Remember Smalltalk? (2008) by masklinn on Wednesday February 12, 2014 @03:43PM (#7227108)
> So with that (mis)feature, eliding commas would make a lot of code harder to reader.

Not really. Lisps get by without them and it doesn't have formal keyword parameters.

Re:Remember Smalltalk? (2008) by noblethrasher on Wednesday February 12, 2014 @03:51PM (#7227186)
True, but that's an advantage of Lisp's uniformity. Imagine passing a query comprehension (or two) as arguments.

    Foo(from n in range select n * n into: from n in range where n % 2 == 0 select n)
Re:Remember Smalltalk? (2008) by taternuts on Wednesday February 12, 2014 @03:23PM (#7227010)
it kind of helps me visually dissect the parameters better - I'm sure if I got used to omitted commas it wouldn't be that big of a deal. When I would run into ruby code that omitted the parenthesis on a function call, it was considerably tougher to read for me.
Re:Remember Smalltalk? (2008) by cema on Wednesday February 12, 2014 @04:24PM (#7227433)
Or, for that matter, Javascript, if you write it like this:

  aRect.Draw({x:50, y:50, width:10, height:21})
Re:Remember Smalltalk? (2008) by chc on Wednesday February 12, 2014 @02:30PM (#7226666)
It's nice sometimes, but other times it gets in the way and makes lines so noisy that you end up needing to split that function call into eight lines just to be able to read it tomorrow.
Re:Remember Smalltalk? (2008) by masklinn on Wednesday February 12, 2014 @03:02PM (#7226898)
Note that Obj-C's APIs tend to be much more verbose than Smalltalk's generally were. Compare Objective-C's

   enumerateObjectsUsingBlock: aBlock
to Smalltalk's

   do: aBlock
or NSDictionary's

    objectForKey: aKey
to Smalltalk's

    at: aKey
Re:Remember Smalltalk? (2008) by chc on Wednesday February 12, 2014 @03:15PM (#7226971)
That's true. I suppose what I was thinking of is more an artifact of Objective-C's quirky typing than a problem with Smalltalk's message syntax.
Re:Remember Smalltalk? (2008) by masklinn on Wednesday February 12, 2014 @03:30PM (#7227047)
There's that, Objective-C's options or errors returning doesn't help, NextStep/Apple seems to be very much in long message names, and some patterns/conventions of Objective-C also factor into it (e.g. `[NSArray arrayWithArray: anArray]`, smalltalk would just say `anArray copy`)
Re:Remember Smalltalk? (2008) by chc on Wednesday February 12, 2014 @04:16PM (#7227387)
True, though [anArray copy] is idiomatic in Objective-C too. It used to be that people would prefer arrayWithArray: because copy returns an owning reference and you'd need a matching release, but now with ARC that isn't really a going concern. I'd feel weird writing [NSArray arrayWithArray:anArray] these days.

I think the majority of Objective-C's verbose conventions are artifacts of the Frankenstein type system — for example, having two methods with the same selector but different signatures will cause any use of either method with an id type to emit warnings, and possibly to generate incorrect code if the types are not compatible. So in order to avoid these awkward situations, Objective-C prefers to be as explicit as possible about what it's getting and giving. (Case in point: The extra verbosity in the examples you gave is almost entirely caused by adding nouns.)

Re:Remember Smalltalk? (2008) by protomyth on Wednesday February 12, 2014 @02:46PM (#7226789)
I still like it best, but also like the combo the current Objective-C allows. Mainly, it makes it easier to remember what the heck each parameter is supposed to be while reading the code. Its nice to have that information in the code instead of looking at the docs.
Re:Remember Smalltalk? (2008) by renox on Wednesday February 12, 2014 @05:24PM (#7227788)
This looks nice on toy examples, but you aren't supposed to litter your code with numerical constants.. With variables, the readability difference is much lower, it helps avoiding mistake, but IMHO it would be better to use types to detect those mistakes..
Re:Remember Smalltalk? (2008) by JoeAltmaier on Wednesday February 12, 2014 @02:29PM (#7226660)
I guess that's better in a COBOLly sort of way. I'd prefer a tool that let me investigate the signature and validate the arguments if I was interested; otherwise its awfully wordy and slow to write/read.
Re:Remember Smalltalk? (2008) by programminggeek on Wednesday February 12, 2014 @02:35PM (#7226706)
wordy maybe, but incredibly easy to understand upon coming back to the code. At least, more than a list of 5+ unnamed arguments in an arbitrary order made up by someone you'll never meet and you can only understand by looking at the api docs, if there are any.
Re:Remember Smalltalk? (2008) by JoeAltmaier on Wednesday February 12, 2014 @04:36PM (#7227509)
I'd agree, except arguments are rarely just a list of numbers. With well-named constants, methods and variables its pretty clear what's being passed.
Re:Remember Smalltalk? (2008) by programminggeek on Tuesday February 18, 2014 @01:11AM (#7256663)
Yes, but in the case of a sometimes inconsistent API, you get things like string methods that are sometimes method(needle, haystack) and sometimes method(haystack, needle) and so on. If you were sending properly labeled messages, like you are forced to do in just about every web api ever, you can at least inspect the message to get an idea what is going on.

It's sort of weird to me that so much effort goes into making programming languages expressive, yet we cling to incredibly terse method names, sometimes too terse, and no labels on method inputs. So, if you don't know what some bit of code does, you have to figure out what the methods are doing and what arguments they are supposed to take.

I guess to me it's like if you had to do a dictionary lookup for every word you read and had minimal context to understand a words meaning in the context of the other words around it. At the very least you would cling to a dictionary if you wanted to get anything done.

Re:Remember Smalltalk? (2008) by noblethrasher on Wednesday February 12, 2014 @02:38PM (#7226732)
Undoubtedly slow(er) to write, but I think "slow to read", as in comprehend, needs some evidence.
Re:Remember Smalltalk? (2008) by protomyth on Wednesday February 12, 2014 @02:47PM (#7226804)
Have you actually programmed in COBOL? I find it nothing like COBOL. Maybe AppleScript, but not COBOL.

I find it faster to read since I don't have to glance at API docs at the same time.

Re:Remember Smalltalk? (2008) by svc on Wednesday February 12, 2014 @01:16PM (#7226129)
The Smalltalk spirit is still alive, witness Pharo. And the legacy lives on in so many languages, like Ruby, Objective-C.
Re:Remember Smalltalk? (2008) by sdfjkl on Wednesday February 12, 2014 @01:36PM (#7226267)
And even spawns new heirs, such as Objective-Smalltalk: http://objective.st/
Re:Remember Smalltalk? (2008) by adamnemecek on Wednesday February 12, 2014 @01:41PM (#7226318)
Re:Remember Smalltalk? (2008) by sdfjkl on Wednesday February 12, 2014 @04:20PM (#7227410)
F-Script was actually how I discovered the beauty of Smalltalk :)
Re:Remember Smalltalk? (2008) by jimbokun on Wednesday February 12, 2014 @01:36PM (#7226263)
With blocks, the semantics and programming paradigms of Objective C are now very close to Smalltalk. Seems like a Smalltalk targeting OS X and iOS would be a very good fit, similar to RubyMotion (which further demonstrates the underlying similarities between Ruby, Smalltalk and Objective C).

http://www.rubymotion.com/

Re:Remember Smalltalk? (2008) by chc on Wednesday February 12, 2014 @02:35PM (#7226720)
I don't think we're that close. If you're looking from Java, yeah, Objective-C looks pretty close to Smalltalk; if you're looking from Smalltalk, Objective-C is a little dot on the horizon. Objective-C is just at its core much more low-level than Smalltalk and considers that a feature rather than a bug.

If you're interested in the idea though, F-Script was actually pretty close to "Smalltalk for Cocoa," though it's more designed as a developer tool for Objective-C programs than an applications development language in its own right. It has an object browser and everything.

Re:Remember Smalltalk? (2008) by ramayac on Wednesday February 12, 2014 @01:43PM (#7226331)
Re:Remember Smalltalk? (2008) by agumonkey on Wednesday February 12, 2014 @02:42PM (#7226766)
I remember some IBM guys not nostalgic at all about ST. They said it was a doesNotUnderstandHELL. Maybe they didn't receive adequate training. They were quite in love with Eclipse/EMF/RSA way of life too. Funny.
Re:Remember Smalltalk? (2008) by GnarfGnarf on Wednesday February 12, 2014 @03:50PM (#7227179)
Beware! This Website will throw up 40 or 50 cookie permission dialogs in Firefox.
Re:Remember Smalltalk? (2008) by pjmlp on Wednesday February 12, 2014 @01:41PM (#7226319)
Yeah, I got a nice experience with VisualWorks while at University, around 1996.

However Smalltalk lost the enterprise place it got, but its spirit lives partially[1] on modern dynamic languages.

[1] Without live coding experience, it isn't a full Smalltalk descendent.

Re:Remember Smalltalk? (2008) by agumonkey on Wednesday February 12, 2014 @02:47PM (#7226799)
I daydream about the fact that we're slowly climbing toward a lisp/st OS without acknowledging it. As you say nowadays people accept and enjoy having hackable userland (dom/javascript) and it's only a late bolted on addition.
Re:Remember Smalltalk? (2008) by mpweiher on Wednesday February 12, 2014 @03:34PM (#7227066)
Really live coding with Objective-Smalltalk[1]:

   http://www.youtube.com/watch?v=sypkOhE-ufs
It's obviously only a very simple example, but hopefully shows the potential.

[1] http://objective.st/

Re:Remember Smalltalk? (2008) by pjmlp on Wednesday February 12, 2014 @04:02PM (#7227261)
The Smalltalk environment is much more than just a REPL.
Re:Remember Smalltalk? (2008) by mpweiher on Wednesday February 12, 2014 @04:12PM (#7227359)
And that isn't a REPL, it's live evaluation on every keystroke.

But yes, you also have other tools, for example a class browser and inspectors that hook remotely into running programs via http, for example.