~/talk

Calling Functions Across Languages

Talkat GOTO Chicago 2023 · 2023-05-22..05-24· [compilers-and-language-design]
slides:none on file

Demonstrates calling a Ruby dot product from Node.js by removing HTTP/IP C overhead and using C as intermediary with node_api.h and ruby.h to convert JS values to C then to Ruby and back, producing a direct same-process call that runs significantly faster than localhost IPC; benchmarks show under 8KB pipes fastest and >8KB favors shared memory. Notes risks (segfaults, mismatched in-memory representations, lost type checks) and tools to help: rust-bindgen and Rock glue generates bindings for Rust/Node to enable incremental TypeScript→Rock migration (used at vendor).

AI-written summary · about

  1. 0:00Calling functions across languages
  2. 1:47Why cross-language calls are needed
  3. 8:25IPC and performance trade-offs
  4. 15:22How CPUs execute code as ones and zeros
  5. 19:31Risks of direct memory jumps
  6. 23:00C as intermediary for calls
  7. 29:56Same-process calls with low overhead
  8. 34:05Type safety challenges
  9. 37:15Generating bindings with Rock
  10. 43:10Speed versus safety balance
  11. 47:21Network, IPC, or same-process calls
~/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.