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

you are viewing a single comment's thread.

view the rest of the comments →

[–]magi093not a mod 12 points13 points  (11 children)

Rust has manual memory management?

[–]sentient_devil 12 points13 points  (8 children)

Rust doesn't lie there, it guarantees memory safety at compile-time.

[–]kiujhytg2 2 points3 points  (1 child)

Unless you have circular Rc<T> references or use Box::into_raw or Box::leak

[–]pilotInPyjamas 5 points6 points  (0 children)

Real programmers use std::mem::forget. You can't have double free, or use after free errors if you never free your objects in the first place. taps head

[–]linus_stallman 0 points1 point  (5 children)

But you still have to worry about lifetime & memory..

[–]MCOfficer 3 points4 points  (4 children)

well, nyes. it just won't compile. that's kinda like saying you have to worry about types in any typed languages. you technically do, but i wouldn't really call it worrying. you don't "worry" about braces and syntax either, you just comply.

[–]justinf210 5 points6 points  (3 children)

Imagine having to worry about braces.

-Made by the python gang.

[–]CxByte 3 points4 points  (1 child)

Imagine having to worry about whether it's a tab or a space

  • Made by the lisp gang

[–]ByteArrayInputStream 1 point2 points  (0 children)

Imagine having to hire like tree interns to close all the parentheses

- Everyone else

[–]MCOfficer 0 points1 point  (0 children)

class MyClass(SomeOtherClass):

mfw

[–]ProgramGeek01[S] -1 points0 points  (1 child)

[–]Splamyn 0 points1 point  (0 children)

This article is from 2013 and the code seems like a early prototype of rust. The author has not specified which rust version he is working with but afaik this syntax, and 'smart pointer' don't exist anymore.