~/talk

Beyond Proc-Macros: A Trait-Based Framework for Bindgen

Talkat Rust in Paris 2025 · on Wednesday, 2025-06-25· [rust, compilers-and-language-design]
links:none on file
slides:none on file

Generates C-ABI FFI bindings between Rust and Haskell using a trait-based framework rather than only proc macros, implemented as hs-bindgen that is compact (under 1,000 LOC) and works in demos. Enforces FFI-safe types at compile time via a private C-FF-safe trait and From/Into-like traits, automates pointer ownership, pinning and vector conversions, and emits C glue code from proc-macro expansion. Documents proc-macro limits: token-stream API, no compile-time type reflection, slow builds, and cases where runtime mismatches still occur.

AI-written summary · about

  1. 0:00Introduction to the talk
  2. 0:55Why use FFI?
  3. 2:27Manual FFI demo
  4. 5:20The case against rewriting
  5. 6:00FFI risks and pitfalls
  6. 9:11Automating FFI bindings
  7. 12:27Trait-based design patterns
  8. 15:35Proc-macro limitations
  9. 19:15Future work and conclusion
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.