Liking cljdoc? Tell your friends :D

clj-zig

The public clj-zig API, meant to be aliased zig:

(require '[clj-zig.core :refer [defnz defz]] '[clj-zig :as zig])

defnz/defz (in clj-zig.core) are the everyday forms. This namespace publishes everything else: the inspection helpers that hang off a Var, and the data functions that make up the pipeline a macro hides (normalize-signature, normalize-type, build-spec, generate-source, compile!, load!). A library or macro author can drive the whole pipeline through these without the macro.

The public clj-zig API, meant to be aliased `zig`:

    (require '[clj-zig.core :refer [defnz defz]] '[clj-zig :as zig])

`defnz`/`defz` (in `clj-zig.core`) are the everyday forms. This namespace
publishes everything else: the inspection helpers that hang off a Var,
and the data functions that make up the pipeline a macro hides
(`normalize-signature`, `normalize-type`, `build-spec`,
`generate-source`, `compile!`, `load!`). A library or macro author can
drive the whole pipeline through these without the macro.
raw docstring

build-specclj

(build-spec ident)

Build the canonical boundary spec from {:ns :name :signature}.

Build the canonical boundary spec from `{:ns :name :signature}`.
sourceraw docstring

clean!clj

(clean!)
(clean! root)

Remove the artifact cache under root (default .clj-zig/cache).

Remove the artifact cache under `root` (default `.clj-zig/cache`).
sourceraw docstring

compile!clj

(compile! spec body)
(compile! spec body gen)

Compile or reuse the native library for spec and body, returning the artifact data (paths, symbol, generated source, build status). gen selects the source mode (:inline, :file, :raw) and carries any C-interop options.

Compile or reuse the native library for `spec` and `body`, returning the
artifact data (paths, symbol, generated source, build status). `gen`
selects the source mode (`:inline`, `:file`, `:raw`) and carries any
C-interop options.
sourceraw docstring

explainclj

(explain the-var)

Render the last failed attempt for the-var, or nil when there is nothing to explain.

Render the last failed attempt for `the-var`, or nil when there is
nothing to explain.
sourceraw docstring

fnclj

(fn spec body)
(fn spec body gen)

Build a callable function from spec and body in one step: compile! then load!.

Build a callable function from `spec` and `body` in one step:
`compile!` then `load!`.
sourceraw docstring

generate-sourceclj

(generate-source spec body)
(generate-source spec body opts)

Emit the Zig wrapper for spec with body spliced in. With opts {:mode :file :entry "name"} the wrapper instead calls a user fn.

Emit the Zig wrapper for `spec` with `body` spliced in. With `opts`
`{:mode :file :entry "name"}` the wrapper instead calls a user fn.
sourceraw docstring

generated-sourceclj

(generated-source the-var)

The full Zig wrapper generated around the body.

The full Zig wrapper generated around the body.
sourceraw docstring

libraryclj

(library the-var)

The path to the compiled shared library backing the function.

The path to the compiled shared library backing the function.
sourceraw docstring

load!clj

(load! artifact)

Load a compiled artifact and return the callable native invoker.

Load a compiled `artifact` and return the callable native invoker.
sourceraw docstring

modulesclj

(modules the-var)

The external Zig modules the function links, each {:name :fingerprint :status}, or nil when it depends on none.

The external Zig modules the function links, each `{:name :fingerprint
:status}`, or nil when it depends on none.
sourceraw docstring

normalize-signatureclj

(normalize-signature sig)

Normalize a signature vector to {:args [...] :ret <type>}.

Normalize a signature vector to `{:args [...] :ret <type>}`.
sourceraw docstring

normalize-typeclj

(normalize-type form)

Normalize a boundary type form to its canonical data shape.

Normalize a boundary type form to its canonical data shape.
sourceraw docstring

recompile!clj

(recompile! the-var)

Force a fresh build of the-var's current spec and body, ignoring the cached artifact, and rebind. Returns the Var.

Force a fresh build of `the-var`'s current spec and body, ignoring the
cached artifact, and rebind. Returns the Var.
sourceraw docstring

signatureclj

(signature the-var)

The signature vector the function was defined with.

The signature vector the function was defined with.
sourceraw docstring

sourceclj

(source the-var)

The Zig body the function was defined with.

The Zig body the function was defined with.
sourceraw docstring

source-fileclj

(source-file the-var)

The path of the .zig file the body was loaded from, or nil for an inline body.

The path of the `.zig` file the body was loaded from, or nil for an
inline body.
sourceraw docstring

source-modeclj

(source-mode the-var)

How the body was supplied: :inline, :file, or :raw.

How the body was supplied: `:inline`, `:file`, or `:raw`.
sourceraw docstring

specclj

(spec the-var)

The normalized boundary spec the function was built from.

The normalized boundary spec the function was built from.
sourceraw docstring

statusclj

(status the-var)

Whether the backing library was freshly built (:compiled) or reused from the cache (:cached).

Whether the backing library was freshly built (`:compiled`) or reused
from the cache (`:cached`).
sourceraw docstring

symbolclj

(symbol the-var)

The stable C symbol the native function is exported under.

The stable C symbol the native function is exported under.
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