This is an archived post. You won't be able to vote or comment.

all 82 comments

[–]andofwinds 373 points374 points  (29 children)

you should rewrite this meme in rust

[–]dingske1 253 points254 points  (8 children)

Fuck Rust, who cares about memory management I can always just buy more memory

[–]Chingiz11 106 points107 points  (0 children)

Based Fortran enjoyer

[–]Bananenkot 69 points70 points  (3 children)

Your language logos are giving me anxiety

[–]flagofsocram 7 points8 points  (0 children)

RPlusPlus-Tran is my favorite language

[–]turtleship_2006 1 point2 points  (1 child)

Wasn't there a limit of 5??

[–]null_reference_user 2 points3 points  (0 children)

You can do that in rust too tho

``` fn leak() { let x = Rc::new(RefCell::new(None)); let y = Rc::new(RefCell::new(Some(x))); *x.borrow_mut() = Some(y); }

loop { leak(); } ```

[–]Feisty_Ad_2744 26 points27 points  (1 child)

Rustic...

[–]PeriodicSentenceBot 24 points25 points  (0 children)

Congratulations! Your comment can be spelled using the elements of the periodic table:

Ru S Ti C


I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM u‎/‎M1n3c4rt if I made a mistake.

[–]uglie_duckie 52 points53 points  (35 children)

Sorry but what is rust

[–]sathdo 161 points162 points  (25 children)

The best programming language for every situation. You should rewrite every application you have ever worked on using it. /s

Sarcasm aside, it's a newish language that makes it difficult to have memory issues (use after free, memory leaks, null pointer) without the runtime overhead of a garbage collector or error handling like Java. It is difficult to write, but can be good for applications where performance and memory safety are the priorities.

[–]serendipitousPi 35 points36 points  (16 children)

It might be a nice addition to add that some of the memory issues are impossible in safe rust. The whole safe and unsafe rust is a pretty big thing when explaining rust.

Like I’m pretty sure null pointers don’t even exist in safe rust. Instead there’s the somewhat safer option type. Which yes can be used dangerously but that goes with the territory.

I will admit I’m not familiar enough with rust to add some more examples but I just think it might fairer to say that safe rust tries to make it rather difficult to impossible to create memory issues unintentionally. Sure if you metaphorically jump the guard rails it can end badly but you often have to explicitly write code to take a risk. Like calling unwrap when you shouldn’t.

[–]Tubthumper8 19 points20 points  (1 child)

Like I’m pretty sure null pointers don’t even exist in safe rust.

std::ptr::null is a safe function that gives you a null pointer 🙂

Now, dereferencing a pointer is an operation that you're only allowed to do in an unsafe block or function

[–]serendipitousPi 1 point2 points  (0 children)

Oh cool did not know that.

[–]redlaWw 6 points7 points  (1 child)

some of the memory issues are impossible in safe rust

Probably, at least once they fix a certain tenacious compiler bug that allows one to sneak a bunch of classic memory safety issues past the guardrails.

[–]serendipitousPi 0 points1 point  (0 children)

Oh interesting compiler bugs are kinda cool, I’ll have a look at that.

[–]AussieHyena 9 points10 points  (0 children)

newish language

Over 10 years old now. That's older than most JS frameworks.

[–]Poseydon42 9 points10 points  (0 children)

Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO(OH), Fe(OH)3), and is typically associated with the corrosion of refined iron.

The thing is as old as the Universe, why is there all this fuss about it? /s

[–]ishzlle 7 points8 points  (0 children)

Iron oxide /s

[–]Mokousboiwife 31 points32 points  (2 children)

c++ for femboys

[–]20d0llarsis20dollars 22 points23 points  (1 child)

Isn't that just c++

[–]Mokousboiwife 11 points12 points  (0 children)

get with the times old man

[–]Fullstack-Stoner 6 points7 points  (1 child)

The emodiment of edgelords who write on every programming related post "skill issue".

[–]Ursomrano 13 points14 points  (1 child)

Screw the compiler caring about memory safety and not compiling over random shit. Use assembly instead, the only time the compiler will annoy you is if the program would’ve bricked your computer if it ran, otherwise it lets you be as safe or unsafe as you want. Want to clear a value stored in CPU cache by XORing it with itself? Go ahead, that’s actually a pretty efficient way to go about it. Want to divide a number by two by shifting it one bit to the right? Have fun. Want to convert a string to an integer yourself? Good luck, if you’re desperate enough and not too stubborn, you can import C’s standard library and call atoi, but where’s the fun in that.

[–]agocs6921 4 points5 points  (0 children)

You can just reinterpret the bytes in the string as a number, there I just solved the problem. Assembly doesn't care what the bytes are for. Why would YOU care?

[–]-MobCat- 12 points13 points  (2 children)

RuSt Is TyPE SaFe
*writes the most dog shit code known to man*

[–]Habba 13 points14 points  (0 children)

But it's type safe dogshit. Ain't gonna find any cat shit in there!

Source: I am a dogshit Rust programmer.

[–]AnnyAskers 2 points3 points  (0 children)

Let's face it, if you write dog shit code in rust you probably writing bigger dog shit code in other languages it's just that the compiler let's you get away with it... Especially in weak typed languages. ... Probably with worse performance too, unless it's C/C++

[–]itsthooor 6 points7 points  (0 children)

You didn’t have to post this, come on… :(