Self World

The language with no classes…
that taught JavaScript how to be fast.

Self is a tiny, radical programming language from 1986. No classes, no variables, not even an if statement — just objects talking to objects. It sounds impossible. It quietly shaped the code you run every day.

What is Self?

Three ideas. That's the whole language.

Most languages give you classes, instances, variables, constructors, static methods, getters, setters… Self looked at all that and said: what if it's all just objects?

🧱

Objects are bags of slots

An object is a list of named slots. A slot holds a value or a method — and reading a slot and calling a method look exactly the same.

🐑

Copy, don't instantiate

No classes, no new. Want a new dog? Copy an existing one — the prototype — and change what's different.

👪

Ask your parents

If an object doesn't understand a message, it asks its parent objects. Parents are just slots too, so you can swap them while the program runs.

The 5-minute tour

Learn Self by poking it

Every box below runs real Self, compiled to WebAssembly, right in your browser. Edit anything and press Run (or Ctrl/⌘ + Enter). The steps share one world, so later steps can use what earlier ones made.

Everything is a message

There are no operators in Self, only messages. 3 + 4 sends the message + to the object 3. Binary messages go strictly left to right, so the answer here might surprise you.

Integers never overflow, by the way — try 1000 factorial.

Messages read like sentences

Unary messages (reverse) bind tightest, then binary ones (, joins strings), then keyword messages like copyFrom:UpTo:, whose parts after the first are capitalised.

An object is just slots

Write an object between (| and |). x <- 3 is a slot you can change, y = 4 is constant, and sum = ( … ) is a method. Notice that the method reads x by sending itself the message x.

Make a prototype…

Let's put a dog in the lobby, the object where every program starts. Its parent* slot (the star makes it a parent) gives it the ability to be copied.

…then copy it

No class, no constructor: dog copy makes a new dog with its own slots. Change the copy and the original doesn't mind. Local variables go between bars at the start.

Inherit by delegation, and call "super"

A puppy whose parent is dog gets everything dog can do. resend.speak runs the inherited version — it's what other languages call super.

Change your parents mid-sentence

Because a parent is just a slot, an object can switch who it inherits from while the program runs. Self folks call this dynamic inheritance. Here a shapeshifter starts as a dog and becomes a cat.

No if statement? Blocks!

Square brackets make a block, a piece of code you can pass around (a closure). ifTrue:False: is just a message to true or false, which decide which block to run.

Look inside anything

Self is fully reflective: you can ask any object what slots it has. In the full desktop, every object can be opened in an outliner, read, and edited live — and on-screen things are objects too, called morphs.

Open the full desktop ▶

History

A short history of a very influential "failure"

Self never became a mainstream language. Its ideas did — they just moved into other people's languages.

  1. 1967

    Simula invents objects

    Ole-Johan Dahl and Kristen Nygaard add classes and objects to a simulation language in Norway. Object-oriented programming is born.

  2. 1972 – 1980

    Smalltalk: everything is an object

    Alan Kay, Dan Ingalls, Adele Goldberg and colleagues at Xerox PARC build Smalltalk, a live world of objects sending messages, with windows and a mouse.

  3. 1986

    Self is designed at Xerox PARC

    David Ungar and Randall B. Smith ask how simple an object language could be. Their answer throws away classes entirely. The paper "Self: The Power of Simplicity" appears at OOPSLA in 1987.

  4. 1987 – 1991

    Stanford makes it fast

    Everyone said a language this dynamic would be hopelessly slow. Craig Chambers, Urs Hölzle and Ungar answered with "maps" (hidden classes), customised compilation and polymorphic inline caches. Self 1.0 ships in 1990, at about half the speed of optimised C.

  5. 1991 – 1995

    At Sun Labs: Morphic and adaptive compilation

    The project moves to Sun Microsystems. Self 4.0 brings Morphic — a UI where you grab any on-screen object and change it while it runs — and a compiler that optimises the code you actually use.

  6. 1995

    JavaScript borrows the prototypes

    Brendan Eich writes JavaScript at Netscape in about ten days, mixing Scheme's functions with Self's prototype-based objects — wrapped in a Java-like syntax.

  7. 1994 – 1999

    Self's VM team makes Java fast

    Former Self people found Animorphic Systems and build Strongtalk, a very fast Smalltalk. Sun buys the company in 1997, and its technology becomes Java's HotSpot virtual machine in 1999.

  8. 2008

    …and then JavaScript

    Lars Bak, who worked on Self, Strongtalk and HotSpot, leads Google's V8 engine for Chrome. Hidden classes and inline caches — Self's tricks — are why modern JavaScript is fast. Node.js runs on V8 from 2009.

  9. Today

    Still alive

    Self is open source and still maintained by its community. And now there's this: a Self written in Rust that runs in your browser.

Family tree

Self's family tree

