Snap! (programming language) facts for kids
| Paradigm | object-oriented, educational, event-driven |
|---|---|
| Designed by | Brian Harvey and Jens Mönig |
| Developer | Jens Mönig |
| First appeared | 2011 |
| Stable release |
10.7.2 / May 5, 2025
|
| Typing discipline | dynamic |
| Implementation language | Morphic.js (written in JavaScript); |
| OS | Cross-platform |
| License | AGPL |
| Filename extensions | .xml (Snap!) |
| Influenced by | |
| Scratch, Scheme, Logo, Smalltalk, APL | |
| Influenced | |
| Scratch, BeetleBlocks, NetsBlox, Dragme IDE, Turtlestitch | |
Snap! is a free and fun programming language that uses colorful blocks to create computer programs. It's designed for learning and lets you make interactive animations, games, stories, and much more! You can explore cool ideas about math and how computers work.
Snap! was inspired by Scratch, another popular block-based language. However, Snap! has many extra powerful features. You can use Snap! right in your web browser, just like Scratch, without needing to install anything on your computer. It's built using a special system called Morphic.js, which helps it run smoothly in your browser.
Contents
Exploring the Snap! Interface
When you open Snap!, you'll see three main sections on your screen. These sections can be resized to fit your needs.
- The left column has the block group selector at the top and the blocks palette below it. This is where you find all the different command blocks.
- The middle column is the main area where you build your programs. This is called the script area.
- The right column shows your project come to life! This is the stage area. Below the stage, you'll see small pictures of your characters, called sprites. This is the sprite selector.
You can drag blocks from the palette into the script area. When you run your program, the results appear on the stage. You can also double-click individual blocks to see what they do right away!
| Category | What it does | Category | What it does | ||
|---|---|---|---|---|---|
| Motion | Moves and turns your sprites | Control | Helps with "if" statements, loops, and events | ||
| Looks | Changes how sprites appear, their costumes, and what they say | Sensing | Detects when sprites touch or gets input from you | ||
| Sound | Plays sounds and music | Operators | For math, text, and true/false questions; also for making custom blocks | ||
| Pen | Lets sprites draw or stamp on the stage | Variables | Stores information, like numbers or lists | ||
Snap!'s blocks are organized into eight colorful groups. These groups help you find the right commands for your projects. The table above shows what each group is for.
The central area can also show costumes, backdrops, or sounds for your selected sprite. This changes depending on which tab you click.
Powerful Features of Snap!
Snap! offers many advanced tools that make it very powerful for learning computer science. Here are some of its cool features:
- Custom Blocks Inside Blocks: You can create special blocks that act like mini-programs. These can even be used as inputs for other blocks, making your code very flexible.
- Smart Lists: In Snap!, lists are super flexible. They can hold not just numbers or words, but also other lists, or even blocks! This lets you organize information in many creative ways.
- Sprites as Building Blocks: You can treat sprites like special objects that can be easily copied, changed, and used to create new sprites. This is a powerful way to build complex projects.
- Hyperblocks for Quick Actions: Imagine a block that can do the same thing to many items in a list all at once. That's what Hyperblocks do! They save you time by working on entire lists automatically.
- Making Your Own Tools: Snap! lets you create very advanced custom blocks. You can even make blocks that change how other blocks work! This is like building your own special tools for programming.
- Converting Code: You can even turn your Snap! programs into text-based code for other languages like Python or JavaScript. This helps you see how block-based code translates to text code.
Meet Alonzo, the Mascot
The friendly mascot of Snap! is named Alonzo. He looks a bit like Gobo from Scratch, and the Scratch Team gave permission for his design. Alonzo is named after Alonzo Church, a very important person in computer science. His hair is shaped like the Greek letter lambda, which is a symbol related to some advanced programming ideas.
Adding More Tools with Libraries
Snap! has many extra sets of blocks called libraries. These libraries add special tools for different kinds of projects.
For example, the 'streams' library lets you work with endless sequences of numbers, like the Fibonacci sequence. There are many other libraries too, such as ones for lists, words, animations, sounds, drawing charts, and even world maps! These libraries help you do even more amazing things with your programs.
Things Snap! Doesn't Do (Yet!)
While Snap! is very powerful, there are a few things it doesn't do directly:
- No Built-in Cloud Variables: Unlike some other platforms, Snap! doesn't have a way to easily save variables online that multiple users can share.
- File Upload Limit: If you want to upload files to the Snap! Cloud, there's a size limit of 10 megabytes.
- JavaScript Block: There's a special block that lets you use JavaScript code. However, it's an advanced feature and only works when you're actively using the editor.
The Story of Snap!
Snap! was created by Jens Mönig, with design ideas and help from Brian Harvey, a professor at the University of California, Berkeley. Jens was actually part of the Scratch Team before he started working on Snap!.
Snap! and its older version, BYOB, were made to help students learn about computer science in a fun way. They were used in a popular course called "The Beauty and Joy of Computing" for students who weren't planning to become computer scientists.
How Snap! is Licensed
The rules for using Snap! are set by its license'. Snap!s source code is available under the GNU Affero General Public License (AGPL). This means it's free to use, share, and change, even for commercial projects, as long as you share your changes under the same license. The code is hosted on GitHub, a popular place for developers to share their projects.
Where You Can Use Snap!
Snap! is a cross-platform tool, which means it works on many different devices and operating systems. You can use it on computers running Windows, iOS, MacOS, and Linux.
It works well in most modern web browsers, including:
- Firefox
- Chrome (and many other browsers based on Chromium)
- Opera GX
- Microsoft Edge
- Safari
How Snap! Works Behind the Scenes
Snap! is a web application. This means it runs in your internet browser. It's built using JavaScript, a common language for websites, and a special graphical system called Morphic.js.
Morphic.js helps create everything you see in Snap!, like buttons, sliders, menus, and even the text. It uses an HTML5 Canvas, which is like a drawing board inside your web browser. This allows Snap! to draw all its colorful blocks and sprites directly on the screen.
Snap!'s Recognition
Snap! has received praise from various groups, including the Logo Foundation. It has also been featured in online magazines for programmers.
By December 2014, 100 high schools in New York City started using Snap! to teach a new computer science course called "AP Computer Science Principles." Jens Mönig and Brian Harvey also received a special award in 2020 for their lifetime achievements in educational leadership, partly because of their work on Snap!.