An optimizing transpiler from BASIC to Mindustry Logic
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Shad Amethyst 3867ef4991
📝 Document language (renamed to minbasic), add vscode extension for syntax highlighting
9 months ago
examples 📝 Document language (renamed to minbasic), add vscode extension for syntax highlighting 9 months ago
minbasic-vscode 📝 Document language (renamed to minbasic), add vscode extension for syntax highlighting 9 months ago
src 🚚 Re-structure code 9 months ago
tests 📝 Document language (renamed to minbasic), add vscode extension for syntax highlighting 9 months ago
.gitignore 🎉 Implement tokenizer 9 months ago
Cargo.lock Clean optimizations up 9 months ago
Cargo.toml Clean optimizations up 9 months ago
GUIDE.md 📝 Document language (renamed to minbasic), add vscode extension for syntax highlighting 9 months ago
LICENSE 📝 Document language (renamed to minbasic), add vscode extension for syntax highlighting 9 months ago
README.md 📝 Document language (renamed to minbasic), add vscode extension for syntax highlighting 9 months ago

README.md

BASIC to Mindustry logic

This is a small transpiler from a dialect of the BASIC language, "MinBasic" (also known as mbas), to Mindustry's logic system (also known as mlog). Basic is chosen as the source language as it already contains jumps (which mindustry heavily relies on), while allowing for some higher-order constructs like conditions, loops and functions.

Installation and running

To use this project, start by cloning this git repository:

git clone https://git.shadamethyst.xyz/amethyst/basic-to-mindustry/
cd basic-to-mindustry

You will then need an installation of the Rust compiler, which you can quickly get from rustup.rs.

# To build the source code:
cargo build

# To run the binary:
./target/debug/basic-to-mindustry examples/prime.mbas

# You can do both of these with the following command (note the --):
cargo run -- examples/prime.mbas

VSCode syntax highlighting

Any language support extension for QuickBasic (the dialect MinBasic is based on) will work, but if you would like an extension that was tailored to support MinBasic, you can have a look at the one bundled with this project.

Language features

The GUIDE.md file describes how to write programs in MinBasic.