Snap! (programming language)
![]() The Snap! logo | |
Paradigm | object-oriented, educational, event-driven |
---|---|
Designed by | Brian Harvey and Jens Mönig |
Developer | Jens Mönig |
First appeared | 2011 |
Stable release | 7.0.2
/ December 21, 2021[1] |
Typing discipline | dynamic |
Implementation language | JavaScript (Snap!), previously Squeak (BYOB version) |
OS | Cross-platform |
License | AGPL |
Filename extensions | .xml (Snap!) |
Website | snap |
Influenced by | |
Scratch, Scheme, Logo, Smalltalk | |
Influenced | |
BeetleBlocks, Snapi, Dragme IDE, Turtlestitch |
Snap! (formerly Build Your Own Blocks or BYOB) is a free, block-based educational graphical programming language and online community aimed at students to explore, create and re-mix interactive animations, games, stories, and more, while learning about mathematical and computational ideas. While inspired by Scratch, Snap! has many advanced features. The Snap! editor, and programs created in it, are web applications that run in the browser (like Scratch 2 and 3) without requiring installation.[Note 2]
User interface[]
![](http://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Snap_4.0_Default_screen.png/420px-Snap_4.0_Default_screen.png)
In Snap!, the screen is organized in three resizable columns containing five regions: the block group selector (top of left column), the blocks palette (left column), the main area (middle column), and the stage area (top of right column) with the sprite selector (also called the sprite corral) showing sprite thumbnails below it.[Note 3]
In the interactively resizable stage area (full-screen is available, too) are drawn the graphical results (i.e. animations, graphics, etc.) of the scripts running in the script area, and/or interactively double-clicked individual blocks in any palette. Individual blocks can be dragged from the palette onto the scripts area to be associated with the selected sprite.
Category | Notes | Category | Notes | |||
---|---|---|---|---|---|---|
Motion | Moves sprites and changes angles |
Control | If statements, events, and loop structures | |||
Looks | Controls visibility, costumes, and output |
Sensing | All sprite hit detection and user input | |||
Sound | Plays audio files and programmable sequenced audio |
Operators | Mathematical and Boolean operators | |||
Pen | Allows for turtle graphics |
Variables | Variables, lists, including lists of lists |
Snap!'s blocks are divided into eight groups: Motion, Looks, Sound, Pen, Control, Sensing, Operators, and Variables. The layout of these groups in the block group selector is shown in the table below.
The central area can show scripts, costumes, or sounds associated with the selected sprite. What the main area shows depends on the selected tab.
Features[]
The most important features that Snap! offers, but Scratch does not, include:
- expressions using anonymous functions, represented by a block inside a gray ring, having one or more empty slot(s)/argument(s) that are filled by a "higher order function" (the one that is calling the anonymous one). (Their computer-science theoretical basis is First class functions, which in turn have Lambda calculus as their even more abstract, mathematical, foundation),
- lists that are first class (including lists of lists/arrays),
- First class sprites (in other words prototype-oriented instance-based classless programming),
- "Hyperblocks": functions whose natural domain is scalars (text or numbers), extended to accept lists as inputs and apply the underlying function to the scalars in the list or a sublist,
- nestable sprites,
- codification of Snap! programs to text languages such as Python, JavaScript, C, etc.
Mascot[]
Alonzo, the mascot of Snap!, bears the name of Alonzo Church, the inventor of a model of computation in which a universal lambda function, such as Iota and Jot, can create any function behavior by calling it on itself in various combinations. Because Alonzo's model is called lambda calculus, the mascot's hair is shaped as Greek letter lambda.
Special-purpose blocks (libraries)[]
Extended sets of blocks can be found in Snap! libraries, such as the 'streams' library that enables one to make a Fibonacci sequence, for example, using the special blocks ('stream', 'show stream', 'tail of stream', and 'map ( ) over stream' block) from the library.
Many other libraries are available, such as the 'list utilities' library, the 'words, sentences' library, the 'iterations' library, the 'animation' library, the 'frequency distribution' library, the 'audio computation' library, the 'bar charts' library, the 'world map' library, the 'colors and crayons' library, the 'strings and multi-line input' library, the 'parallelization' library, etc. for other special purposes.
History[]
The web-based Snap! and older desktop-based BYOB have been both developed by Jens Mönig for Windows, OS X and Linux[2] with design ideas and documentation provided by Brian Harvey[3] from University of California, Berkeley and have been used to teach "The Beauty and Joy of Computing" introductory course in computer science (CS) for non-CS-major students.[4] Jens was a member of the Scratch Team before creating Snap!.[5] BYOB is still available for downloading.
License[]
The source code of Snap! is Affero General Public License (AGPL) licensed and is hosted on GitHub.[6] The earlier, desktop-based 3.x version's code is available under a license that allows modification for only non-commercial uses and can be downloaded from the UC Berkeley website[7] or CNET's Download.com and TechTracker download page.[8][9]
Platforms[]
Snap! is implemented in JavaScript using an HTML5 Canvas application programming interface (API), and because of that it runs on the major web-browsers on Windows, iOS, OS X and Linux devices.
Recognition[]
Snap! has been recognized by the Logo Foundation,[10] and reviewed in an online magazine for programmers.[11] As of December 2014, 100 New York City (NYC) high schools will introduce University of California, Berkeley's “Beauty and Joy of Computing” as a new AP Computer Science Principles course starting in 2015, using Snap!.[12]
Notes[]
- ^ Program versions 7.0.2
- ^ BYOB, Snap! 's predecessor, was a modification of Scratch and could export projects as Windows executables.
- ^ The way pre-2.0 Scratch version's screen was organized.
References[]
- ^ "jmoenig/Snap". GitHub. Retrieved 3 January 2022.
- ^ "Scratch - Imagine, Program, Share". scratch.mit.edu. Retrieved 21 May 2017.
- ^ "HomePage for Brian Harvey (bh@cs.Berkeley.EDU)". people.eecs.berkeley.edu/~bh/. Retrieved 19 January 2019.
- ^ "UC Berkeley EECS - CS10 : The Beauty and Joy of Computing - Fall 2011". inst.eecs.berkeley.edu. Retrieved 21 May 2017.
- ^ https://forum.snap.berkeley.edu/t/relationship-with-the-scratch-team/1277/2
- ^ "jmoenig/Snap". GitHub. Retrieved 21 May 2017.
- ^ "Snap! (Build Your Own Blocks) 4.0". snap.berkeley.edu. Retrieved 21 May 2017.
- ^ CNET Download.com and CNET TechTracker's BYOB for Windows download page
- ^ CNET's Download.com and TechTracker BYOB for Mac download page
- ^ "Logo History". el.media.mit.edu. Retrieved 21 May 2017.
- ^ Editor. "Visual Language Snap! Version 4.0 Released". i-programmer.info. Retrieved 21 May 2017.
{{cite web}}
:|last=
has generic name (help) - ^ "FACT SHEET: New Commitments to Support Computer Science Education". obamawhitehouse.archives.gov. 8 December 2014. Retrieved 20 January 2019.
External links[]
- American children's websites
- Educational programming languages
- Free educational software
- Pedagogic integrated development environments
- Smalltalk programming language family
- Video game development software
- Software developer communities
- Visual programming languages