Archives for category: Uncategorized

Back in the far off days of 1995, when the world was young and Windows 95 was new and exciting, Sun made an introductory Self video. It’s about 20 minutes long; unfortunately the version here isn’t the best quality but it’s still a good overview of Self, Morphic and the Self VM.

It is both good and bad that most of the stuff described in this video works much the same way today—but at least Self will now run on your Macbook or Linux box!

Staring Randall B Smith, David Ungar and Mario Wolczko: Self, the Video!

Documentation is at the heart of any successful open source project and, as Self wakes from its slumbers, documentation is vital to providing a way for interested people to learn and participate.

Self has a number of manuals, as well as important published papers, but these have been available only as pdf.

Three of these manuals (the Programmers Reference Manual, the Programming Environment Manual and the Morphic Manual) have been turned into HTML and combined into the new Self Handbook, which is available to read on line at http://docs.selflanguage.org.

This is quite comprehensive—in pdf form it is at the moment around 140 pages.

Read and enjoy 🙂

David Ungar, co-creator of Self, is due to speak to the at the Stanford University Department of Electrical Engineering Computer Systems Colloquium on September 30, 2009.
The talk will cover a range of material including, in Dave’s words, “a fair amount of Self in it”.
Check out the <a href=”http://www.stanford.edu/class/ee380/”>Colloquium website</a>, which should have links to live video streaming.  There is also the possiblity that the talk will be later available from Stanford through iTunes or Youtube.

David Ungar, co-creator of Self, is due to speak to the at the Stanford University Department of Electrical Engineering Computer Systems Colloquium on September 30, 2009.

The talk will cover a range of material including, in Dave’s words, “a fair amount of Self in it”.

Check out the Colloquium website, which should have links to live video streaming.  There is also the possiblity that the talk will be later available from Stanford through iTunes or Youtube.

I believe that a Klein-like VM has the potential to be more object-oriented and more interactive than a Squeak-like VM. But one of the costs of the Klein approach is that we can’t reuse existing compilers the way Squeak does.

One of the cool things about the Squeak VM is that by writing it in a subset of Smalltalk, they were able to use the standard Smalltalk environment to write and debug the VM, while still taking advantage of all the work that’s gone into implementing C compilers. Writing in restricted Smalltalk is still nicer than writing in C, and debugging a simulated interpreter using the Smalltalk debugger is nicer than using a C debugger. (And while GCC isn’t written in Smalltalk, the Squeak guys don’t have to maintain it, so who cares?)

In contrast, one of Klein’s goals is to write the entire VM in a normal, high-level, object-oriented style. This includes the compiler and the assembler and the garbage collector and the interpreter (if we someday decide that we want an interpreter) and the object-format subsystem and everything else. So far, I believe we’ve only had to “cheat” (dip down into a lower-level style) in two small places: we had to write the message-sending routine without doing any message sends, and the object-cloning routine without doing any cloning (which meant we couldn’t use blocks). But I believe that even those compromises are just temporary – now that we’ve got a compiler that can inline away message-sends and block-clones, we should be able to rewrite even those two routines in a normal OO Self style.

So we’ve had to write our own compiler ourselves, and we’ll have to maintain it and port it ourselves. But the payoff is that the whole VM can be written in full OO Self, and be a live part of the running Klein image.

Which brings me to the other big difference between Klein and Squeak: in Squeak, the running VM isn’t part of the image. If you use the Squeak environment to make a change to the source code of the Squeak interpreter, the currently-running Squeak system doesn’t immediately change – you have to re-run the Slang-to-C translator and rebuild the VM and restart the image. (You can use Squeak to run a simulated Squeak interpreter, and make changes to the source code of the interpreter and see the changes immediately take effect in the simulation. But you don’t get that kind of interactiveness in the real base-level Squeak.) And if you want to debug the Squeak VM, you have to either use C tools to debug the real VM, or you have to recreate the bug in the simulator and use an existing Squeak to debug the simulated Squeak.

(Someone please correct me if I’m wrong. I haven’t spent a lot of time playing with the Squeak VM. This is just how it seems to me, given my understanding of Squeak’s architecture.)

In contrast, the Klein VM code is all just a regular part of the running Klein image. The project isn’t far enough along yet for us to be able to hack on Klein while it’s running, but once we get there, we should be able to make changes to the running VM and see those changes take effect immediately. (I expect this to be both very useful and very dangerous – a tradeoff Smalltalkers are used to. :)) So when we debug the Klein VM, we’re looking at the real, running, compiled code, using the standard Self environment.

A third difference is that in Klein we intend to – and for performance reasons we pretty much have to – implement Self’s dynamic optimization tricks, whereas I don’t think the current Squeak VM does much of that kind of thing. But I don’t think that’s a fundamental limitation of the Squeak VM architecture. (I’m excited about Cog!)

I never actually wanted to be a VM guy.

I fell in love with Smalltalk because it was simple and powerful and it fit the way I thought. (Later I fell in love with Self because it was even more so. ;)) The languages that I like best are the ones that are designed for human beings (rather than for computers or drones or mathematicians).

But every so often I have a language idea I’d like to try out – and to do that, it helps to be able to tinker with VMs. Unfortunately, VMs these days tend to be written in languages like C – and thanks to all the cool optimization technologies needed to make a language like Self run fast, they tend to be fairly hefty chunks of C, too. The Self VM is over 100,000 lines of C++, and I’m kinda scared of it.

