Clojure binding to rift — copy-on-write development workspaces, a faster
alternative to git worktree — via the native librift_ffi shared library
loaded in-process through the JDK Foreign Function & Memory API
(java.lang.foreign, stable since JDK 22).
The native ABI is exactly two C symbols, JSON in / JSON out:
char* rift_ffi_call(const char* json_request) ;; heap-allocated reply void rift_ffi_free(char* reply)
A request is {"command" "create" ...}; a reply is either
{"status" "ok" "value" ...} or
{"status" "error" "error" {"code" .. "message" .. "path" ..}}.
Native loading checks, in order:
RIFT_NATIVE_PATH / com.blockether.rift.native.path,resources/prebuilds/<os>-<arch>/... classpath resource,com.blockether/rift-native-<os>-<arch> Clojars artifact
downloaded into ~/.cache/clj-rift.Supported platforms: darwin-arm64, darwin-x64, linux-x64, linux-arm64.
REQUIRES the JVM flag --enable-native-access=ALL-UNNAMED; without it the
first native call prints a restricted-method warning (and on a future JDK
default of --illegal-native-access=deny would fail outright).
Clojure binding to rift — copy-on-write development workspaces, a faster
alternative to `git worktree` — via the native `librift_ffi` shared library
loaded in-process through the JDK Foreign Function & Memory API
(`java.lang.foreign`, stable since JDK 22).
The native ABI is exactly two C symbols, JSON in / JSON out:
char* rift_ffi_call(const char* json_request) ;; heap-allocated reply
void rift_ffi_free(char* reply)
A request is `{"command" "create" ...}`; a reply is either
`{"status" "ok" "value" ...}` or
`{"status" "error" "error" {"code" .. "message" .. "path" ..}}`.
Native loading checks, in order:
1. `RIFT_NATIVE_PATH` / `com.blockether.rift.native.path`,
2. a bundled `resources/prebuilds/<os>-<arch>/...` classpath resource,
3. the matching `com.blockether/rift-native-<os>-<arch>` Clojars artifact
downloaded into `~/.cache/clj-rift`.
Supported platforms: darwin-arm64, darwin-x64, linux-x64, linux-arm64.
REQUIRES the JVM flag `--enable-native-access=ALL-UNNAMED`; without it the
first native call prints a restricted-method warning (and on a future JDK
default of `--illegal-native-access=deny` would fail outright).cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |