3 ms·
To make FFI lightweight, one follows underlying OS ABI, so there is no need to do any conversions. Compare Golang or LuaJIT FFI with what Java does. Java uses
by dschiptsov 10y ago
To make FFI lightweight, one follows underlying OS ABI, so there is no need to do any conversions.
Compare Golang or LuaJIT FFI with what Java does. Java uses libffi, but it does unnecessary copying and type and encoding conversions. Golang and LuaJIT has zero-copy FFI due to reusing of OS types (for UNIX-like systems it is C) - just dlload-and-call.
Thin layer (of abstraction) is how Golang's runtime is organized - delegating to an OS instead of reimplementing inside a VM.
- bogomipz 10y agoThanks. Makes sense.