Rust is a great language if you use for what was intended, system programming and as safe substitute of C and C++. But it's not the answer of everything, to me it's nowadays abused in a lot of projects, there are instances of project where using Rust not only doesn't make a lot of sense but also can be slower than another languages, there are cases where Go is better, other where Node.js is better, other where Python…
> To me the Rust community seems to want to argue that everything should be rewritten in Rust I haven't seen this. At most, I've seen the push for rewriting important libraries where security is a core issue in Rust. I don't blame them. I'm tired of C/C++ being used everywhere because of performance, leading to the current-day situation of so much fundamentally unsafe code running the world.
What is Rust and why is it so popular?
261–270 of 284 posts
Re: What is Rust and why is it so popular?
#262Earlier quoted context omitted.
We have started doing our own optimizations too: https://blog.rust-lang.org/inside-rust/2019/12/02/const-prop... Your overall point is absolutely correct though. We couldn’t have done this without LLVM.
Can you comment on the current state of non-aliased related optimizations? The issue tracker is byzantine on that one and i can't tell if or to what degree those optimizations are now done.
Re: What is Rust and why is it so popular?
#263I like the fact that Rust has a set of libraries (crates and the standard library) that provide a lot of the features that you end up re-inventing if you stick with C. Even C++ is pretty fractured in this regard. A lot of why this is hard in C/C++ is memory management. Even if you had a package manager it would be hard to compose libraries together unless they were designed together (like boost for C++).
Re: What is Rust and why is it so popular?
#264Earlier quoted context omitted.
A single construct does the work, or most of the work, of generics, value generics, const fn, traits, attributes (although I expect some form of attributes might be added to Zig) and macros, and it does so without type-level programming or macro-level programming, both their own mini-languages. A kludge is in the eye of the beholder, but one is simpler than five or six.
Rust has procedural macros too. And they're not a separate "mini-language" like the C++ template hacks, they just use Rust itself, except with a phase separation involved since they run at compile time.
Re: What is Rust and why is it so popular?
#265Earlier quoted context omitted.
> I can just as easily split comptime into In Rust, generics, macros, traits, compile-time evaluation are different constructs with drastically different syntax (and generics and value generics are different features, implemented at different times, but I can accept them as a single construct). > It has no way to constrain a comptime type argument (traits) It does: introspection, just as Clojure can constrain argumen…
> ... generics, traits ... Again, these are just as much a single feature as Zig comptime. Traits are like comptime types, or else (closer to what Zig does) comptime type variable introspection. > You'd get similar compile-time errors as you would get, at runtime, in, say, Clojure or Python. Exactly- you're not writing plain Zig, you're writing a Zig-adjacent dynamically typed language with new ways to do almost ever…
Re: What is Rust and why is it so popular?
#266Earlier quoted context omitted.
fn add2(x: i32, y: i32) -> i32 { x + y } variable declaration is varname: type, it makes it very hard to read when declaring arrays or other things return type is after the paren the let keyword seems redundant/unnecessary, a little like var in js Those are good example of "c flavor". I guess they're easier to parse, but still I would rather have C flavor instead.
"Very hard to read"? As in, harder to read than the C declaration syntax for the same types? That's a logical impossibility!
Re: What is Rust and why is it so popular?
#267What influential applications are written in rust? For c++, there is llvm, chrome, game engines, I feel like c++ is standing very strong in any of these fields still, why is that? Do u think it’s going to change soon?
Promoting Cargo as a way to build C++ and C programs could be a way to establish Rust underpinnings. Cargo is better than most other build systems now used for C++, and with C++20 getting modules, the fit is improving.
Re: What is Rust and why is it so popular?
#268Great article. One nitpick: > One of the biggest benefits of using a systems programming language is the ability to have control over low-level details. I think this is a misguided conflation of "systems programming" and "low-level programming", those are separate things. See http://willcrichton.net/notes/systems-programming/
Ah, the eternal argument over what qualifies as "low-level". I think we can all agree it's not Javascript, but beyond that opinions vary greatly and it's mainly a semantic issue.
C++'s and Rust's ranges stretch from C's at the bottom up to near ML's. Java is stuck in a little space in the middle.
Re: What is Rust and why is it so popular?
#269Earlier quoted context omitted.
Sure, but you still get memory safety.
... hence a better C++. If a better C++ is what you want, then Rust is a great fit.
Rust can do more of the things C++ can do than Java can, but there is a very great deal that can be put in a C++ library that is wholly beyond Rust's capacity.
If you have lesser expectations to capture semantics in libraries, or to use such libraries that do, Rust serves. But the gap will only grow wider.
Re: What is Rust and why is it so popular?
#270Earlier quoted context omitted.
Well, yes. There are plenty of popularity metrics there already, this one is about something else. As you said, mainstream languages won't win this one. But it is a valid metric anyway, and there is plenty of merit on winning it.
Think about this - if a bunch of people hate a language and stop using it, the following year that language's "most loved" score will increase . I wouldn't call that merit, it's just a bad metric.
But most of the time, people can't stop using languages.