Earlier quoted context omitted.
I think this is misplaced causation. Don’t discount the fact that a significant number of programmers just like novelty and like Rust because it’s new in the same way Haskell is new to a Java dev. That said, Rust’s domain does seem wider than just systems programming. It has the right abstractions to be suitable for (edit: some ) higher level things like web apps. Personally Rust is turning into what I was assuming a…
> higher level things like web apps. Frankly any language that makes me write "some string".into(), and all of the other nonsense of Rust, is not suitable for writing string processing applications (as opposed to utilities, such as ripgrep). The business logic of any Rust application that deals mostly with strings is hopelessly obtuse and/or obscured. Languages like Perl, Python and Ruby, or even JavaScript and Java,…
What is Rust and why is it so popular?
201–210 of 284 posts
Re: What is Rust and why is it so popular?
#202Earlier quoted context omitted.
> higher level things like web apps. Frankly any language that makes me write "some string".into(), and all of the other nonsense of Rust, is not suitable for writing string processing applications (as opposed to utilities, such as ripgrep). The business logic of any Rust application that deals mostly with strings is hopelessly obtuse and/or obscured. Languages like Perl, Python and Ruby, or even JavaScript and Java,…
Web frameworks convert strings to business logic, web apps deal only in business logic. Fortunately the web framework is only written once to support multiple web apps.
Re: What is Rust and why is it so popular?
#203Rust using the LLVM toolchain is a real plus, which Clang also uses in the C++ world. The Clang and Rust compilers are basically frontends to LLVM, and any language that compiles using LLVM is translated to IR (intermediate representation). All code optimization is done on the IR code itself in LLVM, which both Rust and C++ compile down to before being compiled further into assembly. That means that the same effort t…
This is a broad over-simplification of compiler engineering. LLVM IR is a very leaky abstraction, and there are plenty of optimization passes which make sense for one but not the other. Plenty of optimization passes can and do assume that the LLVM IR is "roughly clang-shaped".
However, modulo LLVM bugs, the worst to be expected from a frontend selecting a different set or order of LLVM passes would be a loss of codegen quality, which may not be particularly crucial for non-C++-shaped languages.
Re: What is Rust and why is it so popular?
#204Earlier quoted context omitted.
Hey nice to see you here, your SO posts have tremendously helped me learn Rust. I think Haskell is just too abstract for most of us. I love Rust traits and see how it directly came from Haskell but I couldn’t learn Haskell even after like 3 serious tries. Maybe a good portion of the problem is in the documentation and not the language? That said, the extremist purity is simply impractical compared to Rust which gets…
You are quite welcome! I can't add much to the Haskell part as I've only ever used it sparingly. In many aspects, I view Rust as only having one or two small things that are new (or at least new in a non-research programming language). Its big strength is combining a lot of existing good ideas in a principled manner.
Re: What is Rust and why is it so popular?
#205Still not hyped. The article does not show anything special or new about the language that would attract me personally. Type inference -- nothing new and exists in many other languages. Actually how about compile type inference not only in function bodies? :) Functional niceness with iterators -- also nothing new. It can be even more succinct and elegant in Scala for example. But Scala is not as fast you'd say! Yeah,…
This is actually an explicit design decision; it means that the analysis is tractable, and that you don't get spooky-at-a-distance error messages.
Re: What is Rust and why is it so popular?
#206Earlier 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?
#207Because the StackOverflow survey which Rust keeps winning defines "Most Loved" as: > % of developers who are developing with the language or technology and have expressed interest in continuing to develop with it Because there aren't that many Rust jobs, almost no one has to use it. Which means people either try it and leave, they like the language and stick around, or they never use it (the overwhelming majority of…
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.
Re: What is Rust and why is it so popular?
#208Earlier quoted context omitted.
As someone who never much got into systems programming, Rust feels like a breath of fresh air. It makes systems programming way more accessible for me personally, coming from non-systems languages. Learning to write C well is just not something that appeals to me at all. From mostly an outsiders' perspective, I just don't think C is a very nice programming language. It looks easy to to pick up and it probably is (for…
> As someone who never much got into systems programming, Rust is a breath of fresh air. I think that's part of the problem :) Because Rust looks high level it appeals to people used to high-level programming. But once you get into systems programming, the issues are different from high-level programming, and you're less happy to pay for features that solve other problems. What I'm saying is, obviously, a matter of t…
Although they do have security issues regarding use-after-free.
Re: What is Rust and why is it so popular?
#209Another point is the tight integration with cargo, which may lead to the same dependency problems that npm has. But it will cause significantly more struggles because of licensing issues. While most npm code was running on servers, it didn't matter. In the embedded space companies typically insist to have every library checked by a lawyer before it gets shipped with the product, which will make cargo essentially useless.
The last one is the community. In fact I think a programming language is to the largest part about the people using it. And Mozilla sadly created a hype and a hostile community by aggressively evangelizing the language.
Re: What is Rust and why is it so popular?
#210Earlier quoted context omitted.
I'm not sure I follow. Rust syntax seems far more similar to C than Python syntax does. What parts of the Rust syntax do you feel depart from C-style syntax?
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.
I personally find the "varname: type" syntax easier to read.
Also, keep in mind that Rust has type inference, so you can say things like "let foo = 37;", and the compiler will infer the type of "foo". The "varname: type" syntax is more compatible with optionally specified types, because it nicely fits in if you want to add the type info explicitly: "let foo: u64 = 37;".