• sugar_in_your_tea@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    FFI is just calling Rust directly from something else (or vice versa), and has pretty much no performance compromises. The main downside is potential safety implications at the FFI boundary (i.e. need to guarantee Rust doesn’t release C++ memory or vice versa), but if you’re already fine with gRPC performance penalties, you can just copy everything at the boundary and not worry about it.

    It’s basically the way Python native modules work, and can be used between any C-compatible languages.