Inspiration
It's always a fascinating challenge to build something great while working under the limitations of an outrageously unsuitable platform.
What it does
Itchy is a programming language written and developed entirely at DurHack that compiles into Scratch SB3 projects that are ready to be run out-of-the-box. It supports all the standard programming constructs, and converts them seamlessly into scratch blocks using a full compilation pipeline. We've also written a VSCode extension to allow you to write Itchy code with ease.
How we built it
The compiler is written entirely in Kotlin. It takes as its input a filepath, and returns a single .sb3 file containing a scratch project. To achieve this, the problem is broken down into many steps
- Lexing
- Parsing
- Code Generation
- Serialization
- Bundling
By far the most challenging was the Code Generation step, as it required us to really grapple with the limitations of working with a limited platform
Challenges we ran into
Since the scratch project representation is unsurprisingly quite poorly documented, we spent lots of time reverse engineering and testing many different projects to get our heads around its inner workings (including all of its fantastically janky quirks).
The other largest challenge was function return values. Although scratch allows for user created blocks, there is no mechanism for returning values from them. This meant that we had to determine our own ways of solving this issue.
Accomplishments that we're proud of
We're both really proud of sticking through with it and seeing it through to the end, despite all the obstacles.
This was also the first project I ever wrote in Kotlin, and I'm really pleased with how I was able to pick up the language and use it effectively to solve this tough challenge.
What we learned
Firstly, the scratch internal representation could really do with some polishing...
More importantly, we learnt about the functionality of compilers, the challenges of working under a tight deadline, and the benefits of helping and working with each other.
What's next for Itchy
We both hope to continue improving the language, cleaning up some of our spaghetti code, and continuing to innovate in the Scratch landscape.
Built With
- github
- gradle
- intellij-idea
- json
- kotlin
- scratch
- vscode
Log in or sign up for Devpost to join the conversation.