Same! Rust is one of a few languages (Racket and Idris also come to mind) where writing a program really feels like solving a puzzle. My experience with many other languages has been closer to sewing the pieces together until it vaguely resembles the front of the box.
It is bigger, and has some higher-level features, but at the same time it still keeps all the good low-level aspects, e.g. you can micromanage every allocation and every byte of memory you use, if you want to.
Generics add a lot to the language surface, but when I don’t need to worry about goto cleanup; I have some brain cycles to spare.
C feels small in number of features, but actual productive work in C requires knowing plenty of things “between the lines”, like all the places where you can cause UB, macro hacks and footguns. You still have memory management (ownership), thread safety, but without type system helping.
I think you and the above poster are talking about two different things.
The above poster is referring to the sheer amount of content in Rust. It is not “barebones”: the language spec, the compiler and its capabilities, and the ecosystem are all very robust and sizeable.
You are referring to low-level, or “bare metal” as some would call it. Yes, Rust can get close “to the metal” but the language is not barebones.
The above poster is simply misconstruing a point in the article in order to make their own point. I don’t think anybody would contend that Rust is somehow a minimalist’s language a la Scheme or Go.
In Rust, I write less than half the code of C++ and get the features I really l like of C++ (compile-time switches on behavior, const member functions, RAII, static polymorphism) and I also get built-in testing, built-in basic benchmarking, package management, linting, a decent build system, and an extensive standard library.
The problem isn’t the language, it’s the ridicule I get from other people for using it.
None of it is directed at the language itself. Most of the ridicule I get for using Rust is along the lines of in their words: “Why use the language of zealots and ‘SJWs’?”
Some of us don’t care about politics, we’re just trying to build our resumes and skills to feed our families :(
Rumors of the Rust project being a political action committee that occasionally deals in software are largely started by people who aren’t acting in good faith, but the odds are you’re talking to someone who’s been taken in by those aforementioned rumors, not someone who is trying to manufacture them. For some who “[doesn’t] care about politics,” I would expect you to find the Rust community more than tolerable. The most politically charged thing I know of that the Rust project has taken a position on is being explicitly pro-LGBT+, and that’s so far inside the Overton window that the Coca-Cola Company feels safe doing it.
The Rust community is strongly pragmatic, hence the MIT/Apache dual license that seeks to maximize compatibility and reach over politically-minded concerns about software freedom or objectionable field of endeavor. When political discussions do come up, they’re firmly rooted in solving the needs of the software project itself in a satisfying way, where “satisfying” mostly means “without engaging in online trench warfare” (even if you disagree with it, it’s hardly an extremist position).
Anyone who actually can’t deal with Rust’s rather moderate community standards pretty much is a political extremist. If you’re not the sort of jerk who sends death threats to movie stars (who are largely the intended recipient of @skade’s scathing response, are the same group that I blame for Rust’s bad reputation, and have shown up in programming communities more often than any of us would like), you’ll probably be fine.
This sort of false dichotomy is why I try to avoid all political discussion. It doesn’t make any more sense than looking at a few outspoken members of any community and declaring the entire community to be like that.
I just want to build things to help people or that they enjoy using. When I get crap about using Rust, it’s a lot easier to say, “It helps me be productive because ______ (things I mentioned above)” or when I get asked what I’m working on, show how little Rust is actually required to accomplish what I needed.
I knew I should have marked this answer as half-serious. Your reply points to a serious issue though, many of the discussions go without substance or any gain.
My answer is not intended to be political, it’s an answer on the level of the question. As a general rule, I don’t find it productive to explain people how their question is already loaded, a blunt loaded answer sometimes helps, though.
As @notriddle writes above, Rust runs a wide gamut of views and are very proud about that. We are also proud about not being completely without values.
But there’s tons of other inclusive projects out there, some more conservative, some more anarchic then we are. We’re also extremely company-friendly, despite some team members being outspoken communists. We make this work somehow.
I’ll give you an example: we made the decision to fly the pride flag for a month on our chat servers for pride month. Some accused us of that being “political action”. But it wasn’t (*). Rust has a substantial number of queer project members. We’re extremely happy about that and a wide project agreement the decision was made to do that as a “thank you” to them. Queer inclusion is and has always been a core value of the project and brought us a lot of contribution, running all the way back to the initial team. If YouTube and Facebook and Twitter - companies heavily criticised for their queer hostile policies - run the pride flag, how should we, as a group that has actual, substantial success here step back?
But yeah, someone is going to call you a SJW for that. :)
(*) primarily. I subscribe to the worldview that everything is political ;).
For me the most fun in a long time (but by now also many years ago) has been learning a bit of Factor. They way concatenative languages like Factor are very different from imperative languages or even functional is quite mindbending. You are almost forced to write everything in pointfree style, which for these languages is 100% idiomatic. Also the environment reminds me a bit of image based systems and you can inspect the implementation of everything easily, in the integrated universal help system.
It is a bit of a shame that it got on the back-burner since its primary author ascended into Apple, but in my opinion still the most fun stack-based language.
Personally, I’ve been exploring APL recently. The way you solve problems in array languages is completely different than in other programming languages. I don’t think that they’re quite ‘there’, for problems outside their scope (stats/financial)—although obviously you can take them wherever—but I think that they are, in many ways, ahead of the competition, having found something that the standard complement of c#/java/python/js missed.
If you’re the sort of fella who liked C more than C++ in the past, check out https://ziglang.org. I find it has far fewer surprises and the compile-time features are simple without being weak. Also, it has an async without the “what color is your function?” problem.
Bad part is that you have to be competent enough to handle cleaning up resources. I find it easier than the competence required to get past Rust’s compiler.
Why do you think so? For a bit of background, I’ve written some C before professionally, and resource handling was not really a problem for me – after clearing the initial hurdle (which took perhaps a year). I’ve also written a book on Rust, and although it was admittedly a rather mediocre one, I have studied the language a bit more than just an initial scratch.
Something that worries me about Zig is that it has powerful generics, but no RAII at all. It means that if you use a generic Vec(T) and call pop or shrink or clear or whatever on it, you also have to remember to deinit the elements that might have been removed. Generics in a low level language that doesn’t have Drop seems like a good recipe for memory leak to me.
I do like many of Zig’s ideas :)
Here’s an old issue where they discuss this https://github.com/ziglang/zig/issues/782 – seems like they initially thought it would be too complicated and not in line with Zig’s philosophy but also that they’re gonna need some limited form of RAII to handle some parts of async.
I’ve written and read a lot of C, and worked with dozens of engineers on C codebases. I’ve also been to a fair share of conferences where I met world class programmers.
I have never met anyone I’d trust to write C without screwing it up. Manual resource handling never works. Valgrind and asan have helped a lot but they only work with adequate coverage, and even then…
Same! Rust is one of a few languages (Racket and Idris also come to mind) where writing a program really feels like solving a puzzle. My experience with many other languages has been closer to sewing the pieces together until it vaguely resembles the front of the box.
Well, writing in assembly feels like solving a puzzle, too… ;)
Rust is indeed fun!
But:
I can’t really agree with that. Rust is a pretty big language compared to C.
It is bigger, and has some higher-level features, but at the same time it still keeps all the good low-level aspects, e.g. you can micromanage every allocation and every byte of memory you use, if you want to.
Generics add a lot to the language surface, but when I don’t need to worry about
goto cleanup;
I have some brain cycles to spare.C feels small in number of features, but actual productive work in C requires knowing plenty of things “between the lines”, like all the places where you can cause UB, macro hacks and footguns. You still have memory management (ownership), thread safety, but without type system helping.
I think you and the above poster are talking about two different things.
The above poster is referring to the sheer amount of content in Rust. It is not “barebones”: the language spec, the compiler and its capabilities, and the ecosystem are all very robust and sizeable.
You are referring to low-level, or “bare metal” as some would call it. Yes, Rust can get close “to the metal” but the language is not barebones.
The above poster is simply misconstruing a point in the article in order to make their own point. I don’t think anybody would contend that Rust is somehow a minimalist’s language a la Scheme or Go.
To clarify my position, there’s no doubt that Rust is a more productive language than C, but I wouldn’t call Rust a bare-bones language either.
Sure you don’t have to use all the language features and libraries, but that doesn’t make it barebones as a unit.
You literally disagreed with the author feeling something
In Rust, I write less than half the code of C++ and get the features I really l like of C++ (compile-time switches on behavior, const member functions, RAII, static polymorphism) and I also get built-in testing, built-in basic benchmarking, package management, linting, a decent build system, and an extensive standard library.
The problem isn’t the language, it’s the ridicule I get from other people for using it.
Wait, people ridicule you for using Rust?
None of it is directed at the language itself. Most of the ridicule I get for using Rust is along the lines of in their words: “Why use the language of zealots and ‘SJWs’?”
Some of us don’t care about politics, we’re just trying to build our resumes and skills to feed our families :(
Rumors of the Rust project being a political action committee that occasionally deals in software are largely started by people who aren’t acting in good faith, but the odds are you’re talking to someone who’s been taken in by those aforementioned rumors, not someone who is trying to manufacture them. For some who “[doesn’t] care about politics,” I would expect you to find the Rust community more than tolerable. The most politically charged thing I know of that the Rust project has taken a position on is being explicitly pro-LGBT+, and that’s so far inside the Overton window that the Coca-Cola Company feels safe doing it.
The Rust community is strongly pragmatic, hence the MIT/Apache dual license that seeks to maximize compatibility and reach over politically-minded concerns about software freedom or objectionable field of endeavor. When political discussions do come up, they’re firmly rooted in solving the needs of the software project itself in a satisfying way, where “satisfying” mostly means “without engaging in online trench warfare” (even if you disagree with it, it’s hardly an extremist position).
Anyone who actually can’t deal with Rust’s rather moderate community standards pretty much is a political extremist. If you’re not the sort of jerk who sends death threats to movie stars (who are largely the intended recipient of @skade’s scathing response, are the same group that I blame for Rust’s bad reputation, and have shown up in programming communities more often than any of us would like), you’ll probably be fine.
Also, the CoC has been discussed to death.
Yeah, it’s one of these scenarios. Personally I haven’t had any bad run-ins with the Rust community, and most people are friendly and helpful.
“Because I prefer them to the Nazis”
This sort of false dichotomy is why I try to avoid all political discussion. It doesn’t make any more sense than looking at a few outspoken members of any community and declaring the entire community to be like that.
I just want to build things to help people or that they enjoy using. When I get crap about using Rust, it’s a lot easier to say, “It helps me be productive because ______ (things I mentioned above)” or when I get asked what I’m working on, show how little Rust is actually required to accomplish what I needed.
I knew I should have marked this answer as half-serious. Your reply points to a serious issue though, many of the discussions go without substance or any gain.
My answer is not intended to be political, it’s an answer on the level of the question. As a general rule, I don’t find it productive to explain people how their question is already loaded, a blunt loaded answer sometimes helps, though.
As @notriddle writes above, Rust runs a wide gamut of views and are very proud about that. We are also proud about not being completely without values.
But there’s tons of other inclusive projects out there, some more conservative, some more anarchic then we are. We’re also extremely company-friendly, despite some team members being outspoken communists. We make this work somehow.
I’ll give you an example: we made the decision to fly the pride flag for a month on our chat servers for pride month. Some accused us of that being “political action”. But it wasn’t (*). Rust has a substantial number of queer project members. We’re extremely happy about that and a wide project agreement the decision was made to do that as a “thank you” to them. Queer inclusion is and has always been a core value of the project and brought us a lot of contribution, running all the way back to the initial team. If YouTube and Facebook and Twitter - companies heavily criticised for their queer hostile policies - run the pride flag, how should we, as a group that has actual, substantial success here step back?
But yeah, someone is going to call you a SJW for that. :)
(*) primarily. I subscribe to the worldview that everything is political ;).
Who would ridicule you for using Rust of all languages? It’s generally thought of as advanced, hard, modern…
For me the most fun in a long time (but by now also many years ago) has been learning a bit of Factor. They way concatenative languages like Factor are very different from imperative languages or even functional is quite mindbending. You are almost forced to write everything in pointfree style, which for these languages is 100% idiomatic. Also the environment reminds me a bit of image based systems and you can inspect the implementation of everything easily, in the integrated universal help system.
It is a bit of a shame that it got on the back-burner since its primary author ascended into Apple, but in my opinion still the most fun stack-based language.
Personally, I’ve been exploring APL recently. The way you solve problems in array languages is completely different than in other programming languages. I don’t think that they’re quite ‘there’, for problems outside their scope (stats/financial)—although obviously you can take them wherever—but I think that they are, in many ways, ahead of the competition, having found something that the standard complement of c#/java/python/js missed.
Factor is an extremely cool language & environment. That Slava went to Apple is probably the biggest reason why I’m taking Swift seriously.
If you’re the sort of fella who liked C more than C++ in the past, check out https://ziglang.org. I find it has far fewer surprises and the compile-time features are simple without being weak. Also, it has an async without the “what color is your function?” problem.
Bad part is that you have to be competent enough to handle cleaning up resources. I find it easier than the competence required to get past Rust’s compiler.
In all likelihood, that means that you’re not clearing up resources properly in Zig.
Cleaning up resources and memory safety are two completely different things.
You can have a completely memory safe language and forget to close a file.
[Comment removed by author]
They’re different things when the resources in question are anything other than memory.
You can. Unless of course the file is an RAII object that can only go on the stack.
Why do you think so? For a bit of background, I’ve written some C before professionally, and resource handling was not really a problem for me – after clearing the initial hurdle (which took perhaps a year). I’ve also written a book on Rust, and although it was admittedly a rather mediocre one, I have studied the language a bit more than just an initial scratch.
Something that worries me about Zig is that it has powerful generics, but no RAII at all. It means that if you use a generic
Vec(T)
and callpop
orshrink
orclear
or whatever on it, you also have to remember to deinit the elements that might have been removed. Generics in a low level language that doesn’t haveDrop
seems like a good recipe for memory leak to me. I do like many of Zig’s ideas :)Here’s an old issue where they discuss this https://github.com/ziglang/zig/issues/782 – seems like they initially thought it would be too complicated and not in line with Zig’s philosophy but also that they’re gonna need some limited form of RAII to handle some parts of async.
I’ve written and read a lot of C, and worked with dozens of engineers on C codebases. I’ve also been to a fair share of conferences where I met world class programmers.
I have never met anyone I’d trust to write C without screwing it up. Manual resource handling never works. Valgrind and asan have helped a lot but they only work with adequate coverage, and even then…
[Comment removed by author]