Bug is a stack-based programming language with a functional paradigm, developed for educational purposes.
The program written in bug language is compiled by the bug compiler (bugc
) to an intermediate bytecode and serialized to a file, then the Bug Virtual Machine (bvm
) loads the file containing the bytecode and execute.
hello.bug
fn main() void -> "Hello, world!" @write;
sum two integers
fn sum(int lhs, int rhs) int -> lhs rhs +;
fn main() void -> 34 35 @sum @write;
To use this language your can download a release for you platform or go through the source code.
- clone the repository
git clone https://github.com/edilson258/bug.git
- Compile and run a bug program
cargo run --bin bugc <some_program>.bug
cargo run --bin bvm out.bin
Now see Examples for help. Happy hacking!
Feel free to fork and play with it. PRs are welcome!💯