Skip to content

Dominilk/llvmbf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llvmbf

An LLVM frontend for the brainf*ck esoteric programming language.

Spec of brainf*ck can be found here.

Disclaimer: Tape is fixed-size of 2^16, dynamic alloc would be needed for "infinite" size - didn't find the time to implement this - therefore tape wrap-around is used.

This crate uses inkwell, a safe LLVM wrapper for Rust.

dependencies

LLVM (up to 17) installed on system. General installation instructions can be found here. On macOS you can also install via brew:

brew install llvm@17

Generally the same requirements from llvm-sys apply here too.

build

cargo build --release

examples

Run generated IR directly using lli:

> cargo run -- examples/helloworld.bf | lli

Compile & link IR to executable:

> cargo run -- examples/helloworld.bf > helloworld.ll
> clang helloworld.ll
> ./a.out

devcontainer

NOTE: After starting the devcontainer wait for postCreateScript to finish installation of llvm17. Then project can be built using instructions above.

About

Brainf*ck frontend for LLVM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published