Snap! Build Your Own Blocks
September 17th, 2012
This has been a most amazing year.
As part of UC Berkeley’s FRABJOUS.CS project Snap development has won an NSF grant. Brian and I have been redesigning and reimplementing BYOB from the ground up, and renamed the new application Snap. The idea is to make Snap more accessible to school and college audiences by letting it run in the web browser, and by significantly speeding it up while at the same time preserving the brilliant Scratch 1.4 look and feel and extending BYOB’s additions to it.
We have been extremely fortunate in being supported by fantastic advisors, including some of my all-time CS heroes like John Maloney, Dan Ingalls, Mitch Resnick and Mark Guzdial. A personal highlight for me was having been invited to spend a few days together with Alan Kay and his group in L.A. discussing big ideas and exchanging different approaches to them. Alan had gathered many of the original PARC gang and most of the later Squeak team for this, and months later I’m still humbled and digesting all the provocative perspectives that came up there.
I’m also very pleased by our progress and by the results so far. At the moment of writing this (mid-September 2012) the current
Snap! 4.0 alpha version
already supports most of Scratch’s and BYOB’s features:
- Browser based. Snap! runs in any contemporary browser without needing to install any software or browser-plugin. Enjoy it on your iPad!
- Speed. Snap! is up to 11 times faster than BYOB 3.
- Build Your Own Blocks. Create custom commands, reporters and predicates for any category anywhere in the palette. Like variables, the scope of your custom blocks can be sprite-local or global “for all sprites”.
- Drag-and-Drop. Import any resource (picture, sound, sprite, project, blocks-module) simply by dragging it from your desktop and dropping it onto Snap! Create scripts simply by dragging and dropping blocks. Run any script or block simply by clicking on it.
- Tail-call optimized evaluator. Implement recursive loops and execute them forever without running out of memory.
- Full closures. (Anonymous) First-class procedures (lambda) and fully closurized local variables let you extend the language with your own higher order functions and arbitrary control structures, and even implement a dispatch-procedure style OOP system on top. Build your own C-shaped, E-shaped and and even multi-C slotted blocks.
- Temporary variables and formal parameters, lexically scoped.
- First-class continuations let you implement even fancier control structures, such as CATCH-THROW for non-local exit.
- First-class lists for arbitrary data structures. Snap’s lists now sport a hybrid architecture, allowing their usage both as dynamic arrays and as linked lists for recursive constant-time operations.
- Variadic inputs. Use the right-arrow to expand many input slots.
- Snap!shots. State-persistent projects. Smalltalk-style image based programming.
- Modularity. Export and share projects, sprites and block-modules as XML, costume graphics and pictures of scripts.
- Morphic. Snap! uses its own Squeak-like GUI system for the best lively user experience. Switch to development mode to look under Snap’s hood, inspect it and deconstruct it!
- Pause. Presss the pause button to suspend a running a project and inspect it’s state. Press it again to resume execution.
- Threads, events, atomicity control etc.
Part of what lets me enjoy working on Snap! so much is building it all from Scratch. Today most software isn’t really written, but merged out of more or less pre-fabricated templates and industrial frameworks along with some manual configurations and “glue code”. It’s such a blast to be able (and allowed) to instead design and code a real system using nothing but a programming language (JavaScript) and the web browser. More projects should be like this, it’s all about making Beauty and Joy of Computing intrinsic!
This summer, the charismatic Dan Garcia and my Snap colleague and co-developer Brian Harvey have been tirelessly traveling all over the U.S. (and just about all over the rest of the world) teaching teachers the Beauty and Joy of Computing, and gradually shifting from BYOB to the new Snap along the way. Again, so far the results have been very encouraging.
It really has been an exceptional year for me and for Snap. I am now working full-time on Snap, and grateful to my employer MioSoft for generously supporting this effort. There is also exciting development in the pipeline, such as taking Snap! to the Cloud.
Stay tuned!
-Jens Mönig
Do you believe in OOP? Sometimes object oriented programming seems to boil down to a religious faith, even to the point where any indication of failure gets countered by dogmas about real OOP, and how just this isn’t. One such dogma holds that a program must incarnate the trinity of inheritance, polymorphism and encapsulation to qualify as real OOP.

I love 

So, you want to define your own procedures and functions in Scratch? Build your own blocks (BYOB 
