2025-01-12 12:45:44 +08:00
2025-01-12 12:45:44 +08:00
2025-01-12 12:45:44 +08:00
2025-01-12 12:45:44 +08:00
2025-01-12 12:45:44 +08:00
2025-01-12 12:45:44 +08:00
2025-01-12 12:45:44 +08:00
2025-01-12 12:45:44 +08:00
2025-01-12 12:45:44 +08:00
2025-01-12 12:45:44 +08:00

rust-ffi-from-go

Calling Rust FFI libraries from Go

Rust is an excellent systems language so it makes a lot of sense to be able to use Rust libraries in other languages. Rust supports a Foreign Function Interface (FFI) so you can call into other C libraries as well as allow C to call into Rust libraries.

Go has something similar with cgo, but we really dont want to do anything with C directly. Memory safety is important, particularly for a security company! This means the ideal route is to write in Rust, but compile to a format that Go can interface with. Thats what FFI is for.

https://blog.arcjet.com/calling-rust-ffi-libraries-from-go/

Installation

cargo install cargo-zigbuild
Description
Calling Rust FFI libraries from Go
Readme 35 KiB
Languages
Rust 63.8%
Go 20.9%
Just 15.3%