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 Computer Vision? Real-World Examples
Computer vision lets machines interpret images — from medical scans to self-driving cars, explained simply.
Read More Success StoriesFrom Cricket Fan to Python Developer: An Illustrative Learning Journey
This is a composite illustrative journey — based on the real paths taken by many self- taught developers — showing how a passionate cricket fan used IPL data to learn Python, pandas, and data visualisation, and landed a data analyst role in 8 months.
Read More Success StoriesFrom Finance to Full-Stack Developer: An Illustrative 10-Month Journey
This composite illustrative story follows how a chartered accountant used financial modelling skills and systematic self-study to transition into full-stack development, landing a junior developer role in 10 months without a coding bootcamp.
Read More