this post was submitted on 12 Feb 2026
59 points (100.0% liked)
Learn Programming
2087 readers
50 users here now
Posting Etiquette
-
Ask the main part of your question in the title. This should be concise but informative.
-
Provide everything up front. Don't make people fish for more details in the comments. Provide background information and examples.
-
Be present for follow up questions. Don't ask for help and run away. Stick around to answer questions and provide more details.
-
Ask about the problem you're trying to solve. Don't focus too much on debugging your exact solution, as you may be going down the wrong path. Include as much information as you can about what you ultimately are trying to achieve. See more on this here: https://xyproblem.info/
Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
So C is basically assembly with a bunch of syntactic sugar on top. It manages a lot of the book keeping and boilerplate, but at the end of the day there's not a ton of difference between them in terms of the abstractions it provides. If you know assembly learning C is a piece of cake. If you don't you're probably going to take a while to really wrap your head around pointers and the myriad ways C can use them for great and terrible things. Beyond pointers (and race conditions if you're crazy enough to do multithreading in C) the rest of C is super easy because there really isn't much else there.
Rust on the other hand is a much higher level language more comparable to something like Java, C++, or Python. It gives you a lot of tools to solve complicated problems but unlike Java and Python and like C++ it still gives you the option of working at a low level when you need to. The big advantage it has over C++ is that it learned from the many mistakes C++ made over the years, and the borrow checker really is a unique and powerful solution to both memory management but also crucially concurrency problems.
Interesting. I always assumed that Rust would be more similar to C since they are now using Rust in the linux kernel
No, for a good modern C alternative I'd look at Zig. The main reason C is used for the Linux kernel is because Linus hates C++ for a variety of reasons. For what it's worth I agree with him. Most other OS kernels are written in C++. Linus allowed Rust in because it demonstrated that it could provide the same power as C++ without all of C++'s problems (mostly that over the years it became a kitchen sink language, anything that anyone ever thought might be a good idea got rolled in even when it was incompatible with some other feature already in the language).
Thanks for the suggestion. How does Zig compare to C safety wise? One of my main reasons for going for Rust was because I was looking for something like C but safer
It's a bit safer and a lot more convenient to use, but still lets you do dangerous things with pointers. At its core it's still fundamentally the same as C just with a bunch of helpful tools and features to make doing all the stuff you do in C easier and more convenient.
Really the biggest thing it does significantly better than C is its macro system. C macros are "dumb" in that the C pre-processor does a simple find and replace on the source files without doing any kind of processing on the underlying C code so you can E.G. write C macros that spit out mangled illegal C code when you run them. Likewise a C
#includeis literally the same thing as copy and pasting the contents of the included file before it gets fed into the compiler.Zig on the other hand has a smart macro system that's actually aware of the zig code and works in concert with it at compile time.
Okay that makes sense. Thanks for the comparisons here