Snap!
A free, block-based visual programming language from UC Berkeley that extends the Scratch model with first-class procedures, lists, and continuations, bringing deep computer-science ideas to beginners
Created by Brian Harvey and Jens Mönig (University of California, Berkeley)
Snap! is a free, block-based visual programming language and online authoring environment developed at the University of California, Berkeley. Like Scratch, from which it descends, programs are built by dragging and snapping together color-coded blocks rather than typing text — but Snap! deliberately reaches far higher, adding first-class procedures, first-class lists, first-class sprites, and continuations to the friendly block interface. The result is a language a child can start using in minutes yet powerful enough to express the deep ideas of functional and object-oriented programming, from higher-order functions to recursion over recursive data structures. Its slogan, Build Your Own Blocks, captures the central idea: users can define their own blocks — including blocks that take other blocks as inputs — turning a beginner’s toy into a genuine programming language.
History & Origins
Snap! grew out of a project called BYOB (Build Your Own Blocks), begun by Jens Mönig, a developer who had been a member of the MIT Scratch Team, working with Brian Harvey, a teaching professor at UC Berkeley and longtime figure in computer-science education (and author of the Computer Science Logo Style books). BYOB was a modification of Scratch, written in Squeak (a Smalltalk-80 dialect), and its first public version, BYOB 1.0, appeared on October 21, 2008, based on Scratch 1.3.
The two collaborators shared a conviction that block languages need not be limited to simple scripts. Successive BYOB releases pushed the model steadily toward a full-fledged language: BYOB 2.0 (2009) refreshed the Scratch 1.4 base and added conveniences like Undo, and the pivotal BYOB 3.0 (2010) introduced first-class procedures and first-class lists — features drawn from Scheme and Lisp that let blocks be passed around as data and manipulated like any other value.
By 2011, the aging Scratch 1.4 codebase underlying BYOB was, according to its developers, difficult to maintain and could not run in a web browser. Around the same time the Scratch Team began building Scratch 2.0, Harvey and Mönig started a complete rewrite in JavaScript and HTML5, and renamed the project Snap!. That rewrite, released as Snap! 4.0 around 2015, dropped the desktop-only Squeak foundation entirely.
Design Philosophy
Snap! embodies a specific educational thesis: that beginners can and should encounter powerful ideas in computer science — abstraction, recursion, higher-order functions, and the treatment of code as data — from the very start, and that a visual language is no reason to water them down. Where Scratch was designed chiefly to make programming creative and accessible for children, Snap! aims to make it accessible and rigorous, serving as a serious first language for university-level courses as well as school classrooms.
Two principles follow from this:
- Everything is first-class. In Snap!, procedures (blocks), lists, and even sprites are values that can be stored in variables, passed as inputs, and returned as results. This is what makes it possible to teach the lambda calculus ideas at the heart of functional programming using nothing but blocks.
- Build your own abstractions. Rather than offering a fixed vocabulary, Snap! invites learners to define new blocks — including higher-order blocks such as
map,keep, andcombine— so the language grows with the programmer’s understanding.
Like Scratch, Snap! preserves the “low floor, high ceiling” ideal: it is easy to begin, but its ceiling is deliberately raised far higher than most block languages attempt.
Key Features
| Feature | What it provides |
|---|---|
| First-class procedures | Blocks (lambdas) can be stored in variables, passed as inputs, and returned — enabling true higher-order functions |
| First-class lists | Lists are values that can nest and be manipulated functionally; linked-list internals support recursion |
| First-class sprites | Sprites are objects that can be created, passed around, and given inheritance from a prototype |
| Custom blocks | Users define their own command and reporter blocks, the feature that gives the language its name |
| Continuations | First-class continuations expose advanced control-flow concepts to those who want them |
| JavaScript extension | Custom blocks can be written in JavaScript, and web-access primitives let projects fetch remote data |
| Browser-based | Runs entirely in the browser on the Morphic.js graphics framework, with no plugins required |
A typical Snap! program still looks approachable — scripts of stacked blocks attached to sprites on a stage, triggered by events like the green flag — but underneath, those blocks can implement recursive algorithms, manipulate higher-order functions, and process structured data in ways that resemble a functional language such as Scheme.
Evolution
Snap!’s development falls into two eras: the BYOB desktop era (2008–2011) and the browser-based Snap! era (2011–present).
- BYOB 1.0–3.1 (2008–2011) were Squeak/Smalltalk desktop applications built on the Scratch 1.x codebase, progressively adding custom blocks, first-class procedures and lists, and first-class sprites.
- Snap! 4.0 (2015) was a ground-up JavaScript/HTML5 rewrite on the Morphic.js framework — a re-creation of Squeak’s Morphic graphical model using the HTML5 canvas. This version brought first-class continuations, JavaScript-authored blocks, and web access, and freed the language from any desktop dependency. (Notably, Snap! avoided Adobe Flash, which Scratch 2.0 relied on and which reached end of life in 2020.)
- Snap! 4.1 (2017) refined the object model with first-class sprites and inheritance.
- Subsequent numbered releases have continued at a steady pace, with Snap! 11 released in 2025, adding features and library updates while keeping the environment free and open.
Current Relevance
Snap! occupies a distinctive niche: the block language of choice when educators want the friendliness of Scratch but the depth of a real programming language. Its flagship use is The Beauty and Joy of Computing (BJC), an introductory course born at UC Berkeley for non-majors and adapted into a widely used AP Computer Science Principles curriculum in the United States; by late 2014 it had reached roughly 100 New York City high schools and has since expanded well beyond.
Beyond BJC, an ecosystem of Snap!-based and Snap!-inspired tools has grown up around it: NetsBlox adds distributed computing and networking, TurtleStitch generates machine-embroidery patterns from turtle graphics, BeetleBlocks extends the idea into 3D modeling, and Snap4Arduino connects blocks to physical microcontrollers. The project sustains an annual Snap!Con conference (first held in 2019) for its community of educators and developers, and in 2020 its creators reportedly received the NTLS Educational Leadership Award, a lifetime-achievement recognition based in part on Snap!.
Why It Matters
Snap! proved that block-based programming need not be a dead end or a mere stepping stone — that the very same drag-and-drop interface a beginner finds inviting can also express the most powerful ideas in computer science. By making procedures, lists, and sprites first-class and letting users build their own abstractions, Harvey and Mönig turned the Scratch model into a vehicle for teaching functional programming, recursion, and the deep principle that code is data. In doing so, Snap! reshaped what a visual language could aspire to, and gave educators a tool that carries learners from their first snapped-together block all the way to the frontiers of computational thinking.
Sources: Snap! (programming language) — Wikipedia, Snap! 4.0 — Snap! Wiki, Snap! — Scratch Wiki, About | Snap! Build Your Own Blocks, Snap! Versions.
Timeline
Notable Uses & Legacy
The Beauty and Joy of Computing (BJC)
Snap! is the primary language of BJC, an introductory computer science course originally created at UC Berkeley for non-majors. The curriculum uses Snap! to teach abstraction, recursion, and higher-order functions before students move to text-based languages
AP Computer Science Principles
BJC with Snap! is an endorsed provider for the College Board's AP Computer Science Principles course. As of December 2014 the curriculum had been introduced in roughly 100 New York City high schools, and it has since spread to schools across the United States
NetsBlox
A Snap!-based environment from Vanderbilt University that extends the block language with distributed computing and networking, letting students build programs that communicate over the internet and access remote data services
TurtleStitch
A Snap!-derived tool that turns turtle-graphics code into machine-embroidery patterns, connecting visual programming to physical, craft-based making
BeetleBlocks
A block-based environment sharing lineage with Snap! that uses a 3D turtle (a beetle) to generate three-dimensional models for design and 3D printing
University and research teaching
Because it exposes genuine functional-programming and computer-science concepts in an approachable visual form, Snap! is used in university courses and education research as a bridge between beginner block languages and professional text-based programming