7
retoor
3d

If you don't use AI for coding you're a kinda dinosaur. Cute, but that's all

Comments
  • 2
    o1-preview can answer questions

    gpt makes up answers

    like I asked it if you could look up if a hashset contains a hash in rust and it made up some dumb garbage that violates types

    o1-preview said no. though technically you could do it with unsafe code

    sigh. my ideas never work out in rust

    I didn't wanna use a hashmap. I just wanted the values to auto index and overwrite if existing. therefore hashset, yes? but then turns out I had a need to check if a key was unique somewhere else because of a bug someone else was handing me that was giving me values as new when they weren't new. so I needed to check if I already had the value in the set. but without doing expensive lookup stuff to make the object that's in the set. well fuck you I guess
  • 1
    @jestdotty Imagine that @SidTheITGuy was making fun of the 'thinking' of o4. You would think he would gain some experience before bashing it. The differences are big. Upgrade Sid, dinosaur :p * pet pet pet *

    @jestdotty it should have a upsert function that inserts if not exists yet. The thing you had to build yourself now. I think in low level languages they give you the bare minimal to work with. Bit weird because rust kinda feels high level with such std. Pick a side.

    Preferably you would extend the original HashMap thingy and overwrite the set functional that doesn't check 'get' value right? Can be fun?

    Maybe try your projects in C++, maybe it makes more sense. Would be interesting, a set of projects made with both languages with a summary of the experience
  • 0
    @jestdotty I mainly use for formatting / renaming and autocomplete. Barely use chat. I do often select code, do some ctrl+I and magic appears
  • 0
    @jestdotty what would be the name of a handicapped dinosaur in this case? I think the typosaurus
  • 1
    I don't think "AI" can build low-level code and work with off the shelf hardware which I enjoy doing, working with relays and sensors, robotic systems, and putting it all together, my next major project maybe a flight simulator (I'm still thinking about it), I wanted to build a simulator years ago but the hardware wasn't good enough.
  • 1
    @bazmd I'm sure AI can even help with that. It knows that if you just defined x, that you want to reuse x as parameter and stuff. It'll surprise you. If it's wrong, you type ahead. Try codeium, totally free, great performance.

    What hardware do you use for your simulator?
  • 4
    i'll stay cute :3
  • 1
    @jestdotty If you want to know whether an element is in a hashmap you have to do a lookup.

    you can use get_or_insert or one of its variants to only insert a value if it's not already in the set. If there's any meaningful difference between the two candidates but they compare the same and hash equal then that's a weird enough hack already that I think just checking the value in the set afterwards to see which one it is is a reasonable counterhack.

    If you can still change datastructures, consider switching back to a HashMap<T, ()> and using get_entry_mut.
  • 1
    @feuerherz and that's 'all'. You're the cutest tho 😁
  • 1
    @retoor If you look up Robospot, the idea is similar to that, except the servos have to take the weight of a person sitting inside it and be powerful enough to move it, LED screens have brought the weight down too and can be built into the simulator, even with the most basic controller board it can be programed just as easy as a robotic lighting system or a large telescope, I would have no trouble building a prototype with a local engineering company that I worked with on another project. They would build the frame, mountings and chassis, it would be built like an aircraft, I have lots of ideas about it...
  • 1
    > "I mainly use for formatting / renaming and autocomplete. Barely use chat. I do often select code, do some ctrl+I and magic appears"

    > "it's thinking omg!!"

    You just backtracked all the way to the start on the Gartner hype cycle?
  • 0
    @Hazarth I've just researched the gartner hype cycle and its key phases and do not understand your point :) But backtracking is fun, so yeah, totally did that!
  • 1
    this is stupid
  • 2
    @retoor it means that everyone is going to be charmed by the "magical o1" until they are not... The same way people were totally salivating ober gpt3 and gpt4 at their individual release until, months later, people finally realized It's not all that and It's actually barely useful for anything. Not sure why we have to go through this again for o1.
  • 4
    Fuck AI, fuck your opinion.
    I'll be a stegosaurus!
  • 0
    @Ranchonyx no, no, no. You're a typosaurus now according to sophisticated research
  • 1
    @mostr4am anyway, talk to your dad. It's so long ago
  • 1
    No thanks. Every time I use it, it causes me more work than if I had just done it myself.
  • 0
    @lorentz there's still a difference between looking up if a key exists and also getting it's value (additional memory accesses etc)
  • 1
    @devRancid If you don't use the value, the load is optimized away. Rust is a static language that uses LLVM, you can count on these things. You always have to load the key because the same hasher state could be produced by a different key too.
  • 2
    I’m still resisting. I want to be the last dinosaur alive.
  • 3
    Eh, AI is sometimes useful for little self contained things I'm too lazy to write myself

    For actual programming work it's kinda useless since it doesn't know your code base and how everything should integrate
  • 1
    @retoor I just want things to work I don't have time to rewrite hashsets ffs
  • 1
  • 1
    @lorentz I'm saying without creating the object in the entry

    I have an ids hashset and I have a transactions hashset

    both struct types only hash on the id string (Id has more than the id string)

    if I want to know if data I pulled from a http API is unique I'd need to convert a id string to an Id type, and then make up a fake Transaction type just to check if I have that string hash in the ids or transactions hashsets

    so I want to just check with a hash if they're in the hashsets
  • 1
    @lorentz same hasher state could be produced by different types?

    I mean that should be very rare. if it's less rare then I guess everything should be a hashmap but then when I serialize to disk it'll be redundant
  • 1
    @jestdotty This really sounds like a hashmap from the data you're actually considering for equality to the whole object would be a better fit. Generally, equality should consider the whole object. It's not necessarily wrong if it doesn't, but it's a caveat to consider for further decisions because datastructures are designed with the assumption that equality is total.

    also check out the raw entry API that's available on unstable and in the Hashbrown crate. Hashbrown is identical to the std hashmap, it's literally imported by std, but std hides the raw entry API because it's kind of contract breaking.
  • 2
    @jestdotty Hashing in Rust just means deriving a value from every observable aspect of an object, hasher states can be small and in particular hashmaps usually use a very small hasher state and truncate it to an index anyway. A hashmap lookup involves jumping to that index, then going through every key with the same truncated hash and comparing each of them with the lookup key for equality.
  • 0
    @cuddlyogre your name is already cuddlyogre, that's fine. I don't have to invent a dinosaur name for you :)
  • 0
    You can also define a borrowed version of your object. If you implement Borrow and the equality traits, you can use the borrowed version as a lookup key. If you also implement ToOwned, you can use the borrowed version with get_or_insert and it'll be converted only if needed.
  • 1
    @Biggy oké, you're a capisaurus then
  • 0
    @jestdotty actually, check out HashSet::get_or_insert_with, it can be used for what you want. You can define a boolean flag and set it in the converter function to detect that the new value was inserted.
  • 0
    @12bitfloat you're totally, totally wrong. Not used AI for long time. I can imagine if you say code generation is useless, but it goes beyond that. The other two points are totally opposite. It knows your codebase and it predicts integration quite while. Use codeium for a a few hours and you'll proof me right. Until then, you're a resistosaurus.

    Not only AI will know your codebase, the whole world will know. Made possible by FREE AI 😂
  • 2
    @retoor I know all this about the Rust API because whenever I get stuck I scour the docs for the building blocks I need and learn a ton of unrelated stuff in the process.
  • 0
    @lorentz that's why I never read the docs, I'm never stuck!

    J/k
  • 1
    @lorentz guess I'm gonna convert to hashmap and just save redundant data to the disk

    I don't have the object to insert into the hashset which is why get_or_insert_with isn't applicable

    actually I could pull out Id's data to try not to duplicate it, I just worry if I don't keep the id string in the data type I might get them confused somewhere but that's irrational
  • 0
    @jestdotty A Rc/Arc maybe?
  • 3
    @lorentz I remember when I could straight up read the whole docs for 4 hours and remember everything

    now I get lost cooking so I had to take notes and mark the steps with checkmarks because brain damage -.-

    hopefully I'll recover one day...
  • 1
    I've tried chat, but not autocomplete. all the experiences I've had so far with AI were charming, but didn't have good results, so I'm not fully convinced it's useful.
  • 0
    @darksideofyay it's advancing rapidly. I swear by it now. Try codeium for vscode to get an up-to-date experience. The AI from previous month is not the AI of today. Much advancements.

    Main difference: normally a word is auto completed. Now it auto completes a line with your casing of variable names and most likely exactly the variables you want and maybe even the value you would expect. Tbh, it's freaking many times right. Almost magic. These are my stats: https://codeium.com/profile/... (One day i had 608!!! completions. I assume it only counts accepted completions, else it's nothing)

    But i have no idea what percentile means. I code freaking a lot, maybe i'm in top users or smth. Did had the plugin disabled for some reason i just found out.

    AI is worth it to retry from time to time
  • 0
    @darksideofyay

    Own example, it sees that this one is missing in the list and it auto completes the whole if statement. It even helps me prevent a mistake by forgetting it. it's free btw
Add Comment