Self (language)
Self is a prototype-based, object-oriented programming language descended from Smalltalk that eliminated classes in favor of object cloning, and whose research on fast dynamic dispatch pioneered techniques — including inline caching — that…
Definition
Self is a prototype-based, object-oriented programming language descended from Smalltalk that eliminated classes in favor of object cloning, and whose research on fast dynamic dispatch pioneered techniques — including inline caching — that underlie modern JIT compilers such as JavaScript's V8.
Overview
Self was developed starting in 1986 by David Ungar and Randall Smith, initially at Xerox PARC and later at Stanford and Sun Microsystems, as an exploration of taking Smalltalk's object-oriented purity even further by removing the class/instance distinction entirely. Instead of defining a class as a template from which objects are instantiated, Self is prototype-based: new objects are created by cloning an existing object (a 'prototype') and then modifying or extending it directly, with objects able to share behavior through 'parent' slots that form a delegation hierarchy in place of class inheritance. This model is more dynamic and uniform than class-based OOP — there is no separate concept of a 'class' at all, only objects, some of which happen to serve as prototypes for others. Because Self's fully dynamic, class-free object model made naïve method dispatch prohibitively slow compared to statically typed or class-based languages, the Self implementation team pioneered a series of highly influential virtual machine and just-in-time compilation techniques to make dynamic dispatch fast in practice: inline caching (remembering the result of a previous method lookup at a call site to skip repeated lookups), polymorphic inline caching, adaptive/type-feedback-driven recompilation, and generational garbage collection tuned for object-oriented workloads. These techniques, published in a series of influential research papers through the late 1980s and 1990s, directly shaped the design of the Java HotSpot virtual machine and, later, the V8 JavaScript engine used in Chrome and Node.js — meaning Self's research legacy runs through nearly every modern high-performance dynamic-language runtime, even though Self itself was never widely adopted as a production language. Self also pioneered morphic, a live, direct-manipulation graphical user interface framework in which on-screen objects ('morphs') can be directly grabbed, reshaped, and recombined by the user, an idea later carried into Squeak and other Smalltalk-family environments. Development of Self effectively concluded in the late 1990s, but it remains a landmark research language studied for its object model and, especially, for the compiler and runtime techniques it originated.
Key Features
- Prototype-based object model — no classes; new objects are created by cloning existing ones
- Delegation via 'parent' slots in place of class-based inheritance
- Pioneered inline caching and polymorphic inline caching for fast dynamic method dispatch
- Introduced adaptive, type-feedback-driven just-in-time recompilation techniques
- Its runtime research directly influenced Java HotSpot and the V8 JavaScript engine
- Introduced the Morphic direct-manipulation graphical user interface framework
- Developed at Xerox PARC, Stanford, and Sun Microsystems from 1986 through the late 1990s
Use Cases
Alternatives
Frequently Asked Questions
From the Blog
What Is Self-Attention in Neural Networks
Self-attention lets each token in a sequence attend to every other token in the same sequence, building context-aware representations that power transformer models.
Read More ProgrammingPython Classes and Objects for Beginners
A class is a blueprint and an object is an instance built from it. Learn Python classes, the __init__ method, self, attributes, and methods with beginner examples.
Read More Career GrowthTime Management Tips for Self-Taught Coders
Manage your time as a self-taught coder with a clear roadmap, focused blocks, project-based learning, and consistency that beats occasional marathon sessions.
Read More Career GrowthBootcamp vs Self-Taught vs Degree: Which Is Right
Bootcamp, self-taught, or degree? The right path depends on your time, budget, learning style, and goals — each can lead to a developer career.
Read More