5 ms·
Many great points. It is interesting to note that Rust IDE, when it comes, is most likely to have Java based GUI. > Both Rust and Java keep their generics to c
by geodel 11y ago
Many great points. It is interesting to note that Rust IDE, when it comes, is most likely to have Java based GUI.
> Both Rust and Java keep their generics to compile time.
I thought Rust generics are also available at runtime so they are different from Java.
- untothebreach 11y agono, you can have "trait objects" in Rust, which are boxed and use dynamic dispatch instead of static dispatch, but they lose the original type (type erasure -- another similarity with java :)), so they aren't true generics. For example, you could use the `Read` trait as a type: fn some_func(a: Box<Read>) { } but then only the `Read` methods would be available on `a`, you wouldn't be able to access methods from the original type of `a`.
- geodel 11y agoThanks. I need to spend time and learn Rust. The one thing stopping me is lack of some small work related project which I can try in Rust
- solidsnack9000 11y ago> so they aren't true generics. Why does type erasure mean they aren't true generics?
- whyever 11y agoThey don't lose anything compared to monomorphized templates. You can only access methods of the trait in both cases.
- shmerl 11y ago> it is interesting to note that Rust IDE, when it comes, is most likely to have Java based GUI. Why is that exactly? I personally don't like Java based GUIs. They are rarely integrated well with the base system. Qt comes closer to it.
- dikaiosune 11y agoAside from Visual Studio, the most promising IDEs to host a Rust plugin are IntelliJ IDEA and Eclipse. There's a page with some more general info about the efforts to make Rust IDE ready/friendly/available: https://www.rust-lang.org/ides.html https://www.rust-lang.org/ides.html
- shmerl 11y agoI'd prefer something like KDEdevelop, though to be honest I rarely use IDEs in general. Looks like they already have plans for it: > there are plans to integrate basic Go and Rust support. https://www.kdevelop.org/news/first-beta-release-kdevelop-500-available https://www.kdevelop.org/news/first-beta-release-kdevelop-50...
- lmm 11y agoKDevelop doesn't have such good support for advanced type systems (for the perfectly sensible reason that the languages it's usually used for don't have them).
- shmerl 11y agoWhat exactly do you mean by "advanced type systems"?
- lmm 11y agoGenerics (templates work differently), HKTs (not in Rust yet, but something a long-term tool would need to be aware of), general ADT stuff (sum and product types - emulatable with generics and polymorphism).
- shmerl 11y agoWell, C++ generics and templates are actually pretty advanced. So the fact that KDEdevelop was focused on C++ shouldn't cause this problem. May be it's just behind in that aspect, but not because of C++.
- masklinn 11y agoAFAIK Rust generics are reified (where Java's are erased with typechecks inserted in various places) so the "generic type" exists at runtime, but there's no RTTI so whatever does exist is inaccessible at runtime.
- deleted 11y ago[deleted]
- geodel 11y agoSo for users who mostly write enterprise type applications do Rust generics have anything better to offer compared to Java?
- masklinn 11y agoI don't think so, at least until specialisation lands. When used as generic constraints they're statically dispatched which might mean better performances, but I believe the JVM is pretty good at devirtualisation so YMMV… The only advantage I can think of is probably a lack of surprise when trying to use reflection and discovering your generic types are missing (but that's because there is no reflection in rust)