RocketBlocks makes it easy to program the Kerbal Operating System (kOS) autopilot for Kerbal Space Program.
RocketBlocks enables you to build sophisticated autopilots from a graphical environment. Standard programming language features are supported such as: branching, loops, variables, and functions.
The project was developed in June 2020. The source code is available on GitHub but should not be taken as an example of quality. This project was the most complex piece of software I had written and my first time writing a compiler (although I didn’t know what a compiler was at the time). Since July 2020 there have been no updates to the project, except for the addition of a Dockerfile / Docker Compose file in 2025 for archival purposes. The container images are designed to capture the project as-is and should also not be taken as standard.
Starting with the web-based Scratch graphical environment, I reverse-engineered the block format to add custom blocks. These blocks mapped to kOS instructions, like staging or setting the SAS mode. I then wrote a parser which converted the extended Scratch blocks into an intermediate language. This intermediate language is then transpiled into the kOS format.
Access it here: https://rocketblocks.prout.tech