1
lorentz
254d

Rust really needs an implicit Clone for lightweight operations like cloning an Rc, or a big fat warning sign at Copy telling programmers never to derive it for any custom type because if you ever have to remove it you will have to update every single occurrence of any value of your type.

Comments
  • 0
    @kobenz The Rust that guy wanted to make would not do what I want the language to do. If he had his way, I would be learning OCaml.
  • 1
    @kobenz I read it previously, it's been around a while. I'm grateful for his contribution to the programming world. This doesn't mean that I treat his opinion on language design as objective truth, let alone his preferences, which most of this article explicitly claims to be.
  • 1
    I'm not saying that language wouldn't be useful, just that it wouldn't fit my niche quite as well, so I'm happy the functional programmers had their way.
  • 1
    @kobenz At a distance it seemed like current Rust shares a lot of features with OCaml, many of which are my favourite features in Rust.

    But I'm not very fluent in OCaml because current Rust did what I needed it to do, so maybe I would've had to look further if he had his way. Either way, my point is that many of the major things he complains about were my reasons to learn Rust.
  • 2
    @kobenz That's a take I didn't expect to hear ever, I'd love to hear your reasoning.
  • 0
    i honestly love that it has no implicit clone. Makes me sometimes consider changing some minor things about if i want to borrow something or move it instead.
  • 1
    @thebiochemic For the most part it's good, yeah, but there are types - lots and lots of them in my experience - which are small and cheap to clone where this is completely wasted effort.

    In my case, the ref counters get optimized away hopefully anyway because most are passed in by reference and the local copies don't outlive the function.
Add Comment