Learn Erlang in 5 seconds - competition - win a prize

Richard A. O'Keefe <>
Fri Aug 25 04:19:48 CEST 2006


Serge Aleynikov <> wrote:
	"What if you were to write a system that was OS-agnostic, would easily 
	scale to 100,000s of processes, would run on a cluster of machines, 
	would offer nine nines of uptime, and would have to be built in a week? 
	...  Sounds impossible with Smalltalk?  ...  Add Erlang to your arsenal 
	and see for yourself!"
	
Actually, no, it DOESN'T sound impossible with Smalltalk.
Erlang is available for Windows, Solaris, Linux, MacOS X, and some others.
Squeak Smalltalk is available for Windows, Solaris, Linux, MacOS X, and
some others.  So "OS-agnostic" is easy.  Scale to 100,000s of processes?
Well, it took me 0.6 seconds to create 10,000 processes on a 1GHz PowerMac.
That gave me courage to try forking 200,000 processes, and that just took
9.3 seconds.  Mind you, they didn't _do_ anything much...  For IPC, Squeak
has semaphores (inherited from ST-80) and message queues.  Run on a cluster
of machines?  Squeak has serialised streams (SmartRefStream), so sending
graphs of objects from one machine to another is dead simple, and it certainly
has cross-platform support for sockets.  In fact, when you open a file
browser, the root is *under* the root of your local file system; FTP is just
there.  Squeak has its own web browser and mail user agent and web server
(in fact more than one).  It *is* being used to develop distributed stuff.
Built in a week?  Depends on how much of OTP would need reinventing, but
there doesn't seem to be any reason why it couldn't be done; the IDE in
Squeak is really rather pleasant (and there's the refactoring browser).
Someone already skilled in Smalltalk would likely take far less time to
finish such a system in Squeak than in Erlang.

Nine nines of uptime?  That's 3 MILLISECONDS of downtime in a year, no?
Sorry, for something built in a week I just don't believe it.  I believe
it a little bit more for Erlang than I do for Smalltalk, just like I have
a little bit more belief in mermaids than in vampires.

It is *never* a good idea to insult your audience.
As Anatol Rapoport (sp?) pointed out in a great book once,
in any kind of real-world debate it's a good move to start
by explaining why your rival is RIGHT about so many things
and is reasonably concerned about so many issues.

If you tell a Smalltalk audience that they can't develop distributed
concurrent systems in Smalltalk they will write you down as an arrogant
idiot who knows nothing about Smalltalk, and won't hear anything else you
say no matter how good it is.

If you tell them that Smalltalk is great and that Erlang is great too
and part of this is their common heritage, they will start listening.
If you praise Smalltalk development environments and say that Erlang
has learned from Smalltalk (ErlIde + unit testing framework) and has
more things to learn from Smalltalk (refactoring browser) they will start
to get warm fuzzy feelings about you (this guy has taken the trouble to
learn something about us, he's worth listening to).

You should certainly admit that while Erlang has a GUI kit (in fact more
than one), it's not a strength of the language, and that connecting a
Smalltalk GUI with an Erlang system might be a good way to proceed.
(Alas, _each_ Smalltalk has its _own_ incompatible GUI kit; Squeak even
manages to have two of them.)

THEN you can say that while Smalltalk has always HAD concurrency it has
never been a PRIMARY focus of the language, while Erlang has had
concurrency has its primary focus from day 1.  Some of the differences
between Smalltalk and Erlang, like syntax, are just accidents of history.
Other differences (objects -vs- immutable data) are due to this
fundamental difference of emphasis.




More information about the erlang-questions mailing list