It’s for programmers who need their Imposter Syndrome amplified.
A type of person whos apartment would be a mess cause they never collect their garbage, but they have a good memory where they put things and what they need, so it is never a problem.
It’s a survival crafting game where players help each other survive the world with mutual cooperation, kind words and absolutely no Nazi or racist behaviour.
Actually it’s a low budget western movie starring Alec Baldwin that resulted in the tragic killing of cinematographer Halyna Hutchins due to inadequate safety practices on set.
ABSOLUTELY no racism, whatsoever
And no bee grenades
It’s for people who suffer from severe anxiety when they see stuff like:
->
or*
for example. /j->*
Fe₂O₃·xH₂O
It’s not working…
Did enable to cargo your pants in the right bucket assembly? I think you need at least 1.6.2 but not more than 2.2
Try downgrading in the computer
I am on 1.8.0
Maybe the battery is too low on the phone, and it’s also rusty?
Is… Is that Rust on a phone!?
Yes. It’s an app called termux, which is like having Debian on Android
Yeah, i know what termux is, i just didin’t expect to see someone use Rust with termux.
Actual answer:
Rust is a relatively new programming language. Similar to C or C++ it compiles directly into executable binary code so it can be used for bare metal or low level operating system programming. It is thus relevant to Linux kernel development as things like drivers can and are being developed in Rust.
Compare this to the likes of Java or C# which get compiled to bytecode or a kind of pseudo machine code that gets run in a virtual machine, which has advantages for application development, or something like Python which is interpreted (or just-in-time compiled) at run-time, useful as an end user scripting language.
Rust is designed from the ground up to tackle some modern problems, a key one being memory safety. It’s a lot more paranoid about memory allocation and access and it’s structured around this. Older languages like C allow the programmer a lot more absolute control over the hardware, which effectively means the C programmer has a lot more footguns in his toolbox. Theoretically, Rust offers fewer opportunities for the developer to shoot himself in the foot.
Rust also comes with some really cool tooling. Compiler errors usually point straight at the problem and say something like “Shouldn’t there be a colon here?” The build system, called Cargo, is really slick in a lot of ways, handling linking, compiling, even library package management in a very automatic fashion. It’s real slick to work with.
As with anything, fans of the language can be a bit much; they stereotypically suggest rewriting everything under the sun in Rust whether it makes sense or not, and this includes the Linux kernel, which has caused some friction in the community; Linux contributors are often very accustomed to C and some don’t want to deal with anything else.
I listen to Steve Gibson’s podcast “Security Now” and he was talking about why, for security reasons, memory safe applications should be the way of the future. So many security vulnerabilities come from improper memory management. And while C may be more powerful, giving up some of that power for standardization is almost always worth it. We could make much more progress if we were spending less time trying to make sure the memory is handling correctly in every situation. So while there is no doubt the crazy fans of it, I think moving to memory safe languages in general should be the way of the future.
Of course, he still writes all his programs in assembly and refuses to learn anything else. But when you’re at his age, I guess you get a pass XD
I like the description by a Finn who said: Rust is like a car with automatic, while in C (or Zig) you need to change the gears. In Rust you literally follow the compiler, which allows many young developers to program at low level, while C demands more time to avoid bugs. It is up to each person what he/she prefers. I would prefer to control myself the stuff and learn the in and outs of memory management.
I like the description by a Finn who said: Rust is like a car with automatic, while in C (or Zig) you need to change the gears.
I don’t think this metaphor is correct. The automatic gear’s analogy would be the Garbage Collector, which almost every mainstream language has. Rust’s memory management, in comparison, is still manual. Maybe not as manual as C or Zig - but I’d say about as manual as C++. The difference is not that it has some weird gear-changing (memory cleanup) scheme that does not require human intervention - it’s that it yells at you when you don’t do the regular gear changing (memory management) properly.
I found the article, or better opinion. My bed that it wasn’t a Finn, but an America, Alan Ward. The metaphor is taken from him, while he explains in his article much better than me. Please, see his opinion on page 48-49 in the linked PDF of the current Full Circle issue #215 below:
I find his metaphor very apt.
It’s fair to want to learn (and it’s certainly a good skill to have), but the question is what you’d rather see in a large, production environment. Guard rails are usually there for a reason. As for the control: you actually can program memory-unsafe (and in kernel development you often have to!) in Rust. The difference is that in Rust it’s explicitly marked by an unsafe block:
unsafe { ... }
That way you get the same, fine-grained control over low-level processes, but someone else reading your code can at a glace spot where potential memory bugs may be.
In the end, languages are a tool. Especially for personal projects, everyone should just go with what’s fun to them. I personally think it makes sense, logistically, to slowly transition legacy C-based projects to Rust, because it makes onboarding new developers easier, while keeping the same memory safety that requires years of experience otherwise, basically for free. But there’s really no rush to rewrite anything that’s working well in Rust
The sound bite I heard was “the unsafe keyword makes memory bugs greppable.”
Alas, when there is no difference between unsafe wrapper in Rust and C, then why learning Rust, if one wants to go for managing the memory manually? Especially when considering the complex way of coding in Rust? Another problem: going the easy way and forgetting the tricky parts - if Rust allows for unsafe code, but it is safer to put it into a « safe » mode, so why I need to take the burden and deal with unsafe code? This will evidently lead to the situation that less and less unsafe blocks will be used, which finally leads to a situation where the programmer forgets the in and outs of manual memory management. You can see it as the principal aim of writing memory safe code, but to me it is also a way of « delearning » by learning. I see here the reason why so many young programmers are opting for Rust, because manually managing the memory in larger projects like in C is a question of knowledge and experience which does not come in one day. I also doubt that following just the compiler is a good approach. I agree totally with your last points though! Coding should mean to have fun and be the same time mentally challenged due to complex algorithms or demand for better code in general.
The difference is, you put up a sign “here be dragons” with unsafe. Certain operations break the garanties of rust, like pointer operations and Cells. So now you need to write a wrapper which upholds checks that they are not violated. If it breaks, you just need to check your unsafe code, instead of everything. Now only one person needs to deal with unsafe for everyone in a team to benefit.
Memory safety isn’t a skill issue. There is a reason they happen in all big projects like android or chrome and only reduced when introducing safe languages.
I’d rather have a compiler that tells me why my code was refused than a compiler which prints 100 lines of templates. Or a compiler, which tells me a pointer/reference is null instead of a compiler that knows, but it’s UB-NDR so it isn’t snitching. If the compiler tells me, hey here you could have a race condition, it’s one less bug I have to find with a debugger. A compiler that complains about uninitiated variables, instead of a compiler that gives me potluck as content.
Thank you for your explanation and I understand it well, as well the advantage to find bugs quicker (which however does not mean that a safe code cannot be also a bad code). However, I do think that writing safe code without being guided by a compiler is indeed a skill. And the question how safe the code written with the help of the compiler will be is another interesting one. Perhaps we will find out in the future.
In my opinion, Rust is a language dictated by the compiler rather than one that allows you to use your brain, knowledge, and skills to deepen your understanding. Rust is essentially a programming language with training wheels. Unfortunately, the preference to finish tasks quickly is nowadays the mainstream. The understanding of the deeper stuff falls behind.
A related example from real life: bike tyres that have a flat. Less and less people can change the tyres on their own, and even do not understand the construction and characteristics of different tyres, only believing what the vendor in the shop is telling them. Bad surprises then happen.
This, to me, seems like the standardization vs optimization argument. So much of the tech world could be optimized like crazy, but the more complex it gets, the hard it is to communicate with others and keep things consistent. This complexity actually hinders production overall. Standardization, even if it’s not the most optimized, allows us to create vastly more complex and reliable systems because we can ensure we are all on the same page. Even if that standardization isn’t the best way to do it. I mean, if you want to talk about absolute control over your code, why don’t you write in assembly? Are all programming languages not virtually assembly with training wheels?
Writing in code that is not memory safe is going to mean you are substantially more likely to have mistakes that lead both to user annoyance and straight up security vulnerabilities. Having applications written in a memory safe languages, especially when worked on by large swaths of people, is absolutely the best route. It provides a secure standard way to write memory safe code. This will reduce security vulnerabilities, decrease program crashes, and allow for more efficient developers.
Changing a bike tire is something for a single person, maybe two at most. Writing code is often a team effort. And the more people that are involved, the more likely mistakes are going to happen. People absolutely can still learn the complexities, and still choose to use Rust because honestly, it’s the smart thing to do. And it doesn’t need to be rust. Any memory safe language would accomplish the same goal.
Yes, writing safe code is a skill. But for most skills you need someone to teach you. My suggestion is, think about it differently:
The compiler isn’t training wheels, but rather a senior dev, that quickly looks over your shoulder and tells you, hey you might have missed something here. You can at any point tell them, trust me bro for this part. They need at some points a comment in the form of lifetime annotations. They are pretty good, but not perfect.
To pick up your example. They don’t tell you, you need a new wheel. They tell you, you’re bike has disc brakes, but your new wheel is missing the disk. When you later hit a wall, because you couldn’t break, you can check where you just said trust me.
@Flipper, if you just learn from one master, you cannot become a master in the field. As I said above: relying heavily on the compiler, even when this may be the best „teacher“, does not make you - I do not speak about you personally, but you in general, so all programmers - a good programmer. This is my major critic about Rust, while I do also understand its advantages.
I’m convinced MS is funding the rust foundation only so that the rust kernel rewrite will fracture the Linux ecosystem and weaken it’s overall standing.
the fact that any rust community I’ve had the displeasure of working with is toxic as fuck only fuels my theory that MS wants it as inhospitable as possible to keep existing kernel devs “in their lane”.
it’s really not a bad language, but the devs… ohhh boy…
Windows already has Rust in their kernel
It’s a programming language, which is particularly relevant for Linux, because it doesn’t require a runtime (separate program that runs the code). This allows it to be used in the kernel.
But it also means that it’s very good for building libraries. With a small bit of extra work, virtually any other programming language can call libraries implemented in Rust (like you can with libraries implemented in C).
Add to that, that Rust allows for performance similar to C and makes lots of typical C bugs impossible, and suddenly you’ve got folks rewriting all kinds of C libraries and applications in Rust, which is something you might have also heard about.Thank you for the informative response. I knew rust was a programming language, but didn’t know it’s significance.
Ah yes, the C bugs in the kernel libraries. We’ve all seen them.
Ah yes, intentionally misunderstanding someone’s comment. We’ve all seen them.
I mean, what the heck is this passive-aggressive comment? If you disagree with me, then come at me.
Plenty of patched memory leaks in the last few years. You can pretend they dont exist.
Iron Oxide. Everyone else is wrong.
Ferrous oxide innit?
Wustite, ferrous oxide, is black. FeO.
Typical rust, usually found as hematite, is Fe2O3 and is red/brown. Also an iron oxide.
Magnetite is also another black iron oxide, Fe3O4.
There are quite a few other flavors of iron and oxygen too.
Ooh, cool! TIL
flavors of iron
Yum yum
Just like grandma supernova used to make
No. OP meant to type crust which is an inedible handle for pizza. I will die on this hill.
you meant to say incredible instead of inedible, since it’s the best part of the pizza, with the best taste
ITS JUST BREAD
exactly, bread is vrry eddble by itsssself
why eat pizza if you like plain bread more?
pizza is mrre crrrsty
Idk about that fryman
pepple hav been doing it for thousands of yyeeers
Get extra sauce. The whole point of bread is to carry sauce.
This guy fucks. Although, if I’m gonna put sauce on it, what’s a little more cheese?
The amount of inedible is dependent on the amount of hungry
i’ll always eat that part unless i’m extremely full
I can agree with that, and the quality of the handle of course.
Lemmy’s backend is written primarily(entirely?) in Rust
I have seen this somewhere else before, but I am unsure where
It’s also what this beautiful thing is written in
Dude, that’s just English.
Rust is a programming language designed to run on crabs. It just happens to also run on computers. When rust programmers talk about the borrow checker, that’s something born directly out of having to run on crabs. It’s difficult to get the little guys to cooperate otherwise. And when they talk about rust having good error messages that’s because of the crabs too. The compiler is not just some piece of software, it’s a piece of software being run on crabs and the crabs have some measure of intuition to them. Basically what I’m saying is that carcinization applies to computer hardware.
Rust is when you run DOOM on 16 billion crabs. You can’t do that in other languages. Just ask Amelia Airheart.
Is it not Earhart?
Why would someone name themselves ear deer?
It’s a brutally competitive and toxic game.
You must be looking for /c/playrust
deleted by creator
rust is only on iron
Other metals can corrode as well. It’s not only iron oxidation.
We’re talking about rust, not corroding. Rust is only iron, nothing else.
Can you make me some sake?
HOW IS THIS THE ONLY MENTION OF THE FUNGUS!?
I know, right? It turns up on the sorrel in my garden every year
step one get hrt prescription
step two learn rust
step three buy socks
What, no, socks are step one, while you’re waiting for your prescription.
you forgot the cage.