So I dream of having a VM that’s simple and malleable and debuggable and written in a high-level language, but also includes enough Self-style optimization technology that it can make a really pure OO language run well. That’s one of the reasons why I was so excited about Klein – one of our goals was to produce a VM like that, written almost entirely in full object-oriented Self, and a VM-development environment that’s as comfortable and interactive as a regular Self or Smalltalk application-development environment. (So far, it seems to me like the “fully OO” part has been working out pretty well, but the interactiveness part has proven to be a major challenge – the project is still plagued by long compile times. I think it’s solvable, though.)

There hasn’t been any serious work done on Klein since Sun cancelled the project back in late 2005, but I pulled out the code a few months ago and started spending my spare time working on it. There’s nothing in there really worth seeing yet – I’m still working out the bugs in the inlining compiler that I just wrote, so everything’s kinda broken right now. (I’m hoping to have the inlining compiler working dynamically soon, though, at which point it’ll be interesting to see how much of a difference it makes, since practically everything in Klein, right down to the innermost loops of the GC, is written in an OO style with lots of message sends.) But one of the reasons I’m writing this post is because I’m wondering whether there’s anybody out there who feels like doing some hacking on Klein – there’s lots of fun stuff to be done, and I’d welcome the help.

I’m also wondering whether there’s another VM out there that’s further along towards fulfilling Klein’s goals. (I haven’t been keeping up with the VM world over the past few years.) Maybe Exupery?

And my third wondering is whether there’d be interest in Klein outside the Self community. If Klein ever does become a usable Self VM, it ought to be usable for other OO languages too, especially Smalltalk. If there was interest in the Smalltalk community in having a Klein-style VM, I’d make it a higher priority to teach Klein to handle non-LIFO blocks, which was one of the main obstacles preventing Mario Wolczko’s Smalltalk-to-Self translator from being a production-ready Smalltalk. (Sometimes I think about doing that for the current Self VM, just because I envy the size of the Smalltalk community – it’d be nice to be able to use Smalltalk libraries inside Self. Plus it might be kinda fun to work in a system with Smalltalk objects and Self objects living side-by-side – though the purist in me thinks it’d be a shame to complexify Self with all those unnecessary “class” things. 😉 But that’s a topic for another blog post.)

Anyway, that’s what’s going on with Klein these days. I’m not sure whether it’s worth pursuing or not. Working on the GC and the inlining compiler has been kinda fun (turns out that being a VM guy isn’t so bad after all), but I’m more likely to keep going with it if I know that people are actually interested in it.

The new Self Linux VM is available for download in binary form from the Self website. For most purposes this will be the easiest way to get Self running on Linux.

Nevertheless, Self is an open source language and so the source for the VM is available.  If you wish to compile Self on Linux, it is quite easy and straightforward.

The binary available on selflanguage.org was compiled on Ubuntu 7.04 running in VMWare on a Macbook Pro.  The version of GCC was 4.1.2. Later versions of GCC should work, but will give a lot of warnings (“deprecated conversion from string constant to char*” – just ignore it).

From a clean Ubuntu 7.04, I installed:

  • libc6-dev
  • g++
  • flex-old
  • build-essentials
  • xorg-dev
  • libncurses5-dev

I then got a copy of the source from the Self Github repository:

git clone git://github.com/russellallen/self.git

I then cd into the Self directory and:

cd release
chmod a+x buildLinuxVM
./buildLinuxVM

This should build a stripped Linux VM and put it in the top level of your source directory.

One of the first questions I ever asked David Ungar, when I first started to work for him on the Klein project, was, “So, what can we do to make Self more popular?”

He answered, “Why would we want to do that?”

It had never occurred to me before that it might not be a good idea to make myself crazy evangelizing my favourite programming language.

Nevertheless, I am hereby declaring my intention to actually spend some of my time writing about Self and Klein. (Maybe committing to it publicly will help me stick to it.) I’m doing this for two reasons:

  • I’ve spent the past two years working with much less interesting technologies, and if I don’t get back into the Smalltalk/Self world my soul is going to implode.
  • I need to find some articulate defenders of the class-based way of life, because there are some conversations I need to have with them.

I’ll post again soon, but for now I’m wondering: who’s reading this? Mostly Smalltalkers, or do we have visitors from far-away cultures too?

This new group blog has been added to http://planet.smalltalk.org, so welcome to everyone reading it!

For those of you not familiar with Self, it is  a prototype-based dynamic object-oriented programming language in the Smalltalk family with an environment and virtual machine centered around the principles of simplicity, uniformity, concreteness, and liveness.

Self includes a programming language, a collection of objects defined in the Self language, and a programming environment built in Self for writing Self programs. The language and environment attempt to present objects to the programmer and user in as direct and physical a way as possible. The system uses the prototype-based style of object construction.

It is currently being reinvigorated with a new release – including a Linux version – and is Open Source under a BSD-like licence.

This blog has been set up as a central place for information on the development of Self and for discussion of Self matters by the Self and Smalltalk communities, so please join us at blog.selflanguage.org or on our mailing list.

Congradulations Dave!

David Ungar will receive the 2009 Dahl-Nygaard Senior Prize for his groundbreaking work in the field of object-orientation. The Dahl-Nygaard Prize will recognize Ungar’s complete body of work, most notably for his role in inventing Self, the object-oriented programming language based on the concept of prototypes.

Welcome to blog.selflanguage.org!

This is the place to keep up to date with Self development, and to learn more about using and developing with Self.

More content will be added soon, in the meantime, why not head over to the main site and download a free copy of Self for your Mac or Linux box…