~/talk

Scala and C – tight as brothers

Talkat Scalar 2026 · 2026-03-26..03-27· [embedded-and-hardware, scala]
links:none on file
slides:none on file

Scala Native interoperates with C using a binding generator called sbt-bindgen and a growing toolset that already wraps OpenSSL into Java Security, exposes curl as a Java net HTTP client, and provides libpq/SQLite/DuckDB bindings; largest practical limit is 22 C fields for native structs so very large FFmpeg structs (151 fields) are encoded as byte blobs with computed offsets causing alignment pitfalls. There is a tested repo SNBindGen plus a 100% Scala Native web backend using HTTP4s Cats Effect FS2 Skunk and a mono-repo of examples (curl, DuckDB, JNI, Lua, MySQL, OpenSSL, tree-sitter) showing practical but sometimes awkward workarounds like the structs-by-value limitation.

AI-written summary · about

  1. 0:00Scala Native and C interop
  2. 1:08Why Scala Native needs C interop
  3. 3:13C library integration state
  4. 4:16C ABI and challenges
  5. 7:28ABI in action with examples
  6. 9:36Why C libraries matter
  7. 10:19Structs and memory layout
  8. 13:55Recursive definitions and unions
  9. 16:23Large structs and alignment
  10. 18:05C enums and macros
  11. 19:50C macros and attributes complexity
  12. 21:14Encoding C in Scala
  13. 22:15C vs Scala Native code
  14. 23:41C library integration examples
  15. 24:45SNBindGen introduction
  16. 25:26SNBindGen demo
  17. 26:07Conclusion and future
~/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.