Rust is more like: unless you can mathematically prove to me that this is equivalent to a nut there is no ducking way I’ll ever let you compiled this.
And then still segfault
https://github.com/Speykious/cve-rs/blob/main/src/segfault.rs
To be fair, you are doing something wrong if you’re app segfaults no matter what anguage you wrote it in…
It actually is possible to segfault in safe Rust, although it is considered a bug. Proofs of concept are shown in this cve-rs crate.
If you want an explanation of why this happens, I recommend this video: https://youtu.be/vfMpIsJwpjU
IME Rust programs crash at about the same rate as other languages. “Rewrite everything in Rust” hasn’t made much of a difference for me, so far.
Have you really used Rust or are you spreading FUD? I have not managed to cause even a single segfault in my 8 years of writing Rust code. Nor have I heard anyone else complaining about it, other than deliberately as proof of concept.
Why are you getting downwoted man, getting segfaults in safe rust is on compiler not us. When you segfault in C and such it’s almost always your fault, if you manage to do that in rust it’s a bug in compiler.
StackOverflow: Question closed as duplicate. Someone else already asked whether or not something is a nut.
Seriously, i just googled how much energy would be needed to put 1Kg in LEO. Ofc there’s a StakOverflow to it asking the same question and none of 4 answers answer the question and one is like “This seems like a complicated way of doing it. Instead of asking the minimum energy…”.
Java: “Sorry, but the developers of Peanut
didn’t declare it to implement the Crackable
interface, even though it has all the relevant methods, so if you want to treat it like a nut your choices are write a wrapper class or call those methods using Reflections”
Swift’s extensions system has spoiled me, and I feel the pain of this whenever I have to write Java
Ditto, but Rust’s traits. God those are so fun. It’s like duck typing a la Python but you can just slap whatever methods you want on a foreign type without worrying about breaking anything because they’re only visible to the current crate (or other crates that import the Trait)
C# should actually be “What Java said, except it’s ICrackable
”.
No, actually C#'s answer should be: “What Java said - hold on, what Python said sounds good too, and C++'s stuff is pretty cool too - let’s go with all of the above.”
C#, or as I like to call it “the Borg of programming languages”.
I got my first software developer role last year and it was the first time I’d written C#, I was more TypeScript. Now we use both but I must say I really like C# now that I’m used to it.
I think most programmers would like C# if they spent time with it. It is getting a bit complex because the joke about it over borrowing from other languages is on the money. It is a nice language though and pretty damn fast these days all things considered.
even nicer is F#. join us brother, you can do everything that you can do in C# but better
In Java, it’s not called the Crackable
interface.
It’s the Nuttable
interface.
Provided your method specifies a strongly bound type you can ensure that you get your nut.
void dischargeNut(T extends Nut) { ... }