I understand his rant, but I don't think it is a valid one. You must change your design or change your tool, he opted to change the tool.
Why I’m dropping Rust
11–20 of 164 posts
Re: Why I’m dropping Rust
#12The author seems to be confusing typeclass composition with OOP. They are only topically similar. (Personal opinion; typeclass composition is more principled than OOP, but a bit more rigid, which he is running into.) There are several good ways to do this with type classes/traits. One way is to write a function font_size : Widget t => t -> FontSize And then in the widget definition have the "internal" font size defin…
I really like traits/type classes over OOP-style type systems but sometimes it causes a bit of impedance mismatch.
Re: Why I’m dropping Rust
#13The author seems to be confusing typeclass composition with OOP. They are only topically similar. (Personal opinion; typeclass composition is more principled than OOP, but a bit more rigid, which he is running into.) There are several good ways to do this with type classes/traits. One way is to write a function font_size : Widget t => t -> FontSize And then in the widget definition have the "internal" font size defin…
Re: Why I’m dropping Rust
#14Re: Why I’m dropping Rust
#15Rust seems to be a poor match for the way the author wishes to solve this particular problem. That doesn't mean that their design is wrong, or that Rust is wrong, but it does mean that mixing the two would require rethinking parts of the design. > So a trait can define abstract functions, but can't access any underlying fields. In Rust, a trait is a purely abstract interface to a type. It explains how you can use tha…
> The usual solution is to put the cyclic graph code into a library, and to use pointers and about 20 lines of unsafe code. It's not much different from the C++ solution. Well, petgraph uses vectors and indices to avoid unsafe code, and it's the most popular graph library on crates.io. Really, the answer here is "use a graph crate on crates.io". If you don't know which one to use, the best answer is probably petgraph…
Like someone else said recently, it's a problem if you can't reasonably teach a basic computer science course in Rust.
Re: Why I’m dropping Rust
#16I think it would be fair if you also would disclose that you are working in Mozilla and that you are directly connected to Rust when defending it on HN.
It's just fluff.
Re: Why I’m dropping Rust
#17I think it would be fair if you also would disclose that you are working in Mozilla and that you are directly connected to Rust when defending it on HN.
Re: Why I’m dropping Rust
#18That's a great question! So, uh, what is the answer?
Re: Why I’m dropping Rust
#19Earlier quoted context omitted.
> The usual solution is to put the cyclic graph code into a library, and to use pointers and about 20 lines of unsafe code. It's not much different from the C++ solution. Well, petgraph uses vectors and indices to avoid unsafe code, and it's the most popular graph library on crates.io. Really, the answer here is "use a graph crate on crates.io". If you don't know which one to use, the best answer is probably petgraph…
> Well, petgraph uses vectors and indices to avoid unsafe code, and it's the most popular graph library on crates.io. Nice! I hadn't seen that yet, but it looks really interesting: http://bluss.github.io/petgraph/doc/petgraph/graph/struct.Gr...
Re: Why I’m dropping Rust
#20I think it would be fair if you also would disclose that you are working in Mozilla and that you are directly connected to Rust when defending it on HN.