4 ms·
> Go libraries can only be used from Go https://github.com/draffensperger/go-interlang https://github.com/draffensperger/go-interlang > Rust libraries can onl
by francislavoie 6y ago
> Go libraries can only be used from Go
https://github.com/draffensperger/go-interlang https://github.com/draffensperger/go-interlang
> Rust libraries can only be used from Rust
https://rust-embedded.github.io/book/interoperability/rust-with-c.html https://rust-embedded.github.io/book/interoperability/rust-w...
And any language that supports an FFI interface can call rust code. For example you can write a rust lib and call it from PHP using it's recently released FFI https://www.php.net/manual/en/book.ffi.php https://www.php.net/manual/en/book.ffi.php, e.g. https://dev.to/verkkokauppacom/introduction-to-php-ffi-po3 https://dev.to/verkkokauppacom/introduction-to-php-ffi-po3
- lmm 6y agoIf a Go or Rust library takes the time to offer a C-compatible interface (most don't), or you add one yourself, then you can invoke it via the anaemic, unsafe C ABI - no first-class objects, functions, or sum types, raw pointers everywhere. At that point it might as well be a C library, because any program that uses it is still inherently memory-unsafe.