Re:Apache Helix – Near-Realtime Rsync Replicated File System
by lmm on Monday October 26, 2020 @11:26PM
(#24904232)
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.
[ Parent
| on HN ]
Re:Apache Helix – Near-Realtime Rsync Replicated File System
by francislavoie on Tuesday October 27, 2020 @02:07AM
(#24904850)
> Go libraries can only be used from Go
https://github.com/draffensperger/go-interlang
> Rust libraries can only be used from Rust
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, e.g. https://dev.to/verkkokauppacom/introduction-to-php-ffi-po3
Re:Apache Helix – Near-Realtime Rsync Replicated File System
by lmm on Tuesday October 27, 2020 @05:20AM
(#24905686)
If 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.