Gather top-level declaration syntax-tree data from C headers via clang.
This module is currently only available for GNU/Linux.
Warning: Read this Section Before Use
Like Racket's built-in
ffi/unsafe module, this library allows Racket to
use C functions and data structures that are not memory-managed by Racket.
Racket can not provide safety guarantees by default for ffi objects created
using this library. Users of this library will be required to self-enforce
memory management in C and/or manually expose ffi objects to Racket's garbage
collector. Extra care should be taken to ensure that C functions bound via
this library or Racket's built-in ffi do not contain errors like buffer overflows,
which could corrupt the runtime, cause undefined behavior, and prevent Racket from
providing useful error messages.
Users of this library should be extremely cautious. The library makes it easier to call C functions from Racket, but does not make it safer.
Passing unsanitized user-input to any function in this library is horribly dangerous. You should never do it under any circumstance.
To install the package:
raco pkg install dynamic-ffi
- llvm and clang development headers and libraries
sudo dnf install '@development tools" racket llvm-devel clang-devel
sudo apt-get install 'build-essential" racket llvm-dev libclang-dev clang
Documentation is available at https://docs.racket-lang.org/dynamic-ffi/index.html, or locally after the package is installed by running the following command:
raco docs dynamic-ffi
I hope to also write bindings to the dynamic ffi core from other languages like Rust and Python.