[sapug] Erlang, the movie.

Chris Foote chris at inetd.com.au
Tue Oct 3 06:03:17 CEST 2006

On Mon, 2 Oct 2006, Daryl Tester wrote:

> A small movie put together by the Erlang guys to show off the
> language's "features".
> http://video.google.com.au/videoplay?docid=-5830318882717959520
> Maybe it's just me, but the guy giving the bulk of the presentation
> reminds me too much of Graham Chapman.

hehe... Reminds me of documentaries from the 70's :-)  Love the credits
music at the end.

> Tangentially related - I've always been fascinated by systems which
> are designed to be "long lived runners"; that is, systems that run
> for the uptime of the machine that they're on.  Just the mindset
> required to achieve this interests me - for example:
> *)  The ability to adjust the configuration on the fly.
> *)  The ability to modify the software on the fly.

Actually, another use is simply to inspect values at runtime
for debugging purposes.  i.e. Something goes wrong, so you
connect to the running interpreter in the same environment as the
program, and print values of things to find out why something
didn't work as expected.

The voice peering project I'm working on has an embedded interpreter
running in a seperate thread in 'screen' sessions (using code.interact() )
for each component of the distributed application.  If something strange
happens, I just resume one of the screen sessions, and then use the
interpreter to check objects out.

> The second point is why I'm so keen to stick a REPL interpreter
> into some of the applications I've been working on, and Python's
> reference counting helps with this.  Because functions and classes
> are first class objects, you can do cunningness like taking a
> reference to the function/class, load in the new version of module
> and still be able to access the existing code.

Yep, very cool.

It's a shame that it's not usable outside of reloading a module:

>>> class C(object):
...     def method(self):
...             return '1st method version'
>>> c = C()
>>> c.method()
'1st method version'
>>> def newmethod(self):
...     return '2nd method version'
>>> C.method = newmethod
>>> c.method()
'2nd method version'

i.e. existing object uses new version of method.

Maybe there is another way to do it.

> It should be possible to set up a "transaction in progress" to
> continue being processed "the old way", while new transactions
> are processed by the new methods.

The Common LISP object system has a nifty way to upgrade existing objects
by invoking a 'class-changed' method.[1]  CL makes my brain hurt :-(

[1] PDF Pg16 http://www.dreamsongs.com/Files/ECOOP.pdf

Chris Foote <chris at inetd.com.au>
Inetd Pty Ltd T/A HostExpress
Web:   http://www.hostexpress.com.au
Blog:  http://www.hostexpress.com.au/drupal/chris
Phone: (08) 8410 4566

More information about the sapug mailing list