Live data from Hacker News

What is Rust and why is it so popular?

stackoverflow.blog

171–180 of 284 posts

Re: What is Rust and why is it so popular?

#171

Earlier quoted context omitted.

Ecosystem.. I don't know about node. But there's whole lot of java code and libraries out there. Otherwise why would people build other languages for the JVM? Ease of writing; Most of code is okay having a GC. But time to produce working code (not necessarily 100% correct code) is important. Rust is created for low level stuff. It is wrong to expect web backend programmers to deal with ownership, stack-vs-heap and al…

> It is wrong to expect web backend programmers to deal with ownership, stack-vs-heap and all. I am a web backend programmer. I respectfully disagree. I would much rather deal with ownerhip and related issues than deal with dynamic typing fallout. Unfortunately, I am stuck in Python land for some foreseeable future. > But there's whole lot of java code and libraries out there. That is true about every other popular l…

Here's why we use Java:

1. It performs well - we're a small company, so hardware costs matter to us. Its a similar performance class as Go and C# - if you want to go faster, you likely have to use Rust, C, or C++.

2. As said, the ecosystem is huge. If you need to do something, there's probably a library or tool for it. If you have a problem with one of their libs, someone else had the problem too. Unless your business is consulting, spending your time going down paths no one else has gone down just so you can use a shiny new language is a waste of resources.

3. The language isn't full of too many concepts. This makes it easier to get people up to speed with it if they're unfamiliar. I like Rust for some personal projects, but lots of the complexity of the language is completely pointless for most of what we do at my company.

4. The JVM is great.

5. We already know it.

Even ignoring #5, our priority of languages is probably C#/Java, then Go. Java is a meh language. And I feel like the annotation soup only makes it worse: it makes Java both verbose and magical, a truly shitty combination. But the ecosystem is awesome. The performance is good. The JVM is great.

With .NET Core, it might make sense to look at C#. But the language is fairly similar to Java anyways. Switching for switching's sake seems pointless. And Microsoft only relatively recently started officially supporting Linux, so I would be wary of using it for greenfield, much less switching our existing company.

Kotlin is a decent contender here too. But it's not that widespread as a backend language, at least not yet. If I could pick any language, I would choose Clojure because it benefits somewhat from Java's ecosystem and is (IMHO) the best JVM language. Immutability is killer, and I find dynamic typing with specs a good middleground between purely dynamic and purely static languages.

But Clojure makes things pretty difficult when it comes to the hiring end of things and developer familiarity. If I worked at a greenfield company solving the same problems I do today, Java would probably still be my first choice.

Re: What is Rust and why is it so popular?

#173

I realize /r/rust (Reddit) isn't representative of the entire Rust community but it's given me a really bad impression of Rust culture.

Reddit is great for memes and humour, not much more. Go through any subreddit on a topic that you know well, and you'll likely be disappointed.

Re: What is Rust and why is it so popular?

#174
post #5

StackExchange Inc. making noise to distract from the deepening crisis with the public Q&A sites it owns. The post itself may be good or bad, I don't know - but I just can't bring myself to read their happy-go-lucky banter.

What "deepening crisis" is this? Is it just the usual internet drama with a few people being unpleasant to each other and then storming off in a huff, or something more serious?

* Many of the moderators left or suspended activity in October; almost none have returned.

* A few more moderators have left this month.

* Consequently, several sites have only a single active moderator or none at all.

* Two key employees involved in moderation and community relations have recently been terminated.

* Company management completely avoids any communication with the community.

* One particular moderator who had been summarily terminated (not from a paid position) was slandered to the media by SE Inc. , has threatened legal action, and has reached an undisclosed arrangement with the company. The community has responded quite negatively to the little which is known about the arrangement (which does not include any admission of wrongdoing).

This is not including unfounded rumors about where the company may or may not be heading business-wise.

Re: What is Rust and why is it so popular?

#175
post #126

Earlier quoted context omitted.

What is the complexity, and what are its costs? As an active user of Rust, I haven't seen the (adverse) complexity or its costs yet. It's worth pointing out that Rust combats more than undefined behavior. Undefined behavior is a category of bad things that Rust works to eliminate, but Ownership goes beyond eliminating UB, and eliminates a large swath of potential logic bugs.

Programming in Rust is complex, I'm not sure how can argue against that, it is not straight forward to do simple tasks because of how you need to organise your architecture with the borrow checker. Most people that starts using Rust get stuck on issues that you woudn't have with other languages.

In my experience the difficulty of picking up Rust is most pronounced for people experienced in other languages that have common design patterns that are discouraged or made impossible by Rust. It's harder to unlearn something that from your point of view works (even if it had hidden or clear drawbacks) when you're also having to learn other things simultaneously. Also, I feel the biggest hurdle Rust has for experienced developers from other languages is that Rust makes some ineficient code visible, but the way of optimizing it requires delving into more advanced parts of the language, frustrating people when they are most "vulnerable". This is where the common piece of advice for people starting with rust "just clone for now and don't think about it" comes from: get used to the language first and deal with borrowing on its own at a later time.

