3 ms·
I don't disagree on the header files, no sane language designed today would include that. > Java (production implementations used in practice) performs whole p
by flukus 10y ago
I don't disagree on the header files, no sane language designed today would include that.
> Java (production implementations used in practice) performs whole program optimization via its JIT. It's nice for Java, but that isn't how Rust works.
Whole program optimization isn't generally something you want on dev builds, which is where incremental compilation is useful. For a production build why wouldn't you do a full rebuild anyway?
- pcwalton 10y ago> Whole program optimization isn't generally something you want on dev builds, which is where incremental compilation is useful. By "whole program optimization" I also include things like generic/template instantiation. Whenever you use, say, a HashMap, you have to recompile the implementation of the HashMap specialized to the size, alignment, destructor, etc. of types you're using with it. > For a production build why wouldn't you do a full rebuild anyway? When I profile apps written in Rust, it's important for me to be able to get good turnaround time on optimized builds.
- enitihas 10y agoDo Java generics work like that? I thought the JVM did not know about the generics as the types are erased at compile time.
- eonwe 10y agoJVM doesn't know about generic types at the runtime. There's no specialization of HashMaps, it's just arrays of points to objects all around. With project Valhalla: https://en.wikipedia.org/wiki/Project_Valhalla_(Java_language) https://en.wikipedia.org/wiki/Project_Valhalla_(Java_languag... there's been talk about specialization for value types.
- enitihas 10y agoI too thought the same. That's why pcwalton's comment confused me.
- pjmlp 10y agoIt is already available for those that want to play with it. https://adoptopenjdk.gitbooks.io/adoptopenjdk-getting-started-kit/content/en/openjdk-projects/valhalla.html https://adoptopenjdk.gitbooks.io/adoptopenjdk-getting-starte...
- pcwalton 10y agoRust generics do. Java's don't.