...
Rust is Memory Safe
Thanks for the explanation but I have a question: how come the original code frees the string without using "drop"?
Also won't they be able to patch this out somehow?
the explicit drop call is not neccessary, because ownership is given to the function bar/always_false_also_free_the_string. once the function returns, the string is dropped since nobody owns it anymore.
yes. github.com
I could not understand shit as well, user. That's how you know a language has shitty syntax - when people who have been programming in several other languages cannot decypher it. I hope that's just some minified piece of code and it doesn't look like that by default, because even Perl makes more sense than this obfuscated shit.
Also - is this a bug in the garbage collector? I think you can purposely find a way to crash the stack no matter which language you choose. Retarded coding > garbage collectors and always will be.
Ada is solid, it is being used in the aerospace field. I don't understand why it never became popular, though. It was named after 'the first female programmer' which should fit the sjw narrative.
...
rust has no gc
Here is the thing, Rust doesn't have one, Memory safety is enforced at compile time. That's why it takes longer than most other compilers.
OCaml-ish syntax would look a lot better.
let main() = let foo = to_string("Hello, use after free!") in match () with | () when bar(foo) -> unreachable!() | _ -> println!("{}", foo);let bar (_ : 't) : bool = false
it literally is the same but without curly braces
Ada was very popular in the 90s, around the 3rd most popular language by some metrics. At some point around 2000 or so everyone decided they liked segfaults too much and piled back on the C/C++ wagon.