now in rust!
Scratchnative is an ongoing project to compile Scratch3 programs to native executables.
Here's how Scratchnative is able to compile Scratch3 projects:
- It serializes the
project.json
file contained in the.sb3
Scratch file (which is a zip) using serde - It builds an abstract syntax tree (AST) akin to any programming language's AST
- It outputs C++ code by iterating through the AST
Eventually, I will write documentation on the project.json
file format as the current docs are quite vague and unclear.
Right now, Scratchnative is able to compile very basic Scratch3 projects (e.g basic operators, loops and expressions), albeit without graphics, to C++ with the help of a runtime.