Liking cljdoc? Tell your friends :D

clj-zig.compile

Compile generated Zig into a dynamic library (imperative shell). This namespace owns the only zig invocations: it writes the source, canonicalizes it with zig fmt, and builds a shared library.

On success it returns the library and source paths. On failure it throws a structured diagnostic: the Var and signature first, then the source.zig path, then the compiler's stderr and exit code. The core shell catches it to keep the last good binding.

Compile generated Zig into a dynamic library (imperative shell). This
namespace owns the only `zig` invocations: it writes the source,
canonicalizes it with `zig fmt`, and builds a shared library.

On success it returns the library and source paths. On failure it
throws a structured diagnostic: the Var and signature first, then the
`source.zig` path, then the compiler's stderr and exit code. The core
shell catches it to keep the last good binding.
raw docstring

compile!clj

(compile! {:keys [source source-path library-path ctx options aux-files
                  target]})

Compile source into a dynamic library at library-path, writing the canonical source to source-path first. Returns {:library <path> :source-path <path>} on success; throws a structured diagnostic on failure. ctx adds :var and :signature to that diagnostic. options carries C-interop include and link flags; aux-files are imported Zig files to write beside the source first, each {:path <absolute> :text <content>}. target is a Zig target triple to cross-compile for (e.g. x86_64-linux-musl); omit it to build for the host.

Compile `source` into a dynamic library at `library-path`, writing the
canonical source to `source-path` first. Returns
`{:library <path> :source-path <path>}` on success; throws a
structured diagnostic on failure. `ctx` adds `:var` and `:signature`
to that diagnostic. `options` carries C-interop include and link flags;
`aux-files` are imported Zig files to write beside the source first, each
`{:path <absolute> :text <content>}`. `target` is a Zig target triple to
cross-compile for (e.g. `x86_64-linux-musl`); omit it to build for the
host.
sourceraw docstring

dynamic-library-extensionclj

(dynamic-library-extension)

The platform's shared-library suffix, without the dot.

The platform's shared-library suffix, without the dot.
sourceraw docstring

options->flagsclj

(options->flags {:keys [include-path system-include-path link-path link]})

The extra zig build-lib flags carried in options for C interop: include paths (-I), system include paths (-isystem), library search paths (-L), and linked libraries (-l). Returns a flat vector of argv tokens, empty when there is nothing to add. Pure.

The extra `zig build-lib` flags carried in `options` for C interop:
include paths (`-I`), system include paths (`-isystem`), library search
paths (`-L`), and linked libraries (`-l`). Returns a flat vector of argv
tokens, empty when there is nothing to add. Pure.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close