3 ms·
Java is pretty much the only language I'd want to see low-level libraries written in. Go libraries can only be used from Go, Rust libraries can only be used fro
by lmm 6y ago
Java is pretty much the only language I'd want to see low-level libraries written in. Go libraries can only be used from Go, Rust libraries can only be used from Rust, and any nontrivial C library contains an arbitrary code execution vulnerability when built with a newer compiler. Java is a lowest-common-denominator language but it's memory-safe, cross-platform (in a way that C# isn't really yet), and there's a decent range of languages that you can run on the JVM and use Java libraries from.
- 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.