4
jestdotty
186d

Jesus fuck generic number adding in rust is pissing me off

why did I decide to do this

I literally don't have to

let's just add 12 traits and then find out it doesn't know how to divide by usize. well how the hell am I supposed to convert it then. there's no trait for "f64 as f32" so now my shit looks like spaghetti cuz of that, now this...

so let's see I could call into() on usize to get it to be unknown T number... but there's no way for it to know what to convert to and I can't determine if there's any way for me to tell it that

THESE STRAITJACKETS
I might just need a padded room at this rate
*goes to sleep* later

.... required for usize to implement Into<T> wat

😩
I suspect that's gonna be another dead end
GOod ErrOrS

Comments
  • 2
    Been there, more than once. It was NOT nice. Code looked so bad I never looked back afterwards
  • 2
    @kobenz THIS IS NOT INSPIRING HOPE
  • 1
    I'll preface this with, I write rust code daily and enjoy it;

    Rust is a pedantic bitch, always wanting her rules respected and if you dare to go against them it it will fight back.

    Just spent half of today trying to make some macros with a specific syntax - that was a fucking waste of time

    Yet when it compiles it just kinda works most of the time, pretty much the classic love/hate relationship.
  • 1
    @nemetepst "if it compiles it works" is a meme nowadays lol
  • 2
    @nemetepst that compiling and working thing makes me insecure as fuck

    I don't even have to check anything in my brain so it feels like I'm flailing through a dark endless fall in a dream

    I have trust issues with languages and I just can't do this 😭
  • 0
    @jestdotty Don't change your view on this, you are right - you should be feeling insecure with untested code.

    Anyone that says if it compiles it's fine is a retard, that's the nicest way I can put it.

    I should probably mentioned that I worked a lot with Java the past where you get fucked with exceptions at runtime.

    At least for me writing rust is more enjoyable than Java.
  • 2
    Y'all know, I used to get fucked all the time at runtime before functional programming. Nowadays I do all my personal projects with functional programming and, it might sound repetitive, but it all just works with barely any testing at all. I do however, spend a considerable amount of time profiling shit cuz it's a style of programming that generates a FUCKTON of garbage. Like, some serious memory spikes if you're not careful
  • 0
    @kobenz Yeah I feel you on this one, what lang do you primary use for your projects?
  • 1
    @nemetepst mostly rust
  • 3
    usually I scratch stuff in lua or typescript and rewrite in Rust afterwards. Though python would be better, editing python code is annoying as fuck since I write it rust-style. fuck, rust's pervasive
  • 1
    @kobenz lol, yeah... it's weird, I also noticed that my code in other langs is written more in rust style over the time.

    This is my love/hate relationship with it, sometimes you need a padded room to write it and yet I'll miss it when using other langs :/
  • 1
    @jestdotty The error reporting around the conversion traits is honestly embarrassing. I get that the compiler doesn't want to recursively walk a graph because it's very easy to introduce regressions in behaviour like that, but the error reporter could very much walk that graph to produce the most useful error possible.
  • 1
    @nemetepst right?! Shit like pattern matching, geez I use it everywhere and if it's missing from the language I either implement my own or burst a vessel trying

    ---

    Golang's a classic example. The amount of time I've cracked a nut trying to write it like Rust is of ocd-like procrastination
  • 1
    @lorentz I think if Rust had HKTs that wouldn't even be an issue anymore
  • 0
    @kobenz We just wouldn't need conversion traits as often.
  • 0
    @lorentz we'd have type holes, bro, type holes 🥲
Add Comment