changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > org > docs / core/ffi.org

changeset 44: b925807b50a6
parent: bc53e27c0163
author: Richard Westhaver <ellis@rwest.io>
date: Sun, 18 Aug 2024 22:16:12 -0400
permissions: -rw-r--r--
description: weekend warrior
1 #+title: ffi
2 #+author: Richard Westhaver
3 #+setupfile: ../../clean.theme
4 #+OPTIONS: num:nil
5 #+infojs_opt: toc:nil home:https://compiler.company up:./ view:content
6 This doc is about the [[https://en.wikipedia.org/wiki/Foreign_function_interface][Foreign Function Interface]] (FFI) features of the
7 =core=.
8 
9 Besides accessing system, OS, and external libraries via binding code
10 (dynamically in Lisp, statically in Rust), we also expose parts of the
11 core in a C-compatible fashion. In Lisp, we use the SB-ALIEN interface
12 to load (with dlopen) and call foreign symbols. In Rust we mostly use
13 rust-bindgen and the built-in rustc features.
14 
15 * Libraries
16 :PROPERTIES:
17 :ID: 1eb797dc-d617-46cc-89e8-7b6103e526d2
18 :END:
19 The following binding libraries are provided with supporting
20 code. There is some cross-over between the Lisp and Rust bindings
21 depending on what library features we need and where. Some of the
22 bindings are very minimal or for experimental-use only only.
23 ** xkb
24 :PROPERTIES:
25 :ID: 79b3a686-efe9-411e-9d1e-358113622949
26 :END:
27 These bindings are actually directed at libxkbcommon instead of
28 x11/xkb directly.
29 *** xkbcommon
30 :PROPERTIES:
31 :ID: 9b9be592-1314-4926-940a-908ff4844e29
32 :END:
33 https://xkbcommon.org/doc/current/md_doc_2quick-guide.html
34 ** rocksdb
35 :PROPERTIES:
36 :ID: 5a1fd665-b72a-4d62-af4c-4967825f69c6
37 :END:
38 [[https://github.com/facebook/rocksdb/wiki][RocksDB Wiki]]
39 ** btrfs
40 :PROPERTIES:
41 :ID: 6b3dc423-0e1c-458d-9f8e-bf7456f9a048
42 :END:
43 The kernel headers btrfs and btrfs_tree will be wrapped at some point
44 in addition to the userspace library (btrfsutil) documented below.
45 *** btrfsutil
46 :PROPERTIES:
47 :ID: 7296995d-2b67-45ec-94d9-8fe23126a602
48 :END:
49 https://github.com/kdave/btrfs-progs
50 ** uring
51 :PROPERTIES:
52 :ID: c0750228-7ba8-445a-8790-ca0310cf0a7d
53 :END:
54 https://man.archlinux.org/man/io_uring.7.en
55 ** zstd
56 :PROPERTIES:
57 :ID: 6dbfed55-0d07-4090-bc3b-ea9317d9bfe5
58 :END:
59 zstd compression bindings: https://github.com/facebook/zstd
60 ** tree-sitter
61 :PROPERTIES:
62 :ID: 8527c382-ae65-4ad9-8f70-9ff5c6b152f0
63 :END:
64 bindings to tree-sitter parser generator and language libraries: https://github.com/tree-sitter/tree-sitter
65 ** COMMENT blake3
66 :PROPERTIES:
67 :ID: a1807b79-9811-49f0-9524-cbf5e88c1a66
68 :END:
69 temporary package for CL implementation of Blake3 SHA. Wraps C
70 implementation (libblake3).
71 ** COMMENT alpm
72 :PROPERTIES:
73 :ID: cdd1682c-39b0-450e-a979-a5637cd15f43
74 :END:
75 https://man.archlinux.org/man/core/pacman/libalpm.3.en
76 https://github.com/archlinux/alpm.rs/tree/382af70cdbff8e1f65c0bf8df79693786f44429c/alpm/examples
77 
78 ** COMMENT bqn
79 :PROPERTIES:
80 :ID: 5014f979-5b3a-4dfc-89e3-5a5a23462a29
81 :END:
82 These bindings are for libcbqn which can be build from CBQN:
83 https://github.com/dzaima/CBQN
84 ** COMMENT k
85 :PROPERTIES:
86 :ID: 47a60640-e387-4ac7-ab45-4f7a763e9611
87 :END:
88 https://codeberg.org/ngn/k
89 bindings for ngn/k (libk).
90 ** COMMENT nuklear
91 :PROPERTIES:
92 :ID: e1e942b2-ebe0-48e9-bdd3-f4e27b7fed7c
93 :END:
94 ** COMMENT ssh2
95 :PROPERTIES:
96 :ID: 3c9e02d8-2c59-4ef5-8232-8422fd9e8ed3
97 :END: