Comment by aapoalas
Small self-promotion: I've written about FFI matters on a slightly philosophical bent, in the context of C FFI between Deno JS runtime and 3rd party C FFI libraries: https://denonomicon.deno.dev/philosophy-of-ffi
It's probably not quite the teaching material you seek, but it's something close to that I think.