But all of this frustrating learning curve comes to fruition later in when writing code because the experience is closer to pair programming with the compiler rather than trying things in a vacuum on your own.

Re: What is Rust and why is it so popular?

#176
post #126

Earlier quoted context omitted.

What is the complexity, and what are its costs? As an active user of Rust, I haven't seen the (adverse) complexity or its costs yet. It's worth pointing out that Rust combats more than undefined behavior. Undefined behavior is a category of bad things that Rust works to eliminate, but Ownership goes beyond eliminating UB, and eliminates a large swath of potential logic bugs.

Programming in Rust is complex, I'm not sure how can argue against that, it is not straight forward to do simple tasks because of how you need to organise your architecture with the borrow checker. Most people that starts using Rust get stuck on issues that you woudn't have with other languages.

The "rules" that the borrow checker enforces are the rules of functional programming, except in an extended form that adds flexibility to many tasks as opposed to removing it. The main point is to not share and mutate objects at the same time, because that comes with inherently unclear semantics and a high potential for bugs. (Rust has mechanisms for shared mutability, but even those trigger runtime checks to ensure you aren't actually doing anything that would be bug-prone in that way.)

Re: What is Rust and why is it so popular?

#177
post #139
post #34

Over the last couple of months I've been slowly, but steadily playing with Rust. I work on embedded systems and while it's gaining traction only slowly, it feels to me reasonably likely that we'll be seeing non-trivial applications in the next 8-10 years. I doubt that we'll see it used for low-power/resource-constrained firmware, but lots and lots of embedded systems are now bulky Linux boxes with years of uptime, an…

Yeah, some of the nice things about Rust aren't immediately obvious. Professionally, I use Rust for a few specific things: 1. Rust is surprisingly great for making cross-platform CLI tools and shipping static Linux binaries. Everybody can just install a single executable and they're ready to go. (Go is good at this, too.) 2. Rust is great for anything where I ask, "How big a cluster do we need for this?" I get roughl…

From my experience it's quite a good language for fun experiments and coding challenges, at the very least. I grew to love it quickly during advent of code.

The iterators, enums and no Null types lend themselves to interesting solutions.

The crate ecosystem is also developing fast, and there are decent browsable docs and bootstrapping the env and development environment are all easy.

SDL2 support makes it really easy to make rectangle based games like classic pong and experiment with keyboard and controller inputs etc. (never mind further possibilities of 3D etc).

TTY apps and games are also easy to make with the termion crate.

I think it's just kind of worth learning in a way that (for example) Python, C and Haskell are complementary options for learning different ways of thinking about of coding. Rust feels like a different flavour of programming. It's borrow checker and branch checking etc. they really are likely to lead to better programming in other languages too. Understanding ownership and considering the transfer of ownership are valuable.

Re: What is Rust and why is it so popular?

#178

Earlier quoted context omitted.

Rust is great and I'm really glad it exists; however, I'm skeptical that anyone ever "gets up to Python speed" or "gets up to Go speed", at least provided "speed" means "time to an acceptable result" and not "time to perfect" or "time to pacifying rustc". It's a laudable aim, but I don't think we're close. There's still a lot that Rust makes you think about that Python/Go/etc don't, such as memory management and life…

I feel like these days, provided there’s a library and I’m not writing stuff from scratch, I’m just as fast at Rust as I am with Ruby. I spent way more time debugging Ruby problems and fixing bugs than I pay upfront with Rust. It really depends on how you measure productivity. But also, I don’t think that “makes you think about memory” is that simple. I don’t have to think about memory in Rust very often at all: that…

> I pay upfront with Rust.

But you do pay up front! That's a big deal if your design is not set in stone (which is not a synonym for "prototyping").

Re: What is Rust and why is it so popular?

#179

The example of an error message in the blog post is the kind of thing that makes me seriously consider trying out rust. It's excellent. Are most rust error messages like that?

Most are that good, or better. I actually debated putting that error because it's one that doesn't have a "help:" line that actively suggests how to fix it. Some errors are admittedly worse, and people like estebank are actively working on improving them.

You're the author of the blog post? Dunno if this is something you care about, but with JS turned off the code boxes are omitted (with no placeholders or other clues that something is missing.)

Re: What is Rust and why is it so popular?

#180

I work in the embedded space, but the majority of my work is writing simuators, mathematical models and tests. One of the hidden benefits for us was that rust is suitable for both resource-constrained embedded code (we use a lot of C for this) and high-level desktop and cloud based infrastructure/sim/test code, which we would never consider writing in C. Serde is amazing, crates.io has so much good stuff on it, C int…

Now switch to Julia instead of Python/matlab and you have a really solid stack.

Julia lost its momentum, and for good reasons: insuficient or rushed up libraries, no option for the generation of standalone executables and general overselling (by the way, bashing Python at every opportunity didn't lead to a higher volume of users)
Post reply on HN