Rust is Memory Safe

fn main() { let foo = "Hello, use after free!".to_string(); match () { () if bar(foo) => { unreachable!(); } _ => { println!("{}", foo); } }}fn bar(_: T) -> bool { false }

play.rust-lang.org/?gist=11b8cb9088b0f8c36048a54ee293f537
RUSTFAGS ON SUICIDE WATCH!

Other urls found in this thread:

play.rust-lang.org/?gist=11b8cb9088b0f8c36048a54ee293f537
en.wikipedia.org/wiki/Ada_(programming_language)
en.wikipedia.org/wiki/SPARK_(programming_language)
en.wikipedia.org/wiki/D_(programming_language)
en.wikibooks.org/wiki/D_Programming
github.com/rust-lang/rust/issues/29723
web.archive.org/web/20170116045418/https://www.tiobe.com/tiobe-index/
reddit.com/r/rust/comments/7303zl/on_integer_types_in_rust/dnmvhul/
twitter.com/SFWRedditGifs

realistically, that is never going to happen.
mods please delete

>play.rust-lang.org/?gist=11b8cb9088b0f8c36048a54ee293f537
WEW


Also isn't Steve Klabnik one of the CIA niggers who tried to EEE gnu social with the witchestown.social blacklist ?

Is this one of those esoteric languages that are write only?

what do you mean with that?

I don't know much about Rust but it looks like a slightly more readable version of Brainfuck imo.

Brainfuck is memory safe though. Rust, as demonstrated, isn't.

Nothing new. Just a meme language with strong SocJus beginnings. When you think Rust, you should think pics related. That's why I think it's being heavily pushed in the tech circles now; it's a monument to the new social order and thus a memetic victory.
Everything Rust claims to do has already been done and compiles to machine code which runs at near-C speeds:
en.wikipedia.org/wiki/Ada_(programming_language)
en.wikipedia.org/wiki/SPARK_(programming_language)

DON'T BUY THIS SOCJUS MEME GARBAGE, SAFE LANGUAGES FOR CRITICAL SYSTEMS HAVE EXISTED FOR DECADES.

flavor of the month languages never

Proof that Rust == those pics. Here's Klabnik himself!

THE TIME HAS COME
DAY OF THE CAN

...

DAY OF THE SPRAY

(checked)
How damaged of a human being do you have to be to pretend to be this?

XDDDDDDDDDDDDDDDDDDD
kys
kys
kys
XDDDDDDDDD

...

XDDDDDDDDDDDDD
kys
kys
kys
XXXXXXXXXX

...

...

h8chan is not and will never be SJW safe!

I'm saging because I'm hatespamming the klabnik faggot but I don't want to bump the thread to the top. How new are you?

How pathetic is your life?

Very pathetic. I could use a friend, want to join me?

Snake oil programming confirmed. LOL rust nigger btfo.

You forgot D
en.wikipedia.org/wiki/D_(programming_language)

(checking these doubles)
en.wikibooks.org/wiki/D_Programming

D isn't in the same class as it's pretty much unusable without GC and GC is a non-starter for most systems work.

Can someone explain to me what the hell does OP's unreadable Rust code actually do? And why it's a problem? Thanks.

t. a retard who only knows C++98

It has perl-like semantics of functions returning the value of the last statement without an explicit "return", except the whitespace between ; and } is also considered a statement. Does that answer your question?

1: allocate a string
2: free the string
3: use the string
all without the use of unsafe, which means that rusts memory safety guarantee was broken.
fn main() { let foo = "Hello, use after free!".to_string(); match "this doesn't matter" { // _ is a special pattern that matches everything _ if always_false_also_free_the_string(foo) => { unreachable!(); } _ => { println!("the string was freed: {}", foo); } }}fn always_false_also_free_the_string(never_used: String) -> bool { drop(never_used); // frees the string false}

...

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/rust-lang/rust/issues/29723

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.

Something like Regex is a good example of a "write only" language/syntax.

Welp fuck rust then.
T.rustfag

Ada was never popular you faggot retard

You can do memory allocation in D, you would know if you read the wiki page.

web.archive.org/web/20170116045418/https://www.tiobe.com/tiobe-index/
See under "Very Long Term History". It was popular in the early/mid 90s according to the metrics used by TIOBE. You're probably just mad because Rust has dropped almost entirely off the list in the last few months. :^)

Ada isn't popular because kikes want goyim to use unsafe lanugages as to make hacking easier for (((them))).

Pretty sure the stdlib uses GC.

you're retarded

REALLLY makes me think

Damn, so much for it being a language death-knell...

So, wait, while they were being annoying as hell, their language have had this thing open for years?
Are you fucking kidding me? What the fuck dude, these people are literally retarded. Their language is ugly as fuck but I at least believed it was impossible for stuff like this to happen because their language was so safe or wathever, but they don't even have that thing for them going? What a bunch of retards.

It's an implementation error, not a soundness error in the borrow checker.

Not that it matters. Steve Klabnik is a faggot.

It doesn't matter. One thing is claiming infalibility and not knowing about a mistake and prombly fixing it. Another is having a mistake for years and bothering everyone relentlessly day in and day out about perfection.

The first one is merely bad and stupid, but the second is fucking criminal. There are commits about the importance of language not being opressive when naming some function that are closed BEFORE this has been closed.

Not only that, they're arguing dereferencing into undefined memory isn't a high priority bug for their memory-safe language. What a fucking memelang.

You mean calling things the floor type instead of the bottom type isn't at the top of your list of important things???

reddit.com/r/rust/comments/7303zl/on_integer_types_in_rust/dnmvhul/

holy fuck

I'd anything where you know the size, type, and sign from the name is good enough, and if the name doesn't consist of multiple parts it's perfect.
So no "unsigned long long" types, but at least in C you can use uint64_t instead.

It's because Ctards have huge egos. Ctards say that C was the "foundation" of programming. When you realize that Ada 80 and 83 weren't influenced by C at all, it reveals the truth that C wasn't a foundation at all, had no new programming concepts, and its influence has been mostly negative. This is why they whine about languages not based on C, like Ada, Fortran, and Pascal. It's not because they "can't read" it or because it "takes too long to type", it's because you're using something with no C influence, reminding them that C wasn't important.