May 10th, 2010
Scratch is a fantastic first programming language. And afterwards kids go on to study C and Java, right? Think again.
Is Scratch’s brilliance really all about programming? Can the Scratch experience be reduced to events, threads, conditionals, loops and variables? What about expressing ideas, imagining activities and reflecting results? What about researching, discussing and remixing? Participating? I love Scratch, because it makes such abstract concepts come to life. To me, Scratch’s biggest gift is that it lets kids create. And share. Produce. Plus, Scratch is intrinsically fun and gratifying. But it’s not easy. Let me repeat that slowly: Scratch. is. *not*. easy. Ever tried to impress someone with an interactive presentation? Ever had to invent your own user interface framework? These things are hard. Resources have to be organized, goals must be evaluated, steps need to be carefully layed out. The Latin word is programmare. Programming. Programming helps organizing hard stuff.
Or does it? How often did silly syntax get in your way, did enigmatic grammar force detours on you? I also love Scratch because it liberates programming from this sort of bigheadedness. Scratch lets kids focus on the hard stuff without imposing silly rituals. More programming languages should be like this.
Why not stay with Scratch?
Until now Scratch had a hard ceiling. You could do amazing projects with Scratch, but you would bump into that ceiling soon enough. It doesn’t have to be this way. Last summer two Berkeley CS instructors (Brian Harvey and Dan Garcia) asked me for a version of my experimental BYOB software which they could use in a new undergraduate pilot course named “The Beauty and Joy of Computing”. As that course unfolded, Brian Harvey (easily one of the world’s best programming teachers), involved me in a discussion about first class procedures. Together we began experimenting with enhancing BYOB little by little, and by late fall we suddenly realized that we were inventing a new graphical programming language. Only we weren’t. It’s still Scratch. We just added less than a dozen new blocks, re-wired some things under Scratch’s hood and tweaked the GUI a little. What’s more, we didn’t even invent these new blocks ourselves, we took them from the Scheme dialect of the LISP programming language.
But see for yourself what it lets Scratch do now:
BYOB 2.99 is an alpha test version for the new BYOB 3, which is scheduled for release this August.
Highlights:
- new Reference Manual with lots of examples and tutorials by Brian
- Tools library of higher-order-functions (also by Brian)
- lambda, including full closures (anonymous custom blocks)
- anonymous dynamic lists
- lists of lists
- global and local procedures
- SICP style OOP
- state-persistent projects, Smalltalk-style image based programming
plus all the goodies of previous versions:
- custom blocks “build your own blocks” (from v.1)
- sprite aggregation “nested sprites” (from v.2)
- inspect the underlying primitive code in the Elements visualisation
- share projects as windows .exe
- open or import any Scratch project/sprite
Enjoy!
-Jens Mönig
Posted in Uncategorized | 6 Comments »
February 8th, 2010
I love Morphic. Contrary to many I believe Morphic is what sets Squeak apart from any other programming environment. It’s cool that Squeak is based on Smalltalk, but it’s Morphic that makes it great!
I’ve long since wanted to try building a blocks-based programming environment for Python. So I started by implementing a small Morphic port. It’s very basic and straightforward, doesn’t use any of Python’s advanced features, and implements only the barest of Morphic’s: It’s a simple, single-world, single-hand environment with just the minimum GUI-elements to start building something more complex. It’s also unfinished, because in the meantime I have been sort of pulled back into developing BYOB further (hang on for more).
What’s unique about Morphic? Three things:
- It’s a programming language independent mechanism for modelling concurrency. You don’t have to use native threads and processes in order to create lively, interactive applications. Just look at Scratch!
- It doesn’t use any OS-native widgets. You get to do what you really want, not what some industry standard thinks is cool. Again, take a look at Scratch!
- It’s easily portable. Okay, this is really the essence of the first two points: Because you neither use Smalltalk processes nor Smalltalk’s dependent-update mechanism, nor any OS-specific widgets, your application can easily be ported to both any other programming language as well as any other OS.
On the technical side, my little Morphic implementation uses the - awesome - PyGame library for primitives. To get an impression, please feel free to download the module morphic.py, and run it with Python 3.1.1 and PyGame 1.9.1. I’m aware that it looks and feels a lot like Squeak, it’s supposed to be that way :-).
You’re invited to use and modify / complete it any way you wish!
-Jens Mönig
Posted in Uncategorized | 2 Comments »
August 30th, 2009
BYOB 2.0 is here for you to download. I’m surprised and a bit scared about the enthusiastic reception of the my little build-your-own-block experiment for Scratch. I never intended BYOB to be actually used in highschool classrooms and university courses in different parts of the world.
It also feels wonderful! I have been getting excellent suggestions from very bright people, and the idea to gradually distill class-like constructs out of Scratch and turn BYOB into a CS intro environment has got me hooked (and slightly overwhelmed, too).
So I decided to share only those experiments I feel confident about, even if the whole of them doesn’t yet go all the way towards that starry goal. In BYOB 2.0 I resisted the urge to add new blocks, focusing instead on improving the experience to let you create your own ones, and on introducing compositional object relationships to Scratch. Still, please expect to encounter many bugs.
What’s new in BYOB 2.0:
custom blocks (functional recursion)
- now have all Scratch 1.4 features (esp. string functions)
- can open / import any Scratch project (also older ones)
- arguments now take both numerical and text input (and reporters)
- double click on a custom reporter block to show its result
- fixed the block editor’s answer field to improve drag & drop
- new debugging functions (error blocks are displayed red)
- fixed escaping out of infinite atomic loops (thanks to Brian Harvey for catching this!)
- the block editor now is resizable (thanks to Dan Garcia for suggesting this!)
nestable sprites (structural recursion)
- you can now create composite sprites (made out of subsprites)
- sprites can be nested infinitely, making them “parts” of more complex simulations
- subsprites follow their owner’s motion, heading, resizing and graphical effects, and serve as their owner’s extended sensors
- subsprites can be set to follow their owner’s rotation, or to rotate independently
other
- you can now share sprites (also nested ones) in a mesh network
- built-in compiler lets you convert any Scratch/BYOB project into an .exe
- autoscrolling
- scrolling by dragging
- undo (!) - Why didn’t I think of this before…
Elements - blocks of code all the way down to the VM
- you can now inspect (and awkwardly edit) any non-custom standard Scratch block in my experimental Elements for Smalltalk GUI. This is a taste of Zukunftsmusik…
Smalltalk has helped
BYOB’s new nestable sprites feature was not nearly as difficult to implement as I first expected, because Smalltalk has helped. A central problem was to recursively propagate the owner sprite’s settings to all of its subsprites whenever they are changed. This is about navigating down an ordered tree towards its leaf nodes and basically trivial. What’s tedious about it is that you have to add additional methods for each and every possible modification of any node, which is not exactly “copy & paste” but nonetheless repetitive and boring stuff. Here Smalltalk’s meta-programming capabilities allowed me to write a single simple method instead managing that task for any context:
spread
“private - apply the method calling me to all subsprites”
| sel args |
subsprites isEmpty ifTrue: [^self].
sel _ thisContext sender method selector.
args _ OrderedCollection new.
1 to: thisContext sender method numArgs do: [:idx |
args add: (thisContext sender tempAt: idx) ].
subsprites do: [:eachPart |
args isEmpty
ifTrue: [ eachPart perform: sel]
ifFalse: [ eachPart perform: sel withArguments: args asArray]]
A simple, consistent syntax is worth more than abundant libraries. Gotta love languages for the lazy!
Enjoy!
-Jens Mönig
Posted in Uncategorized | 12 Comments »
March 5th, 2009
Elements is a new graphical user interface for the Smalltalk-80 programming language inspired by MIT’s Scratch (http://scratch.mit.edu). Like Scratch, Elements offers draggable “bricks” of code, which can be accumulated and assembled LEGO-wise into complex programming constructs, rather than entering text through a keyboard. The Elements project wants to find out, if and how Scratch’s design can be applied not only to educational microworlds, but also to a full-fledged professional, object-oriented programming environment. As a proof-of-concept study I’m supplying both a minimal programming environment to start with, as well as a version of the Scratch Source Code Squeak environment which strives to be completely malleable by means of these Elements, thereby implementing Scratch quasi in itself.
Few pieces of software have inspired me the way Scratch has, with the possible exception of the Smalltalk programming language and the Morphic user-interface paradigm. In fact, I have come to love Scratch so much that I want everything to look and feel like Scratch. If such blissful narrow-mindedness turns you off, don’t even bother reading any further, let alone downloading these demos. I also enjoy the nerdy delight coming out of manipulating something by means of itself. By letting Elements plug into Squeak’s compiler/decompiler structure Elements can be modified and enhanced through itself.
If you’re curious, you can download the prototype here:
This first version of Elements is a tentative experimental prototype, comparable to a novel’s first draft. I’d like to use this prototype to gather experience and feedback for a more refined and mature design, and for a better and more stable GUI. Most, if not all of Smalltalk’s compiler nodes can be decompiled into syntax elements, with the exception of certain Squeak-specific constructs, such as BraceNodes (Arrays within {}).
Credits
Elements is completely inspired by and based in essential parts on the fantastic and brilliant work of the MIT Media-Lab’s Scratch-team, encouraged by their willingness to share ideas, designs, code, and enthusiasm.
Thank you, John, Evelyn, Mitchel, Natalie, Andrés and Eric!
Enjoy!
-Jens Mönig
Posted in Uncategorized | 15 Comments »
October 21st, 2008
So, you want to define your own procedures and functions in Scratch? Build your own blocks (BYOB
)?
You might as well try this new experimental prototype I have been developing over the last weeks. You can download and read through an overview (pdf), or download the whole application (including the overview) and start playing with it right away.
This prototype lets you build your own custom blocks in Scratch using the standard Scratch blocks, as well as other blocks you defined elsewhere. You can create your own command blocks (procedures) and reporter blocks (functions), both regular (”round”) and boolean (”diamond”). You can specify for each block to be atomic (run at the speed of a single block) or interleafed. Your custom blocks are defined for each sprite and can be shared among projects together with the sprite they were created for. Oh, and you can even use a block within itself (recursion).
This prototype is very, very, experimental, so be prepared to encounter lots of bugs. I’d be very interested in feedback about your experiences and insights.
Enjoy!
-Jens
Posted in Uncategorized | 42 Comments »
May 7th, 2008
I have been experimenting with lists and files in Scratch and built a little prototype. I have documented my proposal and the prototpye in a short pdf (well it’s not really short, but it’s mostly screenshots) which can be accessed from here:
http://chirp.scratchr.org/dl/Lists and Files for Scratch.pdf.
The prototype itself along with this documentation, some demo projects and a compiler (!) can be obtained from this link:
http://chirp.scratchr.org/dl/Lists and Files for Scratch.zip.
This fully functional prototype is deployed as a stand-alone application. I might eventually merge it with Chirp if future versions of Scratch will not feature someting similar.
Posted in Uncategorized | 19 Comments »
May 6th, 2008
So, how do you write software for grown-ups?
The part I like best about MIT Media Lab’s Lifelong Kindergarten Group is lifelong. Hey, life is supposed to go on after graduating from elementary school, and some of us even grew up, sort of. But we still love our sandboxes, crayons and bricks, don’t we? And sometimes I get that nagging feeling that pencils and paper used to be way more powerful, intuitive and inspiring back then than all those expensive gadgets and gimmicks they made me pick up along the way to adulthood.
When they asked Russian playwright Maxim Gorky how to write books for children, he supposedly replied: “The same as for adults, only better”. That non-descriptive quote has been abused all over the internet and in probably every second essay about anything educational. It’s good for a quick smile but leaves you wondering about the consequence: Will I really have to make up with increasingly mediocre prose for the rest of my days?
These questions in part reflect how I feel about Scratch. You may not be able to actually do much with it, but creating a Scratch project is an eye-opening experience every time. Because you’re being productive in a way you probably haven’t been since you forgot about those crayons in your old childhood drawer.
That spectacular productivity makes up for a lot of constraints in Scratch. Some of Scratch’s limitations may be based on educational design, others are probably the result of needing to stay compatible with the online version. But to imagine gradually freeing Scratch from such self-imposed bounds makes my mind reel and my mouth water. And I’m not dreaming about “prototyping”, not having “toys” in mind. I’m after the real thing.
My motivation behind Chirp is primarily a playful one: To experiment with the Scratch Source Code. But sometimes it goes beyond: Let’s not accept mediocre software anymore! Let’s program like kids again!
Gimme back my crayons, now …
Posted in Uncategorized | 3 Comments »
March 14th, 2008
I have uploaded a little experimental prototype of a utility that lets you turn a Scratch Project into a “stand-alone” executable for Windows. You can get it from the download page.
Urgent demand for something like this has been expressed for a long time by many members of the Scratch community in the Scratch Forums. I don’t really know what’s behind all this. It seems that many children (and adults) feel that they’re not really programming, as long as they can’t make an exe out of their work. Others seem to be so proud of their creations, that they want to “hide the code” at all costs, lest others find out about their intellectual “secret weapons” and “copy” them. Another user group in seemingly dire need to hide code can be found among educators. There seems to be a didactical necessity for students to recreate a teacher’s example on their own, without knowing how the teacher did it…
I find these motivations - to put it mildly - questionable and technically ridiculous. But then, if being able to make an exe is all that it takes to turn people on to programming in Scratch and make the community grow, then give these people what they want, “panem et circenses”.
The technical details of my “fake” compiler are as of now too trivial to discuss, but what did you expect, being able to translate Scratch projects into assembler?
Posted in Uncategorized | 22 Comments »
March 11th, 2008
I have just updated Chirp with the following three new features:
- Whenever you directly run a project in presentation mode (using the “presentation” command line option) and press the return-button, Chirp will exit back to the OS (and not switch to development mode).
- If you start Chirp with the “presentation” command line argument without specifying a Scratch project, it will run a random project from the Scratch-projects folder. If that folder is empty Chirp will start in development mode instead.
- Building on these modifications I have written a tiny Windows screensaver (Chirp.scr) which plugs into the Windows screensaver list and thereby lets you use your own Scratch projects as Windows screensavers.
You can upgrade to the current version by downloading the Windows installer and installing it over your current Chirp installation (no need to uninstall Chirp first).
I have tested the Screensaver under Windows XP and ME. I would be grateful if someone could test it under Vista and tell me if it works.
Posted in Uncategorized | 3 Comments »
March 4th, 2008
Chirp is a slightly modified experimental version of the MIT-Scratch development environment based on the publicly accessible Scratch Source Code. Chirp aims to stay fully compatible with Scratch and with the Scratch website, while allowing to follow up on suggestions and ideas arising out of discussions among the Scratch community.

Currently Chirp is my personal project, but I welcome any contributions from the community, be it Squeak changesets, Scratch skins or other graphics (logos, icons, screenshots, whatever). I will use this blog to announce any future updates.
Posted in Uncategorized | 11 Comments »