everything is programming ♪♫

Secret Project

May 06, 2015 • 2 min read • Filed under tosh

I've been reluctant to talk about this, because I start lots of projects and most of them never get finished.

But recently someone asked me about Kurt's text module (as seen in the text parser demo). And I heard someone mention (again!) using a text-based version of Scratch as an educational transition tool.

So, here goes: I'm working on a text-based editor for Scratch projects. It's called tosh. (Don't criticise! I like this name: it reminds me of a programming language like "bash" while also being slightly whimsical. Imagine a period actor saying "That's a load of tosh!" in a posh British accent.)

I think it's trendy to be pedantic about how people capitalise your project's name, so I'd like to ask you write tosh lower-case, always, if you please. In a monospace font, if you can.

tosh is not scratchblocks

I'd like to make this clear: tosh is not scratchblocks.

(If you're not familiar, scratchblocks is a plugin I wrote which is used on the forums to display screenshots of Scratch scripts: it has its own text syntax.)

At first glance, tosh and scratchblocks might sound similar: they both involve a text syntax, and have something to do with Scratch.

...which probably makes tosh a really bad choice of project! I already have enough trouble explaining the difference between kurt and scratchblocks in job interviews... clearly I should stop doing Scratch-related projects! (Unless I want to go to the MIT Media Lab and work on Scratch, I guess.)

Let me clarify the difference. The scratchblocks syntax is:

  • Designed for display. The text you write directly corresponds with how the result will look.

    This means the grammar accepts nonsensical things like say (when flag clicked). It also has features like :: category shape which allow you to specify the colour and shape of a block, which would have to be ignored when compiling to a Scratch project.

    I didn't come up with the syntax: I stole it from JSO's plugin, which I entirely re-wrote.

  • Awkward to write. You have to put brackets around every input, even inside arithmetic expressions. You even have to format menu options like [ v] to get them to look like menus. This is why tools were created to automate writing scratchblocks code.

  • Widely used. People use it on the forums, on the wiki; even the Code Club project guides use it. (I still find that really exciting.)

    So the syntax can't be changed without upsetting lots of people.

tosh has an entirely different set of principles. tosh is:

  • Designed for programming. It represents Scratch as closely as possible.
  • Easy to write.
  • Used by no-one, yet!

Design is fun

The other reason for keeping it secret was so I could avoid design-by-committee: if I'd told people about it, they might make suggestions or feature requests. Working in secret lets you decide every detail by yourself, to produce a coherent, consistent design.

This is a risk, of course. I've had very valuable contributions from my friends-from-the-internet (read: cool people from Scratch) in the past. Nathan-from-the-internet continues to make me insanely jealous of his coding skills. Kartik-from-the-internet and Connor-from-the-internet are pretty cool, too—go check out their blogs. These people and others gave invaluable advice when I was redesigning scratchblocks, for instance.

But this time, I found making the design decisions myself was fun. It's going pretty well. And I've learnt a lot doing this project.

And it meant I could ask my non-Scratch friends about it to get a fresh perspective. In particular my friend Dan provided lots of advice, especially when I was being stupid.

Now I'm planning to write a series of articles about what I learnt, and the design choices I made. It's gonna be fun to share with you!