Squeak
Squeak is a modern, open-source implementation of the Smalltalk programming language and environment, designed as a full-featured system for object-oriented development with an emphasis on live programming, where code can be edited and executed interactively in real time.[1] It features a virtual machine written largely in Smalltalk itself for high portability across major platforms, including Windows, macOS, Linux, and even web browsers via emulators like SqueakJS.[2] The system includes the Morphic user interface framework, which enables the creation of interactive, graphical applications using "morphs"—tangible, scriptable objects that respond to user input.[1] Squeak originated in 1995 when a team led by Dan Ingalls and Alan Kay, building on their earlier work at Xerox PARC, began developing it at Apple Computer as a portable evolution of Smalltalk-80.[2] The project aimed to create a self-contained system with a Smalltalk-based virtual machine translated to C using a tool called Slang, achieving a first functional version in just seven weeks and a complete C-based VM in ten.[2] Released publicly in 1996 under an open-source license approved by Apple, Squeak quickly gained traction for its compact footprint (under 1 MB initially) and support for advanced features like just-in-time compilation, real-time sound and animation, and efficient garbage collection.[2] Key early contributors included John Maloney, who developed Slang; Ted Kaehler, who handled the memory system; and Scott Wallace, who implemented file support.[2] Over its evolution, Squeak has become a cornerstone for educational tools, research prototypes, and multimedia applications.[1] Notable derivatives and projects include Etoys, a tile-based programming environment for children that popularized Morphic's "halos" for object manipulation; Scratch, a visual programming language for kids initially built on Squeak; and Croquet, a framework for collaborative 3D virtual worlds.[2] It has influenced modern Smalltalk variants like Pharo and continues active development, with the latest stable release being version 6.0 in 2023, supported by a community-driven oversight board and resources like the Squeak Swiki.[1] Squeak's design philosophy—rooted in Smalltalk's pure object model where everything collaborates via message passing—has made it influential in advancing dynamic languages, user interface innovation, and accessible computing paradigms.[2]History
Origins and Early Development
Squeak originated as a derivative of Smalltalk-80 in late 1995 at Apple Computer's Advanced Technology Group (ATG), where a team of developers sought to revitalize the language for modern computing environments. The core team included Dan Ingalls, Alan Kay, Ted Kaehler, John Maloney, and Scott Wallace, many of whom had contributed to the original Smalltalk systems at Xerox PARC decades earlier.[3] Leveraging Apple's port of Smalltalk-80, they began by simulating a reference interpreter in Smalltalk itself, achieving a functional virtual machine in seven weeks, followed by a complete C-based VM in ten weeks. This effort marked Squeak's foundation as a fully object-oriented system written predominantly in Smalltalk, emphasizing introspection and extensibility from its inception. The primary motivations for Squeak's development centered on creating a highly portable, self-contained Smalltalk implementation that could run on diverse platforms without heavy reliance on platform-specific C code, while facilitating easy debugging and user modifications. The team aimed to produce a compact system suitable for resource-constrained devices like PDAs and internet appliances, where download times and computational limits demanded efficiency. By authoring the virtual machine in Smalltalk and translating it to C only for deployment, they enabled the entire system—including runtime and development tools—to be inspected and altered directly in the language, fostering an environment for experimentation and educational use. This approach addressed Smalltalk-80's limitations in portability and openness, positioning Squeak as a practical tool for multimedia and learning applications.[3] In 1996, following the initial implementation at Apple, the Squeak team transitioned to Walt Disney Imagineering, where development continued with a focus on multimedia enhancements and educational software. At Disney, the project benefited from resources dedicated to creative technologies, allowing integration of features like color graphics, sound, and networking to support interactive applications for children and non-technical users. This move aligned with broader goals of deploying Squeak in immersive, story-driven contexts, while maintaining its open-source ethos under Apple's licensing approval.[4]Key Milestones and Releases
Squeak was initially released as open source in 1996 under Apple's Squeak License, which permitted modification and redistribution of the source code, thereby enabling widespread community involvement and contributions.[5] After transitioning from development at Apple to the Walt Disney Company, the Squeak Central team was established in 1997 to coordinate ongoing work, culminating in the first public version, Squeak 1.0, that same year.[6] A pivotal milestone occurred at OOPSLA '97 with the publication of the paper "Back to the Future: The Story of Squeak, A Practical Smalltalk Written in Itself" by Dan Ingalls, Ted Kaehler, John Maloney, Scott Wallace, and Alan Kay, which detailed the innovative self-contained virtual machine implemented in Smalltalk itself.[7] Subsequent key releases advanced Squeak's capabilities: version 3.0 in July 2001 integrated Etoys, a visual scripting system for educational applications, expanding its appeal in learning environments.[8][9] Squeak 4.0, released in 2010, incorporated significant virtual machine enhancements, including the Cog just-in-time compiler for improved performance and portability across platforms.[10] In 2015, Squeak 5.0 introduced the Spur memory manager, offering better object allocation and garbage collection efficiency, while complementary efforts like SqueakJS—launched in 2014—enabled full Squeak execution directly in web browsers via JavaScript.[11][12] The most recent major release, Squeak 6.0 in July 2022, provided native support for high-resolution displays on all platforms and enhanced integration with modern source control tools such as Git via packages like Tonel.[8] As of November 2025, Squeak continues active maintenance through the Squeak.org community, with SqueakJS receiving updates like version 1.3 in March 2025 to ensure seamless compatibility with contemporary web standards and devices.[1][12]Technical Features
Language and Programming Model
Squeak is a purely object-oriented, class-based programming language descended from Smalltalk, in which every value is an object and all computation occurs through message passing between objects.[13] It supports single inheritance, where classes form a hierarchy rooted at the class Object, and dynamic typing, meaning no explicit type declarations are required for variables or method arguments.[13] Objects encapsulate state and behavior, with methods defining responses to messages, enabling polymorphism as the same message can elicit different behaviors depending on the receiver's class.[14] A hallmark of Squeak's design is its extensive reflective capabilities, allowing objects to inspect and modify their own structure and behavior at runtime. Metaclasses, which are instances of Class and themselves classes, enable introspection of class definitions, such as querying instance variables viainstVarNames.[13] Developers can dynamically recompile methods using the compile: message sent to a class or metaclass, altering system behavior without restarting the environment; for example, overriding a method in Behavior allows customization of compilation itself.[15] The pseudovariable thisContext provides access to the current execution stack, facilitating advanced reflection like custom debugging or context manipulation.[16]
Squeak's syntax emphasizes simplicity and expressiveness through message passing, with three main forms: unary messages (e.g., 89 sin), binary messages (e.g., 3 + 4, which sends the #plus: message to the object 3 with argument 4), and keyword messages (e.g., Color r: 1 g: 0 b: 0).[16] Blocks, defined using square brackets (e.g., [:x | x + 2] value: 3 evaluates to 5), serve as closures that capture their lexical environment and support deferred execution, often used for callbacks or iteration.[13] Collections form a core data structure category, including fixed-size Arrays (e.g., #(1 2 3)), dynamic OrderedCollections, and Sets, with iterator methods like do:, collect:, and select: enabling functional-style operations (e.g., #(15 10) collect: [:i | i odd] returns #(true false)).[13]
Compared to Smalltalk-80, Squeak introduces enhancements for modern use cases, including native Unicode support through WideString and character objects, true 64-bit integer arithmetic via the LargeInteger class for values exceeding 32-bit limits, and a streamlined exception handling mechanism based on an Exception hierarchy with handlers using blocks (e.g., do: [:each | ...] ifAbsent: [...]).[17] These extensions maintain backward compatibility while addressing limitations in internationalization, numerical precision, and error recovery.[17]
The programming model in Squeak revolves around a live coding environment that provides immediate feedback, where methods are compiled and installed on-the-fly without a separate compilation step during development.[3] Changes to code take effect instantly in the running system, supported by tools like inspectors and debuggers that allow pausing execution to edit and recompile methods directly.[13] This malleable approach fosters exploratory programming, with the entire system—including the compiler and virtual machine primitives—implemented in Smalltalk itself, enabling full introspection and modification.[18]
Virtual Machine and Portability
Squeak's virtual machine (VM) is implemented entirely in Smalltalk using a dialect called Slang, a subset designed for straightforward translation to C code without initial dependencies on external C libraries.[19] This self-contained approach, facilitated by the VMMaker tool, allows the VM to be generated and compiled for native execution on various platforms, including the Cog just-in-time (JIT) compiler variant, which enhances runtime performance through dynamic code generation.[19] The architecture centers on a StackInterpreter that processes bytecode via an interpreter loop, managing execution contexts on the stack to support features like closures.[20] Central to the VM's design is its object memory system, which handles allocation and deallocation of objects in a segmented heap under the Spur memory manager, introduced to replace the earlier linear heap model.[20] Garbage collection employs an incremental compactor that minimizes pauses, using techniques such as pointer reversal in older versions and more efficient scavenging in Spur to reclaim unused memory while supporting pinned and read-only objects.[20] For performance, the Cog VM integrates JIT compilation, translating frequently executed bytecode methods into machine code, achieving speedups of 10 to 20 times over the baseline interpreter for pure Smalltalk code.[21] Portability is a core strength, with the VM running on Windows (x64), macOS, and Linux (x64 and ARMv8) through platform-specific builds generated from the unified Smalltalk source.[22] Squeak supports both 32-bit and 64-bit images, with 64-bit providing expanded address space and optimized integer handling.[17] Additionally, SqueakJS provides a JavaScript-based emulator that executes unmodified Squeak images directly in web browsers, extending compatibility to any HTML5-capable device without recompilation.[12] Key innovations include the BitBlt primitive for efficient graphics operations, such as bit-block transfers with logical combinations for rendering, implemented as a low-level primitive to accelerate 2D visuals.[23] Image persistence relies on file-in and file-out mechanisms, which serialize the entire object memory to disk files, enabling seamless transfer and resumption across hardware platforms.[24] As of 2025, the Cog VM continues to see optimizations through projects like Sista, an adaptive JIT architecture that persists runtime optimizations across sessions, approaching near-native execution speeds for Smalltalk workloads while maintaining the system's malleability.[25]User Interfaces
Morphic Framework
Morphic is the primary user interface framework in Squeak, providing a declarative, prototype-based system for constructing interactive graphical interfaces through live objects known as morphs.[26] These morphs serve as the fundamental building blocks, each representing a tangible graphical element that can be manipulated, animated, and composed hierarchically to form complex user interfaces.[26] Unlike traditional model-view-controller paradigms, Morphic emphasizes direct manipulation, allowing users to interact with objects as if they were physical entities, with the framework automatically managing display updates, event dispatching, and layout.[27][26] At its core, Morphic operates on a world canvas represented by the global[World](/page/World) object, a specialized PasteUpMorph that serves as the root container for all visible elements on the screen.[26] Morphs form hierarchical trees, where parent morphs (composites) contain submorphs, enabling nested structures for building UIs; for instance, a button morph might contain text and border submorphs.[26] Event handling occurs through message sends triggered by user inputs, such as mouse or keyboard events captured by the HandMorph (representing the cursor), which dispatches them to the appropriate morph without requiring explicit wiring.[26] Dynamic layouts are supported via tiling mechanisms, like TableLayoutMorph, which automatically arrange submorphs in grids or flows, adapting to resizes and content changes for responsive designs.[26]
Key features of Morphic include direct manipulation capabilities, exemplified by drag-and-drop operations for scripting and repositioning elements, which foster intuitive interaction and rapid prototyping.[26] It supports infinite zoom through scalable transformations on the world canvas, allowing users to navigate vast virtual spaces seamlessly.[26] Morphic integrates closely with Etoys, Squeak's visual programming environment, where morphs become "players" that can be scripted via drag-and-drop tiles, enabling non-programmers to add behaviors like animation or event responses without code.[9] Halos—floating menus around selected morphs—facilitate editing actions like resizing, rotating, or debugging, enhancing the framework's liveliness.[26]
Morphic originated from the Self programming environment, co-developed by John Maloney and Randy Smith at Sun Microsystems Laboratories, and was adapted for Squeak by Maloney and Dan Ingalls, debuting in version 1.22 around 1998.[28] Subsequent refinements have focused on improving event handling, layout algorithms, and compatibility, evolving it into a robust foundation for Squeak's desktop and applications.[28]
The framework's advantages lie in its prototype-based approach, where new interfaces are built by cloning and modifying existing morphs, promoting exploratory development and accessibility for non-programmers through composition rather than imperative coding.[26] This uniformity—treating all UI elements as live, responsive objects—reduces complexity and encourages innovative, interactive designs.[26]