brownben / bang3

My language, a bytecode interpreter written in Rust, with formatter, linter and typechecker.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bang

My attempt at creating my own language. A strongly typed, functional, bytecode interpreter written in Rust. Based on the syntax and style of the languages I have liked using. Complete with a custom opinionated code formatter, linter, type-checker.

Examples

// Recursive Fibonacci

let fibonacci = n => match n
  | ..2 -> 1
  | n -> fibonacci(n - 1) + fibonacci(n - 2)

fibonacci(10)

A quick walkthrough of the language can be found here.

More examples can be found in the /examples folder.

Usage

Usage: bang.exe <COMMAND>

Commands:
  run        Runs a file
  format     Formats source files
  lint       Checks for lint warnings
  typecheck  Checks the file for type errors
  print      Prints debugging information
  help       Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Development

# To format the codebase:
cargo fmt

# To lint the codebase:
cargo clippy

# To run the tests:
cargo test

# To run the tests with Miri:
cargo miri test

# To build Bang:
cargo build --release

Resources

I have been inspired by/ used the following guides/ projects when creating Bang.

Looking for an older version?

I am no longer working on previous versions, but you can find them here:

License

The code in this repository is covered by the Apache License 2.0.

About

My language, a bytecode interpreter written in Rust, with formatter, linter and typechecker.

License:Apache License 2.0


Languages

Language:Rust 100.0%