Originally posted by krzyzowiec
View Post
Rust-Written Replacement To GNU Coreutils Progressing, Some Binaries Now Faster
Collapse
X
-
-
-
Originally posted by jacob View Post... You are assuming that anyone who doesn't agree with you doesn't "see" it. ...
Simplicity is what allowed C to prevail. It allowed having different compilers from competing makers and different versions of the language over time, and it still manages to produce runnable code. C has always been diplomatic with its environment. You will never have this with Rust. Rust alienates its environment as a principle of its existence.
Comment
-
-
Originally posted by MadCatX View Post
At least some of this stuff is allowed because it was expected to interact directly with hardware in C programs. Volatile variables, for instance, can be set by some HW device instead of the program. You can also set variables or return values from inline assembly instead of C. This all made sense when you programmed your C64 in 1983 but is mostly obsolete in 2022.
And we programmed our C64's in assembly back then, not C.Last edited by Raka555; 31 January 2022, 10:48 AM.
Comment
-
-
Originally posted by MadCatX View PostAt least some of this stuff is allowed because it was expected to interact directly with hardware in C programs. Volatile variables, for instance, can be set by some HW device instead of the program. You can also set variables or return values from inline assembly instead of C. This all made sense when you programmed your C64 in 1983 but is mostly obsolete in 2022.
There's another thing at play here, btw.: While Rust is a multi-paradigm language, it's much closer to functional syntax than C(++) is.
Comment
-
-
Originally posted by Danielsan View PostSo Rust it is just the excuse to erase the GPL from the "GNU Coreutils" and to leave just "Coreutils". Genius!
Security wise, everyone is better off the more we can get the C programming language *off* of store shelves.
Comment
-
-
Originally posted by soulsource View Post... it's far more common that one forgets to initialize a variable although one wanted to, than that one needs an uninitialized value. ...
What does help is to warn programmers of uninitialized uses, because by some chance might they look at their code again and they might spot the problem, which can be a completely different one, i.e. a misspelled name such as using i instead of n. However, forcing programmers to always initialize their variables only removes the chance for them to get this warning. They will simply initialize all variables, and as a result, will the compiler throw fewer warnings and produce seemingly working code, but it may not actually work correctly and the programmer has no clue as to why.
Comment
-
-
Originally posted by sdack View PostUnless there is proof of GNU Coreutils actually being unsafe is the project a waste of time. It would be better to improve GNU Coreutils directly than to have yet another clone or fork of something with an unproven claim on it being supposedly safer without ever providing hard evidence.
Comment
-
-
Originally posted by sdack View PostForcing programmers to initialize variables is not the same as forcing them to program correctly. It only forces them to assign values to their variables and it often ends being 0. The real problem is that when a programmer forgets to initialize a variable before using it, then it really means that he forgot what value it has by the time he is using it. It there matters little whether the variable was initialized with a 0, 1, has a random value, or is uninitialized.
This is very similar to the concept known as "const correctness" in C/C++, with the main difference being that it's the default behaviour in Rust.
Originally posted by sdack View PostWhat does help is to warn programmers of uninitialized uses, because by some chance might they look at their code again and they might spot the problem, which can be a completely different one, i.e. a misspelled name such as using i instead of n. However, forcing programmers to always initialize their variables only removes the chance for them to get this warning. They will simply initialize all variables, and as a result, will the compiler throw fewer warnings and produce seemingly working code, but it may not actually work correctly and the programmer has no clue as to why.
Comment
-
-
Originally posted by Steffo View PostYeah, it's in the standard since C99, but who uses it? It's incredible insecure, because the programmer has to say: "I promise here is no pointer aliasing". How often do you see the restrict keyword in function parameters? I have never seen them in the wild. So in theory C has the feature, but almost no one uses it, because if the condition is violated, you have undefined behaviour.
No the reason why these new coreutils in Rust is faster than the old ones in C is that they use new algorithms and that the old GNU utilities where written to run on systems with 4kb of RAM.
Comment
-
Comment