“Anything that can be written in Rust will eventually be written in Rust”

You are viewing a single thread.
View all comments
40 points
*

Someone has to explain how rm, which doesn’t allocate any memory (as far as I can tell), isn’t memory safe ?

permalink
report
reply
26 points
*

If I cant remember what dir I’m in, then rm is mot very memory safe is it?

[edit: spelling]

permalink
report
parent
reply
33 points
*
Deleted by creator
permalink
report
parent
reply
2 points

I guess vpr -x would be memory-safe that way then. ;)

permalink
report
parent
reply
7 points
*

I don’t know whether rm is memory-safe or not, but vpr is. By ‘memory-safe alternative’ I meant that this alternative is memory-safe, but not that rm isn’t.

permalink
report
parent
reply
42 points
*

Reminds me of when they started printing “vegan” and “gluten free” on water bottles.

permalink
report
parent
reply
2 points

ive heard they’ve even started putting halal water in my taps!

permalink
report
parent
reply
4 points
*

In GNU coreutils the implementation of rm doesn’t allocate memory however I believe alternative implementations do.

Here’s an example from the OpenBSD source code - https://github.com/openbsd/src/blob/222e275fb89ffb67abe0726dee2b107220092dc3/bin/rm/rm.c#L335

Presumably other *BSDs use something similar? Didn’t check out FreeBSD or anything.

Edit: So I suppose if you are using a BSD-type system (maybe including macOS?), and memory safety was important to you (to the point of extreme paranoia), then you might want to look into this rust project. Or just use the GNU implementation.

permalink
report
parent
reply

Open Source

!opensource@lemmy.ml

Create post

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

  • Posts must be relevant to the open source ideology
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

Community stats

  • 3.8K

    Monthly active users

  • 1.8K

    Posts

  • 30K

    Comments