• 0 Posts
  • 632 Comments
Joined 2 years ago
cake
Cake day: June 12th, 2023

help-circle




  • It’s because Rust is a significantly higher level language than C (and C++ gets held back by it’s C roots). In C there’s no such thing as a method, there’s only pointers. The closest you get to a method is a function pointer. C++ expanded on that with the concepts of class, object, and method, but stopped half way leaving an object and a pointer to an object as distinctly different concepts that are treated differently by the language. In order to do anything with a pointer besides change its address in C++ it must be dereferenced. The -> operator in C++ is really syntactic sugar for a dereference followed by a method invocation. In other words these are equivalent foo->bar() and (*foo).bar() as stated in the quote you provided. C and C++ treat pointers as their fundamental abstraction and treat everything as special cases of pointers.

    Rust in contrast treats Objects as first class abstractions. It doesn’t really matter whether you’re dealing with the owned object or a reference to that object owned by a different scope, in either case the compiler knows at compile time what its type is and what traits it implements. Given that knowledge whether the method is invoked from the owned instance or a reference it’s treated exactly the same. Further because pointers as opposed to references are treated as second class citizens (relegated to the “here be dragons” of unsafe), the concerns of C/C++ about distinguishing between a pointer assignment and a pointer dereference aren’t particularly important. In general the times you need to explicitly dereference something are far more uncommon in Rust, with the compiler generally being able to work out on its own when it needs to dereference something or not.

    The bit about the receiver just means that the compiler at compile time knows the actual concrete type of all references with the exception of dyn references which force compile time dynamic dispatch (in which case the compiler inserts and utilizes a vtable exactly like C++ does).





  • Well AMD just blatantly copied Nvidia’s naming scheme for their new GPUs so maybe they’ll copy Intel for their CPUs. I mean, they kind of already did, since the Ryzen 9 is basically i9, and the Ryzen 7 is basically i7 etc. It’s mostly AMDs mobile CPUs that have horrendous names, but Intel really isn’t much better in that department.



  • Well there’s basically two possible states. Either Luigi didn’t do it in which case the one who actually did is the hero and Luigi is just a proxy for this unknown individual, or he did do it in which case Luigi is the hero. Either way doesn’t really change the sentiment as at the end of the day someone who was actively making the lives of millions of Americans worse and directly contributing to many thousands of preventable deaths was killed. Who actually pulled the trigger is kind of immaterial.




  • No it’s not illegal to access the porn, the porn sites are just required to “prove you’re over 18” using an approved mechanism, which in practice means a scan of a state ID. Porn sites rightly don’t want to touch that kind of PII with a 100 foot pole so are just blocking all access instead. Technically, they attempted to comply with the law exactly as the law requires so nothing illegal has occurred. Basically it’s a giant waste of everyone’s time and the only lasting impact is that VPN companies are loving this.





  • What the fuck do they mean privatization, it’s already fucking private! Did we suddenly get a socialized healthcare system when I wasn’t looking?

    Could have saved a lot of time by just saying Trump plans to make one of the worlds worst healthcare systems even worse in whatever way he can. We’re well on track for a healthcare system collapse in the US if Trump actually implements the things he’s said he will. It will make a matched set with the economic collapse he’s also working on.



  • The bit that confuses me is how anyone got hit. Drones have this neat ability that if you just stop the propellers they drop like rocks. It’s pretty standard practice to not fly drones directly over people. In a drone show they shouldn’t have really been moving fast enough where horizontal momentum would account for much and in the event of a collision they should have just cut power to the drones. The only way I can figure for this to happen is either a) they didn’t follow basic safety precautions and were flying over the crowd, b) rather than cut power they tried to save the damaged and uncontrollable drones, or c) there was major radio interference and the drones aren’t setup to cut power when they lose signal and/or crash.