3 ms·
I'm not convinced that the problem is all that more difficult than for Java. Rust is pretty strict about requiring either the trait being implemented or the thi
by slaymaker1907 5y ago
I'm not convinced that the problem is all that more difficult than for Java. Rust is pretty strict about requiring either the trait being implemented or the thing the trait is being implemented for to be defined in the declaring module. Additionally, Rust is conservative in requiring "forall" trait implementations to never come into conflict. The compiler does not allow multiple "forall" trait implementations if it is possible for code not yet written to satisfy both implementation requirements.
The bigger issue is that the number of implementers for certain traits is going to be huge due to broad "forall" implementations. Instead of doing that, you can just list out actual implementations and condense the "forall" implementations into one node. In practice, I have found it pretty easy to figure out what code implements what interface, particularly if you build the docs for your own crate.
- j-pb 5y ago> I'm not convinced that the problem is all that more difficult than for Java. Turing complete type system + turing complete macro system => you gotta run (compile) the thing to see what it does or is (Rice's theorem). For a language like Zig, which also has a turing complete compilation step, due to it's comptime sytem, this limitation also applies, but Zig mitigates this with insanely quick compile times. So for these multi project analysis to work you either need to have a very syntax heavy language (Java) or a fast compiler (Zig). Although the latter doesn't really have that strong of a type system in practice (though I think you could implement a datalog engine like rust has in comptime and do arcane type magic then ;) ). If you compile the packages yourself you can get rustdoc to provide you with the correct links, but then we're back to the manual labor part which I'd like to remove in order to get eco-system-wide docs.
- paavohtl 5y agoJava's type system is also turing complete: https://arxiv.org/abs/1605.05274 https://arxiv.org/abs/1605.05274