MicroBlocks: Scratch and Smalltalk-inspired MCU VM for live embedded programming
microblocks.fun
microblocks.fun
Podcast: https://kidslab.dev/2020/08/03/microblocks-with-bernat-romag...
May 2020 keynote from John Maloney: https://www.youtube.com/watch?v=Iq4fOv64CfQ
Can somebody explain why these Scratch-like GUI programming efforts always seem to invent their own language? Why not build ASTs of a "real language" with such a system, and take advantage of its ecosystem? Is there some reason why implementing drag-and-drop blocks is, at the very least, synergistic with building an entirely new VM? It seems to me that you should be able to build Lisp or Python very easily, and hence bridge the gap to "real programming".
When you start working directly with kids watching them use programming environments, though, it's often amazing how quickly things like the details of parallelism, events, sequencing, start having an impact on programs and making simple things feel 'broken'. I can quite imagine that when trying to achieve specific goals in education, the details and semantics of a language can get you into trouble. Sometimes in order to ensure kids don't get frustrated early, it's necessary to pare back some of the complexity until their understanding of computing is developed enough to bring complexity back... (have a look at https://makecode.microbit.org/device/reactive as an example of how MakeCode deals with this on the micro:bit).
Another example that comes to mind on this topic is https://stride-lang.net/ - this is very Java-derived, but as I understand it form their publications, the changes away from Java were necessary in order to allow some of the graphical/scaffolding features to work well without entering an 'uncanny valley'.
Hopefully some of the MicroBlocks team will also chime in on this though!
There's a pretty long history of virtual machines on small memory systems, going back to the days of BASIC and SWEET16. They can actually make better use of memory in some cases, with the VM byte code sort of being a compression technique versus native code.
You might want to read Mark Guzdial's blog for more on that:
> What makes GP remarkable is that it aims to be a general purpose language. John’s vision for GP is to be the language that students might move to after Scratch, with the highest possible ceilings. Think about GP as Python or Smalltalk in blocks — and even more the latter than the former. From the virtual machine (VM) on which it runs to the class browser, GP feels like a blocks-based form of Smalltalk. Because GP is VM-based, it’s portable — there are versions for Mac, Windows, iOS, and even a JavaScript implementation of the VM so that GP runs in the browser.
– https://computinged.wordpress.com/2016/06/13/introducing-gp-...
Practically speaking, the alternatives are invent your own language or boil the ocean reverse engineering the behavior of an implementation. And boiling the ocean is a constant effort because implementation based "standards" tend to change without a formal consensus process.
Since you mention Lisp and Python, these illustrate the difference. Common Lisp has a consensus standard. So does Scheme. Python does not have a consensus standard. A consensus standard process might have made the adoption of Python 3 less painful.
I'm one of the project devs. Feel free to AMA :)
To sum up what's different about MicroBlocks:
* It is blocks based.
* It is live. That means you can change scripts in real time while they're running. You can see the result of running any block in real time. You don't have to wait for any compilation/upload cycles.
* It is autonomous. You can disconnect the board at any point, and the program will keep running in it.
* It is parallel. You can run multiple tasks at the same time.
* It is portable. It runs in several boards thanks to our VM approach.
There was no language that did all these, so we made our own :)
I somehow totally missed the live aspect. That's super exciting (and impressive). And parallel!?!? A WYSIWYG parallel code editor for microcontrollers? How is that not the headline?
I'm glad I asked! This is quite interesting to me now. Thanks for your reply!
We've been basically focused on finalizing the last details before launching beta, but reworking the website is on our list of urgent tasks, possibly even before the launch, who knows!
Fructure is an example which looked promising! https://www.youtube.com/watch?v=CnbVCNIh1NA
Jens Mönig implemented keyboard input for both GP and Snap!, so the same hotkeys will work on both. Since we're using GP for the MicroBlocks GUI, the same will also work on MicroBlocks.
Regarding Teensy boards, it would have to be version >3.0, because MicroBlocks uses 32 bit instructions and needs at least 16kb of RAM. The Teensy 3.0 just about meets the requirements, and 3.1 exceeds them comfortably.
We don't yet support any M4 MCUs, but we do support a couple of M0s, so I think porting the VM to the Teensy should be fairly easy. I don't currently have one, but I see they're cheap, so I'm going to order one and try to find some time to work on the port :)
If you'd like to, we can continue the discussion over email at interest (at) microblocks (dot) fun.