3 ms·
> BTW, have you looked Scala/Rust interop? It doesn't look easy (there's no Rust ABI that preserves safety properties) and I'm not convinced there would be any
by lmm 8y ago
> BTW, have you looked Scala/Rust interop?
It doesn't look easy (there's no Rust ABI that preserves safety properties) and I'm not convinced there would be any benefit. The main reasons you'd want to write Rust rather than Scala would be faster app startup (and even then, scala-native or scalajs are options) or some realtime requirement that you couldn't meet with even carefully tuned Scala due to GC pauses (not a case that I'm convinced actually exists in the real world). In either of those cases a mixed Scala/Rust project would have the same issues as a pure-Scala one. Most things that scripting languages use native libraries for already have native-to-JVM implementations (e.g. media formats) and I'd sooner use a Java library than worry about an interop-to-Rust boundary. If Rust becomes the de facto standard for video codecs then I can eventually see maybe making occasional use of some ffmpeg-equivalent via JNI, but any such library would probably expose a C-ABI interface and be used through that rather than supporting any higher-level interop. (I suspect Rust is constrained by what LLVM offers in terms of stable interfaces).