3 ms·
Why do you need to rewrite them? Rust can call C++ code, just like Java and Python can. (I note you list Python libraries like Tensorflow and PyTorch as C++, wh
by geofft 6y ago
Why do you need to rewrite them? Rust can call C++ code, just like Java and Python can. (I note you list Python libraries like Tensorflow and PyTorch as C++, which is accurate because they're written in C++, but they're certainly heavily used from a non-C++ language.)
- johnnycerberus 6y agoIt was more of a proof of what you can build with Java and C++, the infrastructure that provides Python users with capabilities.
- jpgvm 6y agoRust definitely makes sense anywhere you are currently using C/C++ or Python/Ruby. Java is somewhat of a special case though, especially the Big Data ecosystem. Much of the fastest and most important Java tools are written in pure Java (or other JVM language) and as such can't be called from Rust in a reasonable way. Writing Big Data code in Rust is certainly possible from a performance perspective but is an uphill battle of lack of libraries, integration, etc. Some of this might change in time but I don't see Rust ever displacing Java from Big Data. One of the big reasons for this is the main downside of Java is it's GC, which is mainly problematic for latency sensitive applications. In the Big Data field this is substantially reduced as a problem as the code is usually throughput bound and executed outside of interactive contexts, hiding the cost of the GC where it might be more apparent in other applications. I love Rust and I think it has a lot of potential to replace some of the databases and networked services used in data infrastructure, just don't see it displacing Java as the top dog.
- proverbialbunny 6y agoYou've got it backwards. Rust is lower level than Java, so Java would be calling Rust, not the other way around. Rust isn't aiming to displace Java. They're two different levels of abstraction. It's the same with Python. Rust isn't aiming to displace Python just as Java isn't aiming to displace Python either. Rust one day could displace C++, but the odds are low, because in response to Rust C++ has stepped up its game and has changed as a language drastically. Most modern C++ features are concepts from Rust.
- foldr 6y agoIt's easy to call C++ code from Rust but it's often not trivial to wrap a C++ library with a safe Rust interface. C++ APIs often have implicit ownership structures that are difficult to encode using Rust's lifetimes. To be fair, that doesn't put Rust in a worse position than any other language binding a C++ API. It's just that Rustaceans tend to have higher expectations in terms of safety.