System Dependencies#
Bark compiles programs to native binaries via C. A C compiler (cc or gcc) must
be available on your system. Beyond that, Bark uses conditional compilation to
only require libraries that your program actually uses.
Core Requirements#
Every Bark program needs:
- A C compiler (
cc,gcc, orclang) pthreads(included on macOS and Linux)libm(math library, included on macOS and Linux)
These are available by default on macOS and most Linux distributions.
Module Dependencies#
The following modules require additional system libraries. Bark only links these when your program imports the corresponding module.
| Module | Library | macOS | Debian/Ubuntu | Fedora/RHEL |
|---|---|---|---|---|
http | libcurl | Included | apt install libcurl4-openssl-dev | dnf install libcurl-devel |
crypto | OpenSSL | Included | apt install libssl-dev | dnf install openssl-devel |
sql | SQLite3 | Included | apt install libsqlite3-dev | dnf install sqlite-devel |
On macOS, all three libraries are available through the system or Xcode Command Line Tools. No additional installation is needed.
On Linux, install only the -dev packages for the modules you use. For example,
if your program uses sql.open but not http or crypto, you only need libsqlite3-dev.
Example#
A simple program that does not use http, crypto, or sql requires no
additional dependencies:
fn main() {
"Hello, world!" > println()
}()bark hello.bark # Only needs cc, pthreads, libm
./build/helloA program that uses SQLite:
# Install the dependency first (Linux only)
apt install libsqlite3-dev
bark my_app.bark # Links -lsqlite3 automatically
./build/my_appVerbose Mode#
Use -v to see which modules Bark detected and the exact compiler command:
bark -v my_app.barkThis prints the modules found and the full cc invocation, making it easy to
diagnose missing libraries.