Workshop: Create Your Own Block Language

View on Snap!Con

Presented By: Stefano Federici


Abstract:

Alternative block languages are created every day to introduce learners to computer programming by leveraging on their non-programming interests such as robotics, 3D printing, embroidery, arts. Those new programming environments are often extensions of general-purpose block languages such as Snap! or Scratch. Even if all the creators of new block languages want is often creating something very similar to Snap_!, with just some additions, creating a new Snap!_ extensions require a strong knowledge of core programming concepts and advanced programming languages such as SmallTalk, Flash or Javascript. However, thanks to Snap_!, this can be done even without creating a new extension. The Snap!’s powerful mechanism for the creation of new custom blocks allows to easily create new programming languages, the only problem being that the final user of these new environments cannot use them as easily and safely as Snap!, as the final user can freely remove or modify important elements of the environment as they do in a normal Snap!_ Project.

In this workshop, participants will learn how to build incrementally a new block language for their specific needs -from a classic C/C++/Python-style programming language to an unusual compositional language to learn foreign languages, to a minimal programming language for storytelling- by using Snap_!_ and the Snap_!_’s BloP extension. They will learn:
• how to use the powerful Snap features to
o easily create common elements of standard programming languages such as
 libraries
 namespaces
 management of type systems
 creation and use of variables
 execution stack of function calls
o create elements of unusual programming languages
o evaluate constructs in the order they need it
• how to use BloP features to
o create startup scripts that set up the whole environment at load time
o create startup scripts that reset the environment every time a program is run
o hide auxiliary elements that the user should not modify
o create a safe programming environment that cannot be modified by the final user

BloP blocks are the same block set as Snap_!’s, with just a couple of new control blocks that take care of passing the control to startup scripts and then pass it back to the programming language scripts. But BloP adds several new options to contextual menus so to allow to easily hide/lock/unhide Snap!_’s GUI elements.