Live data from Hacker News

How learning Smalltalk can make you a better developer

techbeacon.com

41–50 of 73 posts

Re: How learning Smalltalk can make you a better developer

#41
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!

Re: How learning Smalltalk can make you a better developer

#42

Earlier quoted context omitted.

I'm not adverse to leaving my text editor, but I'd rather learn the language before learning a totally new and unfamilliar environment. Is that such a bad thing?

Yes, because you incorrectly presume those are different things that should be separated; in Smalltalk the language and environment are so deeply interwoven to create a live coding experience that what you want is simply the wrong approach, you can't get the correct experience doing what you want. This is a case of "what you already know" getting in the way of learning.

As a young Scratcher, Smalltalk was one of the first languages I tried. Before I even know emacs, or any of that stuff. It's not what I know that's getting in the way: It's what I don't know, and is never explained, because the Squeak docs are TERRIBLE. If somebody would explain how it works, I'd be willing to try. And I just got some new resources, so I'll give it a shot.

Re: How learning Smalltalk can make you a better developer

#43

Earlier quoted context omitted.

Yes, because you incorrectly presume those are different things that should be separated; in Smalltalk the language and environment are so deeply interwoven to create a live coding experience that what you want is simply the wrong approach, you can't get the correct experience doing what you want. This is a case of "what you already know" getting in the way of learning.

As a young Scratcher, Smalltalk was one of the first languages I tried. Before I even know emacs, or any of that stuff. It's not what I know that's getting in the way: It's what I don't know, and is never explained, because the Squeak docs are TERRIBLE. If somebody would explain how it works, I'd be willing to try. And I just got some new resources, so I'll give it a shot.

Well, that's true, the docs are terrible; you're way better off finding videos of people using the environment and eventually just learning to experiment with it. Largely what's different is that everything is live, all text is code and all code is text and you can highlight anything anywhere and execute it via either context menu or hotkeys. Pays to learn the hotkeys. Pays to learn to use hotkey for inspector and evaluator; inspectors are amazing, working with an object model without a database needing to be behind it is amazing, it lets you prototype extremely fast. And finally, the language itself is amazing as it's a programmable programming language, you can extend it to work to your will with very nice internal DSL's largely thanks to cascades and a clean anonymous function syntax.

Re: How learning Smalltalk can make you a better developer

#44
post #41

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…

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

Re: How learning Smalltalk can make you a better developer

#45

Earlier quoted context omitted.

As a young Scratcher, Smalltalk was one of the first languages I tried. Before I even know emacs, or any of that stuff. It's not what I know that's getting in the way: It's what I don't know, and is never explained, because the Squeak docs are TERRIBLE. If somebody would explain how it works, I'd be willing to try. And I just got some new resources, so I'll give it a shot.

Well, that's true, the docs are terrible; you're way better off finding videos of people using the environment and eventually just learning to experiment with it. Largely what's different is that everything is live, all text is code and all code is text and you can highlight anything anywhere and execute it via either context menu or hotkeys. Pays to learn the hotkeys. Pays to learn to use hotkey for inspector and ev…

And how am I supposed to learn all of that? ;).

Maybe there's a reason Smalltalk never caught on...

Re: How learning Smalltalk can make you a better developer

#46

Earlier quoted context omitted.

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 g…

> 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 a…

> 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...

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

Re: How learning Smalltalk can make you a better developer

#47

Earlier quoted context omitted.

Well, that's true, the docs are terrible; you're way better off finding videos of people using the environment and eventually just learning to experiment with it. Largely what's different is that everything is live, all text is code and all code is text and you can highlight anything anywhere and execute it via either context menu or hotkeys. Pays to learn the hotkeys. Pays to learn to use hotkey for inspector and ev…

And how am I supposed to learn all of that? ;). Maybe there's a reason Smalltalk never caught on...

> And how am I supposed to learn all of that? ;).

Those who want to learn, do.

> Maybe there's a reason Smalltalk never caught on...

