GitHunt
IT

Its-Just-Nans/scratch-test-model

Library for reading the blocks of a Scratch program from a sb3 file

Documentation on GitHub Pages
100% Rust

About

The block-oriented programming language Scratch
is used by many institutions to teach beginners how programming concepts work.
The scratch-test project is planned as a way to unit-test submissions of
learners for defined exercises.

This repository contains the model for parsing Scratch files.
Other crates like the interpreter build on top of it.

Limitations

This project is assumed to be used for algorithmic exercises, so the focus is
on control structures, input, output, variables and lists.

  • Sounds, movements, colors, etc. are not planned for most components,
    but the block information about them is parsed.
  • As Scratch gives no guarantees about the execution order of parallel programs
    this project disallows them completly (affects only interpreter).
    The usage of parallelism in a file can lead to the interpreter rejecting it.
    (Just stick to a single green-flag event and you're fine.)
  • Scratch often tries to do something to avoid exceptions or fatal errors.
    Some expressions don't evaluate to a value programmers would expect based on their
    knowledge from other languages. This project tries to model them but there is still a
    chance of differences in behaviour, especially when it comes to numbers.

Languages

Rust100.0%

Contributors

Created March 7, 2026
Updated March 7, 2026
Its-Just-Nans/scratch-test-model | GitHunt