6
jestdotty
113d

every time I run into some issue in rust and spend days googling and asking a billion AI chat bots turns out it was rust that was wrong

I'm so exhausted

do they have brain worms

nobody considers "hey maybe this feature isn't in yet" (and actually they'll argue against it being a feature and you should feel bad at coming up with it)

they're just like "you're doing it wrong!"

YOU HAVE ALL THE INFORMATION TO INFER THE TYPE AND YOU DID INFER THE TYPE YET YOU TELL ME I NEED TO ANNOTATE THE TYPE BUT YOU'VE INFERRED IT AND YOU CANT TELL ME WHY I NEED TO ANNOTATE IT

And I love how suddenly you can convert a Result object using `as` which is a keyword reserved only for primitives, so say the docs... and it works (and works at runtime as well). because the type was never wrong. you fucking inferred it. but you're bitching at me that you need an annotation. when you don't.

remember when languages were made by people that actually liked coding instead of this clout-chasing nonsense. that's what I'm blaming this on

Comments
  • 6
    Laughs in C++ fuckery !

    reinterpret_cast< to any fucking thing >( from any fucking thing );

    Probably apples and oranges, but yeah...
  • 2
    @Demolishun but see it at least makes sense

    rust is a straitjacket

    so then you should hack the fucking system? fuck's sake design it consistently!
  • 2
    @jestdotty I haven't Rust yet, so I don't know first hand yet.
  • 2
    Rust has reinterpret_cast, it's called transmute, just the docs appropriately indicate that you should never ever ever use it for any fucking reason. Not because it's a bad implementation but because what these functions do should never be done by anyone for any reason ever.
  • 2
    @lorentz so basically only embedded programmers. Which aren't real people anyway.
  • 2
    @Demolishun Not even embedded programmers should use transmute. If you want to cast between number types, cast through a fixed size array and let your optimizer eliminate the array. If you want to cast a bitfield then you can use the crate of the same name, which probably does it better than you. And it still doesn't need transmute because you can just use a fixed size array.
  • 1
    @Demolishun Is there a third use case for reinterpret_cast that I don't know about?
  • 1
    @lorentz I don't know. I think I have used reinterpret_cast once or twice. It was for working with a C framework to pass pointers to objects that got passed inside the framework. Which used void pointers. reinterpret_cast was more explicit and showed intent better than old style C casts. This aided in hiding all the C dirty secrets inside a C++ wrapper.
  • 1
    @Demolishun dayum! I recall doing it as well. That was horrible! Thanks for the flashbacks!
  • 1
    @Lensflare the "best" part. The C code is new, and so is the C++ code.
  • 2
    @Demolishun ah, that's just an as cast, no issue then. reinterpret_cast feels like hunting ducks with a nuke though.
  • 0
    @lorentz okay, I am going to use that analogy. Thank you.
Add Comment