B Programming Language
Warning Compiler is not fully implemented yet.
Logo by Strawberry 🍓
Compiler for the B Programming Language implemented in Crust
Dependencies
Rust - the compiler is written in it;
fasm - used as the compiler backend;
Quick Start
$ make $ ./build/b -run ./examples/hello_world.b
Also check out more examples at ./examples/.
Testing
The project comes with btest utility which tests the B compiler. It is built automatically along with the B compiler when you do make .
When you run it, it just builds and runs all the tests from the ./tests/ folder on all the supported targets and generates a matrix report. Give it a try to see it for yourself:
$ make $ ./build/btest
It doesn't crash when it encounters errors, it just collects the statuses of the tests on all the platforms to give an overview of the current state of the compiler.
Slicing the Test Matrix
If you want to test only on a specific platform you can supply the flag -t
$ ./build/btest -t fasm-x86_64-linux
You can supply several platforms
$ ./build/btest -t fasm-x86_64-linux -t uxn
If you want to run a specific test case you can supply flag -c
$ ./build/btest -c upper
You can do several tests
$ ./build/btest -c upper -c vector
And of course you can combine both -c and -t flags to slice the Test Matrix however you want
$ ./build/btest -c upper -c vector -t fasm-x86_64-linux -t uxn