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, or clang)
  • 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.

ModuleLibrarymacOSDebian/UbuntuFedora/RHEL
httplibcurlIncludedapt install libcurl4-openssl-devdnf install libcurl-devel
cryptoOpenSSLIncludedapt install libssl-devdnf install openssl-devel
sqlSQLite3Includedapt install libsqlite3-devdnf 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/hello

A program that uses SQLite:

# Install the dependency first (Linux only)
apt install libsqlite3-dev

bark my_app.bark   # Links -lsqlite3 automatically
./build/my_app

Verbose Mode#

Use -v to see which modules Bark detected and the exact compiler command:

bark -v my_app.bark

This prints the modules found and the full cc invocation, making it easy to diagnose missing libraries.