
How learning Smalltalk can make you a better developer - horrido
http://techbeacon.com/how-learning-smalltalk-can-make-you-better-developer
======
malisper
I tried out Smalltalk for a day and I was completely amazed by the some of the
features that still haven't made it into other languages. One of the features
that I remember in particular was the ability to search for functions by
examples. I don't remember the exact syntax for it, but you could search by
something like:

    
    
        "hi" => "HI"
    

and Smalltalk would tell you "toUpperCase". Immediately after seeing this, I
wanted the languages that I use everyday to be able to do it.

~~~
efnx
Haskell has this through hoogle.

[http://www.haskell.org/hoogle](http://www.haskell.org/hoogle)

~~~
CMCDragonkai
Haskell has something even cooler. Automatic program synthesis through
examples:
[http://nautilus.cs.miyazaki-u.ac.jp/~skata/MagicHaskeller.ht...](http://nautilus.cs.miyazaki-u.ac.jp/~skata/MagicHaskeller.html)

For example:

    
    
        f "hi" == "HI"
    

Gives:

    
    
        f = (map toUpper)

~~~
malisper
From the abstract:

> The synthesis algorithm takes a generate-and-test approach: it generates an
> infinite stream of all the expressions having the same type as f; then, they
> are tested against the given predicate.

I'm really impressed that such a simple approach works. Initially I thought it
was something similar to FOIL[0]. FOIL was a program that could learn function
definitions by examples. One version of FOIL was able to solve exercises from
a Prolog book. For one of the exercises, it was able to come up with a
solution that was shorter than what humans had previously come up with. I
don't remember exactly how FOIL worked, but if I recall correctly, it would
repeatedly add predicates to it's currently best solution while trying to
maximize the number of test cases which it had solved correctly.

[0]
[http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=4AD...](http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=4AD32A0EB7A8DB42D651EB951F50B128?doi=10.1.1.34.4926&rep=rep1&type=pdf)

~~~
gokr
The Smalltalk mechanism (Squeak/Pharo) also uses generate and test, just FYI.

------
niftich
The article highlights several contributions of Smalltalk to CS, but here's a
few more:

David Ungar and Randall Smith, originally at Xerox PARC, then Stanford,
designed Self, a prototype-based dynamic JITted Smalltalk dialect. In 1991
they joined Sun Microsystems, where Self kept being developed.

In 1994, Urs Hölzle at Stanford wrote a better compiler for Self. He was
approached by Dave Griswold, who wrote a paper in 1993 with Gilad Bracha
titled 'Strongtalk: Typechecking Smalltalk in a Production Environment', and
together with Lars Bak the four of them started a company to commercialize
Strongtalk. They were acquihired by Sun in 1997.

Together, the Self and Strongtalk teams' work resulted in the HotSpot VM for
Java in 1999.

\- David Ungar went on to be a member of the 'Dynamic Optimization Group' at
IBM Research.

\- Randall Smith now works at the 'Modeling, Simulation, and Optimization
Group' at Oracle Labs.

\- Urs Hölzle was one of Google's first hires and its first VP of Engineering
and significantly shaped the company.

\- Lars Bak joined Google in 2004 and went on to design the V8 runtime and
Dart.

\- Gilad Bracha went on to co-author much of the Java Language Specification
and the Java VM Specification, then started a company to design the language
Newspeak, and now works at Google on Dart.

\- Dave Griswold continued to develop Strongtalk well into the 2000s, but I
can't find any current info on him. If you know what he's up to these days,
let me know!

~~~
horrido
Thank you for this! I learned something today. I shall have to post this in
the Comment section of the article.

------
qwertyuiop924
I'm not really an ST fan myself. I'm not averse to it, or anything, but it has
a steep learning curve, because you have to learn the class library, the IDE,
and the language, and the poor tutorials and documentation make it even worse.
Lisp had way better docs, and could be written in any text editor, so that's
what I learned.

However, if you want to learn Smalltalk, might I reccomend GNU smalltalk? it's
got the excellent docs you'd expect from a GNU project, unix integration, and
while it does have a class browser and an image, it supports plain old text
files for code, so you don't have to master an IDE if you don't want to, plus
it's good for scripting. However, it has (mostly) the same class library as
Squeak and other smalltalks, so it lessens the learning curve somewhat.

~~~
gnaritas
That you're so unwilling to leave your text editor makes you unsuitable for
Smalltalk, because Smalltalk without its image and IDE stuffed into text files
that work with all your normal tools _isn 't_ Smalltalk. It's missing
_everything_ Smalltalk'ers love about developing in Smalltalk. Someone who
wants to learn Smalltalk should try Pharo or Squeak, not GNU, GNU will just
leave them with a bad taste of weirdness for no good reason.

~~~
groovy2shoes
> Someone who wants to learn Smalltalk should try Pharo or Squeak, not GNU,
> GNU will just leave them with a bad taste of weirdness for no good reason.

As someone who has tried Pharo and Squeak, I was left with a bad taste of
weirdness for no good reason. The colorful Playskool environment, while neat
at first, was not only ugly and alien, but also quite minimal compared to Vim
or Emacs. I still don't understand how anyone could possibly be productive in
such an environment. What is it that's so attractive about it to Smalltalkers?

~~~
bencoman71
> The colorful Playskool environment

That was likely Squeak, not Pharo. Pharo has muted a lot of the UI colours to
be more appropriate for a business environment.

> How anyone could possibly be productive in such an environment. What is it
> that's so attractive about it to Smalltalkers?

Perhaps its useful to get some outsiders perspectives....

Avdi Grimm has written a few books about Ruby. He records his experience
trying Pharo in "I make you hate Ruby in 7 minutes"

[http://www.virtuouscode.com/2015/05/11/in-which-i-make-
you-h...](http://www.virtuouscode.com/2015/05/11/in-which-i-make-you-hate-
ruby-in-7-minutes/)

Noel Rappin has written a few books about Ruby & Javascript. He provides an
introduction to Smalltalk in "MountainWest RubyConf 2014 - But Really, You
Should Learn Smalltalk"

[http://youtu.be/eGaKZBr0ga4](http://youtu.be/eGaKZBr0ga4)

~~~
groovy2shoes
> That was likely Squeak, not Pharo. Pharo has muted a lot of the UI colours
> to be more appropriate for a business environment.

I've used both. Yes, Pharo is considerably more professional-looking, but it's
still rather ugly and alien (as in, it looks very odd when juxtaposed with the
other applications running on the host system).

> Avdi Grimm has written a few books about Ruby. He records his experience
> trying Pharo in "I make you hate Ruby in 7 minutes"

Does it normally take 7 minutes to write "hello world" in Pharo? If so, that
doesn't sound productive to me at all. Really, the only thing I saw in that
video that made me feel envious in the least was the exemplary method search.
But you don't need an environment like that to have exemplary search; I've
been told Hoogle offers something like it for Haskell, for example.

Apart from that, I was pretty unimpressed with most of what I saw in that
video, to be honest. The class browsing didn't seem particularly different
from what Eclipse has to offer (which should be unsurprising given Eclipse's
heritage in IBM VisualAge Smalltalk). The debugger didn't seem to be anything
special -- it looks like a debugger. Going further, the heavy reliance on the
mouse and the floating/stacking model of window management seriously cramp my
style and slow me down.

Even as a language, I don't see what Smalltalk has to offer the programmer
when compared to other languages. Yes, it's nice- and clean-looking. Yes, it
was hugely influential. But it forces you to build your entire application out
of nothing but objects and methods belonging to them, and cannot offer the
flexibility of a multiparadigm language. Even as a strictly-OO language, it
limits you to single inheritance and single dispatch. What other tools does it
offer for creating and composing abstractions beyond its degenerate notions of
objects and methods? Perhaps in 1980 it was an excellent choice, but we've had
better choices since the 90s rolled in.

I've got enormous respect for the likes of Alan Kay, Dan Ingalls, L Peter
Deutsche, and their whole crew at PARC. They certainly made history and have
had a great deal of influence on our field. Notwithstanding, they were not
alone in their innovation, and their product was not and is not perfect.
Perhaps nothing will ever be perfect, but I feel as though Smalltalk has been
surpassed at this point in time.

~~~
horrido
Smalltalk doesn't only rely on OOP. It has lambdas and closures so that you
have functional capabilities, too. Not strictly multi-paradigm, but close
enough. This is why Smalltalk is so powerful.

Multiple inheritance has its problems, too. I prefer the greater simplicity of
single inheritance.

~~~
groovy2shoes
Most "problems" with multiple inheritance stem from languages that don't
provide a well-defined method resolution scheme. Languages that _do_ have a
well-defined hierarchy linearization tend to avoid most of the problems with
multiple inheritance.

See, for example: Common Lisp, Dylan, Python (since 2.3), Perl 6, ...

------
lyjackal
I learned to program in Dolphin SmallTalk at a small business run out of barn
next to a bunch of soybean farms. While probably not the best language to run
a production application with (because of the tininess of the community), I
agree that it's a great language to learn on. I think the SmallTalk
development environment is one of the closest things available to what Bret
Victor was talking about in this article:
[http://worrydream.com/LearnableProgramming/](http://worrydream.com/LearnableProgramming/).
The IDE integration and live coding experience is fantastic. I really miss
this feature in other languages/IDEs. It's also amazing how the refactoring
engine in Dolphin is as good/better for a dynamically typed language than many
IDEs for statically typed languages.

------
Kinnard
I'd love to see a dance-off between pg and a smalltalk advocate.

~~~
endlessvoid94
This thread between Alan Kay and Rich Hickey was pretty close:
[https://news.ycombinator.com/item?id=11945722](https://news.ycombinator.com/item?id=11945722)

~~~
wrefordt
That was painful. Two smart people talking around each other.

~~~
endlessvoid94
I thought it was really interesting to hear what they had to say, even if they
weren't conversing well with each other.

This IS HN, after all :-P

------
chadcmulligan
I remember learning smalltalk years ago and would have loved to use it
commercially, it always had many problems though. Platform support, databases
connectivity, performance, you couldn't make a shrink wrapped distributable.
It was always stuck as an academic language imho, which is a shame. Even now
lets say I wanted to use it to develop my mobile app, I don't think this is
possible? Learn it by all means it has some great ideas.

~~~
horrido
I use Amber Smalltalk to write cross-platform mobile apps for Android and iOS:
[https://medium.com/smalltalk-talk/amber-alert-we-can-do-
mobi...](https://medium.com/smalltalk-talk/amber-alert-we-can-do-mobile-
apps-34b2d4d32731)

Smalltalk is not stuck as an academic language. Cincom and GemTalk would be
very surprised to hear that. It is, and has been, used all around the world
for commercial purposes for over three decades: [https://medium.com/smalltalk-
talk/who-uses-smalltalk-c6fdaa6...](https://medium.com/smalltalk-talk/who-
uses-smalltalk-c6fdaa6319a)

It is possible to create shrink-wrapped distributables, but these days there
really isn't much call for it. Most of the action is in the web and mobile
space and IoT and so on.

Regarding performance, it was an issue prior to circa 1995, but today's
hardware is more than fast enough. That's why Python and Ruby and Perl and
Erlang are so popular, being no faster than Smalltalk.

~~~
chadcmulligan
Do you know of a native version of smalltalk for mobile and desktop (produces
native executables that is)? Not a web browser version - too slow for my
purposes. I haven't been able to find one.

~~~
horrido
Unfortunately, no.

------
AdmiralAsshat
Article very briefly mentions Squeak[0], which I think would be worth looking
into if you wish to pursue Smalltalk as a modern language instead of simply a
historical footnote. Alan Kay, Smalltalk's creator, continues to contribute to
Squeak, which he considers closer to his original ideal of what the language
should be than Smalltalk-80.

[0][https://en.wikipedia.org/wiki/Squeak](https://en.wikipedia.org/wiki/Squeak)

~~~
gokr
Hmmm, I find this slightly misleading. It was a long time ago that the
original Smalltalk creators were involved in Squeak (Dan Ingalls is the main
developer, Alan Kay the visionary).

It should also be mentioned that Squeak (and Pharo too) was and still is VERY
close to Smalltalk-80.

------
GFK_of_xmaspast
I think that's vacuously true in that learning any language that's dissimilar
enough from the ones you already know can make you a better developer.
(Smalltalk's nowhere close to the top of the "learn next" stack for me tho)

------
Sam_Harris
Unstoppable pop-ups

~~~
guiambros
I almost can't read anything more than a page long without Print Friendly[1]
or Readability[2]. Not because of ads, but getting rid of all the distraction
makes it so much more pleasurable.

No wonder why Medium has grown so much.

[1] [https://www.printfriendly.com/](https://www.printfriendly.com/)

[2] [https://www.readability.com](https://www.readability.com)

~~~
agumonkey
If browsers showed stats, I wouldn't be surprised printfriendly being on the
first spot.

printfriendly will lower your blood pressure.

When I feel anarchist enough I use dillo.

