this post was submitted on 21 Dec 2023
2 points (100.0% liked)
Linux
48157 readers
611 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I don't understand the obsession with rust.
It’s a system programming language that isn’t C or C++.
Edit to add: How did Go get on that page? That’s a stretch.
(notice: I am not a Rust or C/C++ expert)
Doing all that is creating a completely separate programming language from C. Rust is that programming language.
Rust does that with modules and crates.
You mean having consistent/universal style guidelines? Rust pretty much has that with rustfmt.
Safe Rust is memory safe (using things like the borrow checker), and Unsafe Rust is (usually?) separated using the
unsafe
keyword.Although Unsafe Rust seems to be quite a mess, idk haven't tried it
Rust has macros, iterators, lambdas, etc. C doesn't have those. C++ probably has those but in a really weird C++ way.
I'd say no. Programming safely requires non-trivial transformation in code and a radical change in style, which afaik cannot be easily done automated.
Do you think that there's any chance to convert from this to this? It requires understanding of the algorithm and a thorough rewrite. Automated tools can only generate the former one because it must not change C's crooked semantics.
Rust isn't just a new improved version of C or C++. It's completely new and it feels completely different to use Rust. In a positive way
From my personal experience I can tell you 2 reasons. The first is that this is the first general purpose language that can be used for all projects. You can use it on the web browser with web assembly, it is good for backend and it also is low level enough to use it for OS development and embedded. Other languages are good only for some thing and really bad for others. The second reason is that it is designed around catching errors at compile time. The error handling and strict typing forces the developer to handle errors. I have to spend more time creating the program but considerably less time finding and fixing bugs.
I feel like C++ is as competent as Rust for any project and it's definitely older.
Rust was created because c++ was so bad. Just take a look at crates they need a whole lot less maintenance because less bugs.
My point wasn't that C++ is good. My point was that C++ can and is used everywhere (desktop applications, web applications, OSs,...) and is older than Rust. So I feel that "this is the first general purpose language that can be used for all projects" is false. Probably "this is the first general purpose language that I (and many others) like to use for all projects" is true, but is a different claim.
TLDR: You said Rust was first language capable of system, app and web, it isn't.
It is good and rust improves on its gaping weaknesses.
Yeah I never made that claim the threads OP did.
Not sure I can think of anything I'd enjoy less than trying to build a web app in cpp