6
jestdotty
19h

what I want is for AI to spot logical inconsistencies in my code and debug it

specifically a complex multi threaded form...

raaghhh

stupid tokio having no damned mutex debug tools

Comments
  • 1
    For every language in exception of Rust (reason is obvious) you have https://codebeat.co/.
  • 5
    I know this doesn't help much but when you're wrapping a bunch of stuff in mutexes, it's often not a great idea

    For very multithreaded code I think a more actor-ish approach works best where you send "messages" to each other instead of locking global datastructures

    For less multithreaded code it's often best to have your data be owned by a "context" object or something inside a slotmap and only reference the objects with indices. This way, instead of Arc<Mutex<T>>, the ownership is so much simpler since it's now all just dependent on the context object. Then you can pass that context object as a reference down the call stack

    Doesn't always work of course, but just some of my thoughts. Code architecture in Rust is hard!
  • 1
    @12bitfloat that's an idea

    fuck

    cuz currently I even wrote load balancing code with mutexes

    fuck

    and ofc it's not perfectly optimal because it's checking things all the time

    ragh

    rewriting this AGAIN would be such a production 😭
Add Comment