Main contents

Archive for October 2009

Squeak, and why i don’t use it

October 14th, 2009

for those of you who don’t know what squeak is, it’s an implementation of smalltalk-80 by programmers at apple.  for those of you who don’t know what smalltalk is, smalltalk is a pure object-oriented programming language.  for those of you who don’t know that a pure object-oriented programming language is, i’d recommend going to read some stuff on wikipedia.

smalltalk should appeal to me.  it is pure, totally pure.  everything is an object.  even the source code and object definitions are objects (lots of reflection).  numbers are objects too (not like in boring java).  it is a long way away from C, a language that i both love (because it thinks the way you think computers think) and hate (because of huge bugs in its syntax—how many meanings does * have again?).  smalltalk also has things like closures, which allow the equivalent of first-class functions.  so i should love it.

it has very simple, very well-defined, clear and concise syntax.  just like scheme, you don’t need much experience to be able to look at a piece of code and have a good idea what it’s going to do.  precedence rules are simple, just like in scheme, and unlike any C-style language–(*struct).var anybody?–and it has a proper assignment operator, just like scheme again, and just unlike any C-style language i know of.

actually i was reminded of this point recently when talking to a friend of mine. he’s just started studying physics in halle (a town in the old east of germany), and he has a programming course where he’s being taught object-oriented programming in C#.  i kid you not.  leaving the utter stupidity of teaching students a language with such patent and copyright concerns on one side for a second, i found it quite amusing to have to explain to him the difference between a=b; and a==b.  in particular he found b=b+1; to be obviously wrong and the whole idea of doubling an equals sign to be very strange. one compares this with scheme (set! a b) and (eq? a b) or smalltalk a:=b and a=b (which is also a bit dodgy in my book), and you really can’t blame him for being confused.  and c-style languages are full of this crap!

so here i am making an impassioned plea for smalltalk and scheme, but i don’t use smalltalk at all.  smalltalk and squeak get so much quite obviously right where languages like C++, perl, python, C# etc. just quite obviously are horribly wrong.  thinking about it, i can only think of two usable languages with c-style syntax, javascript and ruby, one of which is an implementation of scheme and the other an implementation of smalltalk.  but i’m still quite suspicious of squeak, mainly because it’s been designed by apple programmers (which makes me worry about patents and copyright laws) but also because of performance concerns.  the thing is, if my scheme program gets slow, it’s my fault. and if it isn’t, well i can program some helper functions in C and compile them to be accessible from guile.  if my squeak application runs slow, finding problems in a vm is too much work for lil’ ol’ me, and thirdly, i’m not yet convinced by object-oriented programming, but that’s another blog post.

however, the pharo project seems to be clearing up my first concern here, so when that’s settled down a bit, i’ll give it a whirl. the pharo project can be found here. i particularly like the snazzy logo. don’t underestimate the importance of a snazzy logo!

Posted in Uncategorized | 3 Comments »