Elements - a Scratch-like Smalltalk

ElementsElements 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

15 Responses to “Elements - a Scratch-like Smalltalk”

  1. Rudolf Olah Says:

    Thank you thank you! That’s really really neat.

    Could this be used with eToys?

  2. Jens Mönig Says:

    At some time during development I ported it to the Etoys image to find out if it would work, and it did. I don’t know, however, if and how you could make Elements interact with Etoys. One idea behind Elements is to find a way for Scratchers and Etoyers to almost seamlessly graduate to a “serious” programming language. So, perhaps it would be nice to provide a “door” into the underlying Smalltalk environment in Etoys and Scratch.

  3. Alan Says:

    I’m AlanProjects on scratch. Anyway thats cool! I always thought somebody should do that, make a graphic interface to a language like java, c++, or another popular language with a scratch like interface. It makes It easy….

  4. #doesNotUnderstand: » Blog Archive » links for 2009-03-06 Says:

    […] Chirp Blog » Blog Archive » Elements - a Scratch-like Smalltalk Langage visuel assez similaire à Scratch mais en utilisant la syntaxe de Smalltalk (tags: Smalltalk programming scratch component) […]

  5. Joe Hammons Says:

    I love Scratch almost as much as you! Your introduction to Elements is helpful but my learning curve for doing any programming is so steep that I would really appreciate a tutorial for Elements that would take me step by step from dragging the pieces to a complete program. Even though lists are now available in Scratch, without string manipulation, I am limited. Search for scratchRead on the Scratch site.

  6. Jens Mönig Says:

    It’s great and encouraging that you’re giving Elements a try and seem to like it! I absolutely agree with you that the current tentative prototype of Elements is not suitable for beginners, hardly so for experts. The aim of the prototype is to find out if something like a full-blown object-oriented blocks programming language is feasible at all. It came as a surprise to me that there might be less effort involved for this than I first anticipated. However, there are lots of issues on the agenda before Elements really can be used for productive programming, e.g.

    - type assertion (visually avoiding data-type errors)
    - better visualization and manipulation of class hierarchies
    - better (perhaps even context-sensitive) messages-palette
    - comments in the code
    - general user-interface improvements
    - deployment facilitation (saving/opening projects)

    I plan to experiment profoundly with all of these issues while publishing only the meaningful results :-) In the meantime please hang on for more detailed and documentation: It’s not done yet by far!

  7. Mike Thompson Says:

    Jens, you wrote:

    “Few pieces of software have inspired me the way Scratch has…”

    I’m finding this myself as well. My inspiration comes from how easy it has been for my kids (7 and 10) to understand, play and be successful with Scratch programming. Much more so than anything else I’ve found for them.

    My interests are to take Scratch in the direction of programming robotics such as the LEGO NXT Mindstorms. Despite being such a wonderful learning tool, the current programming environments for LEGOs seem to be much more geared towards serious hobbyists with some professional software experience than kids. My dream is to combine the ease of Scratch programming with versatility and sophistication of the LEGO so that kids can successfully program their creations in minutes.

    Given that getting code to run on an embedded robotics device is in many ways dramatically different than multimedia on a desktop (and in some other ways similar) I’m on the lookout for inspiration on how to best successfully combine Scratch or a Scratch-like environment with robotics. Scratch certainly seems to point the right direction, but many of the details need to be fleshed out.

    I’ll be taking a look at Elements to see if there are ideas that are applicable to the goals I have before me.

    Thanks for sharing this wonderful work.

  8. Jens Mönig Says:

    Thanks, Mike, for your enthusiasm about Scratch and Elements. You know, if you’re interested in an intuitive start into robotics for your children, you might be interested in LEGO WeDo, all the more because the upcoming Scratch 1.4. Release will have new “motor blocks” supporting WeDo.

  9. Mike Thompson Says:

    Thanks for the suggestion and the tip that Scratch 1.4 will support blocks to control WeDo. I’ve looked into WeDo, but really wasn’t particularly impressed with it when compared to capabilities of the NXT. My kids have zero problems building NXT robots, but struggle with programming NXT-G (it’s a burden even for me). The WeDo software look like a dumbed down version of NXT-G which seems to be going in the wrong direction. Knowing that Scratch will support WeDo I’ll have to look more into it again.

    For the last few weeks I’ve been creating a Scratch work-alike GUI environment, but coded in C++ (using wxWidgets for potential Win/Mac/Linux portability) rather than Smalltalk. I’m about 80% complete on the GUI elements and the results are now so close to Scratch it’s a little spooky. Not being familiar with Smalltalk, I figured it was easier for me to recreate the Scratch GUI in C++ than learn a whole new programming language/environment (I’m already doing this for other aspects of the project). Also, a C/C++ codebase will potentially give me greater flexibility when integrating with the various tools I’ll need to use to compile and download byte-code to the Arm on the NXT and other embedded processors I hope to target.

    The major issue before me is what, if any, paradigm I should present to kids for controlling robotics. With Scratch, scripting is focused around around the sprite and stage — tangible entities with concrete properties such as position, direction, color, costume, sound, etc… With robots, concrete and easy to conceptualize entities such as the sprite and stage in Scratch are harder to come by. Imagine what Scratch becomes when one takes away the stage and sprites. The mind of a robot is a bit more abstract than multimedia elements. Perhaps motors, sound output, display and sensors are easy to conceptualize physical entities that can stand-in for sprites, but I’ve come to believe this isn’t quite case. It seems that these entities instead are instruments to cause or sense change to the robots environment, akin to changing the position or color of a sprite or having the sprite play a sound. However, they aren’t a replacement for the sprite or stage with regards to serving as an anchor point for scripts.

    Anyway, lots of stuff to think about. I’ll be very interested to see how Scratch 1.4 integrates the WeDo motors and sensors into Scratch as it may provide some additional ideas on the direction I should take things. I would very much like to communicate with others tackling similar issues with robotics.

    BTW, I did download Elements and play with it, but not being familiar with Smalltalk I was a bit lost. I guess I’ll have to add Squeak/Smalltalk to my list of things to learn this summer :-).

  10. technoguyx Says:

    Seems nice, I’ll consider trying it. Although I know almost nothing about Smalltalk. :|

  11. Charles Says:

    Jens, thank you!

    When I first used scratch, I felt it’s a life changing technology, and I tried straightaway to reveal serious things it can do, but you put your finger on it exactly with this implementation.

  12. personwithoutaname Says:

    can you import these into scratch?

  13. Jens Mönig Says:

    Thank you, Charles! Coming from one of my most admired Scratchers I feel honored. Elements is still very much a work in progress, though. Currently I’m experimenting with type inferencing to hopefully come up with better ways to access the “right” elements for each blank.

  14. billyedward Says:

    Hi Jens!
    Great piece of software.
    Two questions:
    1) Did you help develop elements?
    2) What is the difference between normal and for scratch?

    Thanks.

  15. Jens Mönig Says:

    Hi, billyedward. Thanks for your interest. Yes, I wrote Elements. The “for Scratch” package contains the Scratch Source, so you can look at the Scratch Code kind of like in itself.