2 ms·
There is certainly cases where Java is better than Rust (gasp I said it!) Purely from a productivity standpoint, Java is faster to write than Rust (you don't h
by rockwotj 4y ago
There is certainly cases where Java is better than Rust (gasp I said it!)
Purely from a productivity standpoint, Java is faster to write than Rust (you don't have to think about memory lifetimes and compile times are faster, I think IDEs for Java are better than Rust LSP), and you only need to optimize hot codepaths, not your whole program. Dynamic dispatch and GC give you a lower ceiling, but in the majority of systems you don't need that last bit of performance.
- xyzzy4747 4y agoBut those are instances where you can use TypeScript/node.js which is less verbose than Java and has better native async support. Also easier to write tests for. Also VSCode with Rust Analyzer works decently as an IDE.
- rockwotj 4y agoCertainly not knocking rust analyzer – it's great! I think the missing piece of node versus Java is Java has first class support for threading, so I guess it depends if your system is IO or CPU bound, but for CPU bound systems, Java is certainly better than node. My naive understanding of Java's Jit and nodes jit is that Java's has more optimizations for CPU bound workloads, where a lot of v8s optimizations have gone into faster parsing and initial loading because that's an important use case for the web compared to Java which is mostly optimizing for the server use case at this point.
- xyzzy4747 4y agoIf it was CPU bound and multi-threaded then wouldn’t Rust be a lot better? Since it has no runtime or garbage collection, in addition to having good built-in thread safety. Hence my original point.
- rockwotj 4y agoSure, but my point is that it's slower to develop the equivalent Rust than Java