[squeak-dev] Smalltalk and functional programming

Frank Shearar frank.shearar at angband.za.org
Tue Aug 24 16:35:51 UTC 2010


On 2010/08/24 15:27, Michael Haupt wrote:
> Rob,
>
> On Tue, Aug 24, 2010 at 3:19 PM, Rob Withers<reefedjib at gmail.com>  wrote:
>> Smalltalk is a dynamic fuctional object-oriented language.
>
> you forgot "imperative" and, hey, since you can implement Prolog in
> it, "logic". ;-) Sorry for the sarcasm, but Turing completeness just
> bites. (Yes, it's a bottom argument, but this kind of question just
> calls for it.)
>
> If someone'd ask me, I'd respond that Smalltalk is IMHO not a
> functional language. What is the primary means of abstraction at work
> in Smalltalk? Not functions, right?
>
> The other way around, would you agree that, uh, Haskell is an
> object-oriented language because you can somehow emulate objects and
> state using monads?

Well, that's the thing. If you tried to write OO in Haskell, you'd fight 
the language, right? It's not natural to use Haskell to write OO. 
Similarly, you don't write OO in C because it _hurts_.

On the other hand, while clearly not a pure functional language like 
Haskell, it's not hard - it's _easy_ - to write in a functional manner.

Languages support certain ways of working better than others. Smalltalk 
seems to support working in a functional manner rather well. (In 
contrast, try doing so in Delphi. I don't recommend it.)

(Everything in Common Lisp is an object, so is that not an FPL anymore?)

So, in my book, if a tool's good for hitting things, it's a hammer. 
Whether that hammer has a metal end and a wooden handle, or a rock, I 
don't really care.

Saying that Smalltalk isn't an FPL because its functions all happen to 
be associated with a class just seems foolish to me.

At any rate, it seems I'm relatively alone in thinking this way, which 
is fine by me.

frank



More information about the Squeak-dev mailing list