Self has two kinds of children: languages that took its ideas about objects, and virtual machines that took its ideas about speed. Its user interface ideas had children too.

Simula 1967
→
Smalltalk 1972 – 80
→
Self 1986

🧬 Prototype languages

Self's prototypes copy objects, delegate to parents
↓
NewtonScript 1993 · Apple Newton
↓
JavaScript 1995 · + Scheme functions, Java syntax
↓
Io 2002 · tiny and pure prototypes
↓
Every web page you open prototype chains everywhere

⚡ Fast virtual machines

Self VM maps, inline caches, adaptive compilation
↓
Strongtalk 1990s · Animorphic Systems
↓
Java HotSpot 1999 · Sun
↓
V8 2008 · Chrome
↓
Node.js, Deno, Electron… all on V8

🖱️ Live interfaces

Self's Morphic 1995 · grab and change anything
↓
Squeak Smalltalk 1996
↓
Pharo 2008
↓
Lively Kernel 2007 · Morphic in the browser
↓
Self World 2026 · Morphic in Rust + WebAssembly
Self ❤ JavaScript

You already know Self. It's hiding in JavaScript.

JavaScript put Self's object model in Java-style clothes. Look past the syntax and it's the same idea: objects that delegate to other objects. Here's the same program in both. (The whole family saga is in the mini book, No, I Am Your Father.)

Self
| rex |
lobby _AddSlots: (|
  animal = (| parent* = traits clonable.
              speak = ( 'some noise' ) |)
|).
lobby _AddSlots: (|
  dog = (| parent* <- animal.
           speak = ( resend.speak, '... woof!' ) |)
|).

rex: dog copy.
rex speak.          "'some noise... woof!'"
rex parent: animal. "change parents at run time"
JavaScript
const animal = {
  speak() { return 'some noise'; }
};

const dog = {
  __proto__: animal,
  speak() { return super.speak() + '... woof!'; }
};

const rex = Object.create(dog);
rex.speak();       // 'some noise... woof!'
Object.setPrototypeOf(rex, animal); // same trick
IdeaSelf (1986)JavaScript
Inherit from an objectparent* <- animal__proto__: animal, Object.create(animal)
Make a new objectdog copyObject.create(dog), {...dog}
Call the inherited methodresend.speaksuper.speak()
Change parents at run timerex parent: animalObject.setPrototypeOf(rex, animal)
Add slots to a live objectdog _AddSlots: (| age <- 3 |)dog.age = 3
Closures[| :x | x * 2 ]x => x * 2
Speed trick: shared layouts"maps" (1989)V8's "hidden classes" / "shapes"
Speed trick: remember lookupspolymorphic inline caches (1991)inline caches in V8, SpiderMonkey, JavaScriptCore

Because the two are so close, Self World can translate Self straight to JavaScript. Write Self and watch the JavaScript appear → Run the result, or download it as a web app: one HTML file that runs your Self program, its objects and its windows in any browser.

Fun facts

Things that sound made up (but aren't)

Self has no variables. A method's locals are slots in an "activation object" — so even running code is made of objects.
Self has no if. true and false are objects that answer ifTrue:False: by running one block or the other.
Reading and calling look identical. dog name might read a slot or run a method — the caller can't tell, and doesn't need to.
It was "too dynamic to be fast". The fix the Self team invented now runs in your browser, every time you load a web page.
You rarely write its name. Messages to self are so common in Self that you can leave the receiver out: speak on its own means "send speak to myself".
Morphic made UIs touchable. In Self 4.0 you could pull a button off a window, look inside it and rewire it — while it worked.
Download

Self World on your desktop

The same program as the in-browser desktop, as a native app for macOS, Windows and Linux: outliners, shells, Morphic windows and loading .self files from your disk. Free and open source.

Your system
🍎

macOS

macOS 11 or later · Apple silicon and Intel

Open the disk image and drag Self World to Applications. The app isn't signed by Apple yet, so the first time, right-click it and choose Open — or run xattr -dr com.apple.quarantine "/Applications/Self World.app".

Your system
🪟

Windows

Windows 10 or 11 · 64-bit

The installer adds Self World to the Start menu, with an uninstaller. If SmartScreen warns about an unknown publisher, choose More info → Run anyway.

Your system
🐧

Linux

x86-64 · X11 or Wayland

AppImage: chmod +x SelfWorld-Linux-x86_64.AppImage, then run it. The .deb installs with sudo apt install ./SelfWorld-Linux-amd64.deb.

Or run it in your browser — nothing to install. Older versions and release notes: all releases. Building from source works too: see the README.

Ready to play in a world of objects?

Open the full Self World desktop: outliners for every object, a shell, Morphic windows and buttons made of Self objects, bouncing balls, and the original Self file format.

Open the Self desktop ▶ Download for your desktop ↓ Or a plain playground