100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

Self (language)

AdvancedLanguage2.4K learners

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

Research into prototype-based object models and delegation-based inheritance
Studying the origins of inline caching and JIT compilation techniques used in modern runtimes
Historical and academic study of dynamic language virtual machine design
Exploring live, direct-manipulation GUI concepts via the Morphic framework

Alternatives

Frequently Asked Questions

From the Blog