Calling Functions Across Languages
summary
Shows how to replace network or process RPC with direct in-process calls using C FFIs so Node.js can call Ruby (and Python, Fortran, etc.), converting JS/Ruby shapes via N-API and Ruby C API to avoid misinterpreted bit patterns. Benchmarks note pipes under 8K are fastest, shared memory wins for larger payloads. Demonstrates a working C shim that converts arrays, explains crash risks (segfaults from layout mismatches) and presents Rock glue as a generator to auto-produce safe bindings instead of hand-writing C.
AI-written summary · about
chapters (8)
- 0:00Introduction to cross-language calls
- 2:26HTTP call from JavaScript to Ruby
- 11:13Moving to single-process calls
- 23:25Using C as an intermediary
- 31:08Making cross-language calls less painful
- 37:23Generating bindings automatically
- 44:19Trade-offs of different approaches
- 48:10Summary and closing
related talks
49mCalling Functions Across Languages
01h 02mPolyglot Programming through Foreign Function Interfaces
48mOne VM To Rule Them All
35mOutperforming Imperative with Pure Functional Languages
01h 16mPolymorphism, Cohesion, and Coupling in C++
16mForeign Function and Memory API
46mMore Interops, Good and Varied!
34mLow-level RASP: Protecting Applications Implemented in High-level Programming Languages