There is, that wasn't it. The reason it didn't catch on was lack of a free version during the period of time it could have taken off. It cost a fortune and was competing with languages that were free to developers, Java took off instead.

Re: How learning Smalltalk can make you a better developer

#48
post #16

Earlier quoted context omitted.

The language and IDE are so simple that it takes very little effort to learn, at least, in my experience. But you're right about the class library. However, is this really any different for any OOP language that has a rich class library? Or any language that has a rich API ( Java C# )? Smalltalk documentation isn't that bad. Here's a very, very gentle tutorial: http://amber-lang.net/learn.html Here's a great (free!)…

SBE is so far out of date that many of its details are now simply wrong. GST's docs are actually up to date, organized, and easy to find. However, I haven't seen all of these resources, so thanks for the tips.

> SBE is so far out of date

Pharo By Example is being revised for Pharo 5. The first 13 chapters are done... https://github.com/SquareBracketAssociates/UpdatedPharoByExa...

The whole book can be downloaded from... https://ci.inria.fr/pharo-contribution/view/Books/job/Update...

Re: How learning Smalltalk can make you a better developer

#49

Earlier quoted context omitted.

Well, that's true, the docs are terrible; you're way better off finding videos of people using the environment and eventually just learning to experiment with it. Largely what's different is that everything is live, all text is code and all code is text and you can highlight anything anywhere and execute it via either context menu or hotkeys. Pays to learn the hotkeys. Pays to learn to use hotkey for inspector and ev…

And how am I supposed to learn all of that? ;). Maybe there's a reason Smalltalk never caught on...

There was, and it's explained here: https://medium.com/smalltalk-talk/why-aren-t-people-using-sm...

Re: How learning Smalltalk can make you a better developer

#50

Earlier quoted context omitted.

> 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 a…

> 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 tr…

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

Now you've probably heard that in Smalltalk everything is an object. Sure its an nice catch-phrase but hard to grasp its significance. Consider then, that classes and methods are live objects within the Image. You can operate on them as you work within the live Image and from your application program.

For example, the Pharo mail list was recently asked the following question... > I want to have many different object instances with different > behaviors picked at random from a list of available behaviors. What I had in mind was a functionality similar > to prototyped languages like Self and Javascript in which you > could change the behavior inside the object and not the class/prototype.

A way to achieve this is to define each behavior as a normal method. For convenience, we'll define two protocols, 'behaviors' and 'non-behaviors' in the system Browser to hold these. For the uninitiated here is a short intro to the Browser. Protocols show in the third pane. https://www.youtube.com/watch?v=zgQjcZ9SCCs

The class MyObject is defined with an instance variable to hold which behavior to invoke...

  Object subclass: #MyObject
      instanceVariableNames: 'behavior'
      classVariableNames: ''
      package: 'Example'
In the Browser, add these two methods to the 'behaviors' protocol...

    behavior1
        Transcript show: '1'.

    behavior2
         Transcript show: '2'.
When an object is created, we'll set an object's behavior by asking its class for all its methods, selecting those that are in the #behaviors protocol, then from that collection making a random selection.

In the Browser, add these two methods to the 'non-behaviors' protocol...

    initialize
        | behaviors |
        behaviors := self class methods select: [ :m | m protocol = #behaviors ].
        behavior := behaviors atRandom selector.

    perform
        self perform: behavior.
Thats all that is required.

To test this, from Playground (our REPL) evaluate... Transcript open. 10 timesRepeat: [ MyObject new perform ].

==> 2221212212

But how do I add new behavior at run-time you may ask? Now since classes are objects within the runtime Image, the application can ask the class to compile a new behavior. This is can be demonstrated by evaluating this code in the Playground...

    newBehavior := 'behavior3
             Transcript show: ''3'' '.
    MyObject 
        compile: newBehavior 
        classified: #behaviors
        notifying: nil.
To test this, from Playground evaluate...

     Transcript clear.
     10 timesRepeat: [ MyObject new perform ].
==> 211133212

That flexibility is why I love Smalltalk.

Post reply on HN