~/talk

Get the best of both worlds: Integrating Rust with other languages

Talkat RustLab 2022 · 2022-10-02..10-04· [rust]
links:none on file
links:none on file
slides:none on file

Integrates Rust with C, C++ and Java by exposing a BinaryHeap-backed priority queue over a C FFI (extern "C", no_mangle) and generating headers with cbindgen, using the Option<Box<usize> nullability trick for nullable pointers, mapping C++ via the cxx crate, and calling from Java via JNI plus the JNI + jni-fn macro to simplify signatures. Valgrind shows no leaks; example image filters measure big wins: grayscale ~18ms → ~8ms and blur ~85ms → ~33ms, and build scripts automate header and binding generation.

AI-written summary · about

  1. 0:00Start
  2. 1:58Introduction
  3. 5:26Use a Rust library from C - Constructor
  4. 10:14cbindgen - Build script (build.rs)
  5. 11:21cbindgen - Generated header file
  6. 13:16C++ bindings using cxx - Declarations
  7. 14:48C++ bindings using cxx - Implementation
  8. 16:11Conclusion
  9. 16:52Code repo & presentation slides
  10. 18:03Java Native Interface (JNI)
  11. 18:20Native method declaration
  12. 22:02Implement the Rust side
  13. 28:15Load native Library
  14. 33:58Demo
  15. 40:56Filter Kernel
~/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.