0.0.0 • Published 8 years ago
braid-native v0.0.0
Braid Native
This is the experimental native backend for Braid. It compiles to LLVM. It resides in a separate directory so the main compiler can avoid a dependency on the native LLVM library.
To use this backend, install its dependencies:
$ cd native
$ yarnThe driver for the native compiler is braidnc, at build/native/braidnc.js.
You will need to have the LLVM dynamic library on your linker path. For example, for my copy of LLVM installed via Homebrew, I had to do this:
$ export LD_LIBRARY_PATH=`brew --prefix llvm`/libBy default, braidnc writes LLVM IR to stdout. To dump bitcode to a file, use the -o option:
$ braidnc -o program.bc program.ssThen, an easy way to compile this to native code is using clang:
$ clang program.bc
% ./a.out0.0.0
8 years ago