My programming language. A strongly typed, functional, bytecode interpreter written in Rust, with its own garbage collector. Based on the syntax and style of the languages I have liked using.
Complete with a custom linter, opinionated code-formatter, type-checker, repl, and language server.
An overview and guide to Bang can be found here.
Documentation for the standard library can be found here.
let fibonacci = n => match n
| ..2 -> 1
| n -> fibonacci(n - 1) + fibonacci(n - 2)
fibonacci(10)
More examples can be found in the /examples folder.
Bang! (v3.0.0)
My language - a strongly typed, functional, bytecode interpreter.
Usage: bang.exe <COMMAND>
Commands:
run Runs a Bang program
repl Start an interactive Read-Eval-Print Loop (REPL)
format Formats source files
lint Checks for lint warnings
typecheck Checks for type errors
print Prints debugging information
lsp Run the language server. For editors, not humans
Options:
-h, --help Print help
-V, --version Print version
# To format the codebase:
cargo fmt
# To lint the codebase:
cargo clippy
# To run the tests:
cargo test --all
# To generate the standard library docs:
cargo run -p bang-interpreter --bin stdlib-docs
# To build Bang:
cargo build --releaseI have been inspired by/ used the following guides/ projects when creating Bang.
- Crafting Interpreters by Robert Nystrom
- A prettier printer by Philip Wadler
- Ruff
- Oxc Performance Guide
- Printing Trees in Rust
- Fault Tolerant Parsing from Chevrotain
- Alkyne GC by Miguel Young de la Sota
I am no longer working on previous versions, but you can find them here:
- v2 (a slower Rust interpreter, with slightly different syntax)
- v1 (a tree walk interpreter in TypeScript)
The code in this repository is covered by the Apache License 2.0.