~/talk

Rust's trait system is a proof engine, let's make it prove us an ABI!

Talkat RustLab 2023 · 2023-11-19..11-21· [rust, compilers-and-language-design]
links:none on file
slides:none on file

Claims that Rust's trait system can do real computation to produce a stable ABI and demonstrates a working crate that does it. It uses GAT-powered proofs and typenum-style type arithmetic to implement addition, multiplication and layout math at compile time, produces a stabby crate that emits layout reports and performs deterministic niche packing for enums, and supports multitraits and a stable allocator API. It runs on GAT-capable Rust, costs extra compile time (previously ~1s per enum before optimizations), is usable for Rust-to-Rust plugins now and has a spec for cross-language implementations.

AI-written summary · about

  1. 0:00Introduction
  2. 1:08Counting with Rust traits
  3. 2:12Traits as functional types
  4. 3:37Collections and numbers
  5. 4:42Typenum limitations
  6. 5:46Generic Associated Types
  7. 6:50Defining booleans and TyFu
  8. 8:14TyFu recursion limits
  9. 9:18Unsigned integers and circuits
  10. 10:42Type-level addition and multiplication
  11. 11:23Runtime types and conversions
  12. 13:13Scientific computing with tensors
  13. 13:36Memory management and slabs
  14. 14:39ABI fundamentals
  15. 16:24C ABI quirks
  16. 18:09Rust ABI stability
  17. 19:55Dynamic linkage and plugins
  18. 21:41Introducing Stabby
  19. 23:28Stabby implementation
  20. 24:33Type system tips
  21. 26:19Conclusions and limits
  22. 27:25Q&A
  23. 27:45Questions on pack types
  24. 28:54Cross-language ABI stability
  25. 29:57ABI interpretation reports
  26. 31:24Comparison with stable ABI RFC
  27. 32:43Compile-time overhead
  28. 34:10Consteval expressions
  29. 35:15Type system advances
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.