3 ms·
Agreed. BTW, have you looked Scala/Rust interop? Both languages are ML-style languages, so they are close in spirit.
by YorkshireSeason 8y ago
Agreed.
BTW, have you looked Scala/Rust interop? Both languages are ML-style languages, so they are close in spirit.
- haggy 8y agoIm a Scala guy that knows very little about rust so excuse the ignorance but what would the benefits be with regards to scala/rust interop?
- YorkshireSeason 8y agoDo all the stuff that can be done in a high-level GCed language in Scala, and drop down to a low-level language where GC is in the way.
- zokier 8y agoI don't really see much opportunity for interop beyond the dog-slow JNI and C-style interfaces. Sure, you probably can do that, but it would be fairly exceptional situation where it would make sense, especially as afaik Scala has pretty decent perf by itself
- 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).