1.1--- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2+++ b/core/lib/ffi.org Sat Sep 07 22:34:47 2024 -0400
1.3@@ -0,0 +1,96 @@
1.4+#+title: ffi
1.5+#+author: Richard Westhaver
1.6+#+setupfile: ../../clean.theme
1.7+#+OPTIONS: num:nil
1.8+This doc is about the [[https://en.wikipedia.org/wiki/Foreign_function_interface][Foreign Function Interface]] (FFI) features of the
1.9+=core=.
1.10+
1.11+Besides accessing system, OS, and external libraries via binding code
1.12+(dynamically in Lisp, statically in Rust), we also expose parts of the
1.13+core in a C-compatible fashion. In Lisp, we use the SB-ALIEN interface
1.14+to load (with dlopen) and call foreign symbols. In Rust we mostly use
1.15+rust-bindgen and the built-in rustc features.
1.16+
1.17+* Libraries
1.18+:PROPERTIES:
1.19+:ID: 1eb797dc-d617-46cc-89e8-7b6103e526d2
1.20+:END:
1.21+The following binding libraries are provided with supporting
1.22+code. There is some cross-over between the Lisp and Rust bindings
1.23+depending on what library features we need and where. Some of the
1.24+bindings are very minimal or for experimental-use only only.
1.25+** xkb
1.26+:PROPERTIES:
1.27+:ID: 79b3a686-efe9-411e-9d1e-358113622949
1.28+:END:
1.29+These bindings are actually directed at libxkbcommon instead of
1.30+x11/xkb directly.
1.31+*** xkbcommon
1.32+:PROPERTIES:
1.33+:ID: 9b9be592-1314-4926-940a-908ff4844e29
1.34+:END:
1.35+https://xkbcommon.org/doc/current/md_doc_2quick-guide.html
1.36+** rocksdb
1.37+:PROPERTIES:
1.38+:ID: 5a1fd665-b72a-4d62-af4c-4967825f69c6
1.39+:END:
1.40+[[https://github.com/facebook/rocksdb/wiki][RocksDB Wiki]]
1.41+** btrfs
1.42+:PROPERTIES:
1.43+:ID: 6b3dc423-0e1c-458d-9f8e-bf7456f9a048
1.44+:END:
1.45+The kernel headers btrfs and btrfs_tree will be wrapped at some point
1.46+in addition to the userspace library (btrfsutil) documented below.
1.47+*** btrfsutil
1.48+:PROPERTIES:
1.49+:ID: 7296995d-2b67-45ec-94d9-8fe23126a602
1.50+:END:
1.51+https://github.com/kdave/btrfs-progs
1.52+** uring
1.53+:PROPERTIES:
1.54+:ID: c0750228-7ba8-445a-8790-ca0310cf0a7d
1.55+:END:
1.56+https://man.archlinux.org/man/io_uring.7.en
1.57+** zstd
1.58+:PROPERTIES:
1.59+:ID: 6dbfed55-0d07-4090-bc3b-ea9317d9bfe5
1.60+:END:
1.61+zstd compression bindings: https://github.com/facebook/zstd
1.62+** tree-sitter
1.63+:PROPERTIES:
1.64+:ID: 8527c382-ae65-4ad9-8f70-9ff5c6b152f0
1.65+:END:
1.66+bindings to tree-sitter parser generator and language libraries: https://github.com/tree-sitter/tree-sitter
1.67+** COMMENT blake3
1.68+:PROPERTIES:
1.69+:ID: a1807b79-9811-49f0-9524-cbf5e88c1a66
1.70+:END:
1.71+temporary package for CL implementation of Blake3 SHA. Wraps C
1.72+implementation (libblake3).
1.73+** COMMENT alpm
1.74+:PROPERTIES:
1.75+:ID: cdd1682c-39b0-450e-a979-a5637cd15f43
1.76+:END:
1.77+https://man.archlinux.org/man/core/pacman/libalpm.3.en
1.78+https://github.com/archlinux/alpm.rs/tree/382af70cdbff8e1f65c0bf8df79693786f44429c/alpm/examples
1.79+
1.80+** COMMENT bqn
1.81+:PROPERTIES:
1.82+:ID: 5014f979-5b3a-4dfc-89e3-5a5a23462a29
1.83+:END:
1.84+These bindings are for libcbqn which can be build from CBQN:
1.85+https://github.com/dzaima/CBQN
1.86+** COMMENT k
1.87+:PROPERTIES:
1.88+:ID: 47a60640-e387-4ac7-ab45-4f7a763e9611
1.89+:END:
1.90+https://codeberg.org/ngn/k
1.91+bindings for ngn/k (libk).
1.92+** COMMENT nuklear
1.93+:PROPERTIES:
1.94+:ID: e1e942b2-ebe0-48e9-bdd3-f4e27b7fed7c
1.95+:END:
1.96+** COMMENT ssh2
1.97+:PROPERTIES:
1.98+:ID: 3c9e02d8-2c59-4ef5-8232-8422fd9e8ed3
1.99+:END: