Crates.io | brainhecc |
lib.rs | brainhecc |
version | 0.1.0 |
source | src |
created_at | 2021-10-28 00:16:22.247348 |
updated_at | 2021-10-28 00:16:22.247348 |
description | A Brainhecc compiler written in Rust. |
homepage | https://github.com/trimorphdev/brainhecc |
repository | https://github.com/trimorphdev/brainhecc |
max_upload_size | |
id | 473365 |
size | 43,403 |
A compiler for Brain[hecc] programs, written in Rust with Cranelift.
It compiles any valid Brainhecc program into an executable binary.
Note: to compile Brainhecc programs, any linker may be used, but Brainhecc programs must be linked with the C standard library, otherwise compiled programs won't work.
Cargo can automatically download and build the Brainhecc program:
cargo install brainhecc
The Hello, World! example can be compiled an ran with the following commands:
brainhecc examples/hello_world.brainhecc hello_world.o # compile the program
gcc hello_world.o -o hello_world # link the program with the C standard library
./hello_world # run the program
# => Hello, world!