Live data from Hacker News

Zero to Production in Rust

zero2prod.com

31–40 of 195 posts

Re: Zero to Production in Rust

#31

So I've just tinkered around a bit in Rust, and I'm not intimately familiar with the language. My experience has been pretty good, but I don't see how it's a good fit for the web domain. At least not the enterprisey, CRUD, business apps I'm used to building. I'd be curious to hear from people who have been using Rust for their web backends, though. Beyond the classic selling points of speed and safety, what benefits…

We are using Rust for backend web development and other things.

For us, the safety is the critical reason to choose Rust - particularly the thread-safety. Also the relatively small memory footprint compared to something like Java. Performance hasn't driven our decision at all - the number of requests per second is very low. It's correctness that matters.

We are a bit unusual because customers have locally deployed servers rather than servers managed by us, so bugs are harder to fix.

We haven't hired any developers specifically for their Rust experience, but have instead trained internally and now have a group of about 10 Rust developers working across a couple of projects. I would say that training like this has been relatively straightforward. One of our hires, a recent graduate, had some existing Rust experience with personal projects, and this was particularly beneficial in helping the team to bootstrap.

The ecosystem is surprisingly mature. Async is probably still shaking out somewhat, but that's moved on hugely in the last couple of years, and we haven't had any particular problems.

Overall the experience has been hugely positive.

The biggest barrier to adoption, in my opinion, is that people are scared of learning Rust because it has a reputation as being difficult. I don't think it's any harder to master than some other major languages such as C++ or Java - although perhaps you have to understand more at the beginning: ownership and borrowing are right in your face.

Re: Zero to Production in Rust

#32

So I've just tinkered around a bit in Rust, and I'm not intimately familiar with the language. My experience has been pretty good, but I don't see how it's a good fit for the web domain. At least not the enterprisey, CRUD, business apps I'm used to building. I'd be curious to hear from people who have been using Rust for their web backends, though. Beyond the classic selling points of speed and safety, what benefits…

The DB space for Rust is a bit young, though there are several good projects like sqlx making it much more pleasant. Rust shares many of the benefits of Go: - statically linked binaries for ease of deployment - good concurrency - builtin testing framework But it's a much sharper tool than Go: - Really great error handling with Result/Option and the ? marker - Like, really really good error handling, esp compared to G…

"good concurrency"

Async rust is very messy and a pretty big issue atm. The tooling on the IDE side is subpar compared to Go.

Re: Zero to Production in Rust

#33
post #25

Earlier quoted context omitted.

The DB space for Rust is a bit young, though there are several good projects like sqlx making it much more pleasant. Rust shares many of the benefits of Go: - statically linked binaries for ease of deployment - good concurrency - builtin testing framework But it's a much sharper tool than Go: - Really great error handling with Result/Option and the ? marker - Like, really really good error handling, esp compared to G…

> When I compare my Rust and Go code, the Rust code ends up being much smaller (LoC) and much more dense/terse. Yes, but is it more readable too? The obfuscated C contest also tends to produce a lot of dense/terse code, but you probably wouldn't want to use that in a production system...

In my experience, Rust code is relatively easy to read, even by developers with no Rust experience.

Of course, you can write hard to read code. But that's not typically what comes out of a process of writing production software.

That's not to say that someone with no experience will fully understand the ownership transfer & borrowing that's happening, but that's just stuff you need to do for the compiler. Reading code that already compiles, you can mostly ignore that and focus on the program logic.

Re: Zero to Production in Rust

#34
post #32

Earlier quoted context omitted.

The DB space for Rust is a bit young, though there are several good projects like sqlx making it much more pleasant. Rust shares many of the benefits of Go: - statically linked binaries for ease of deployment - good concurrency - builtin testing framework But it's a much sharper tool than Go: - Really great error handling with Result/Option and the ? marker - Like, really really good error handling, esp compared to G…

"good concurrency" Async rust is very messy and a pretty big issue atm. The tooling on the IDE side is subpar compared to Go.

I'd be interested in hearing what you think is a problem in async Rust.

Re: Zero to Production in Rust

#35

Is it cool now to just link to landing pages where you sell things now? Am I missing something? Why the hell are people upvoting a “buy now with discount code” page?

I upvoted it because:

1. HN, in my experience, is an extension of ycombinator. Since it's this guy's entrepreneurial thing, I think that's relevant.

2. I'm interested in Rust, though I've never used it.

3. I'm the target demographic for this.

edit: formatting

Re: Zero to Production in Rust

#36
post #11

Earlier quoted context omitted.

Why? Golang has a much less advanced type system, comparable runtime performance, a smaller developer community, and a smaller package ecosystem. Plus, if you're building a backend for a webapp, TS allows your engineers to build full-stack features in the same language, avoiding context-switching, code duplication, and other overhead.

I accept all your points, but comparable runtime performance? That's the only reason that people away from node/ruby/python towards gaoling.

As far as I know, after Node.js/V8 the only reasonable performance gain comes from switching to Rust/C/C++. Everything else is just a few % faster, not a magnitude.

Re: Zero to Production in Rust

#37
post #31

So I've just tinkered around a bit in Rust, and I'm not intimately familiar with the language. My experience has been pretty good, but I don't see how it's a good fit for the web domain. At least not the enterprisey, CRUD, business apps I'm used to building. I'd be curious to hear from people who have been using Rust for their web backends, though. Beyond the classic selling points of speed and safety, what benefits…

We are using Rust for backend web development and other things. For us, the safety is the critical reason to choose Rust - particularly the thread-safety. Also the relatively small memory footprint compared to something like Java. Performance hasn't driven our decision at all - the number of requests per second is very low. It's correctness that matters. We are a bit unusual because customers have locally deployed se…

What web framework do you use? This to me seems like the part that's least-baked at this stage. Iron doesn't support async if I recall correctly, actix supposedly has a complicated mental model and was mired in drama last I checked, and Rocket looks promising but is still in the somewhat-early stages.

Re: Zero to Production in Rust

#38
post #32

Earlier quoted context omitted.

The DB space for Rust is a bit young, though there are several good projects like sqlx making it much more pleasant. Rust shares many of the benefits of Go: - statically linked binaries for ease of deployment - good concurrency - builtin testing framework But it's a much sharper tool than Go: - Really great error handling with Result/Option and the ? marker - Like, really really good error handling, esp compared to G…

"good concurrency" Async rust is very messy and a pretty big issue atm. The tooling on the IDE side is subpar compared to Go.

To write custom futures? Yes, you need to understand Pin and some advanced stuff.

To use? Eh - I just turn on async_std with the Tokio flag and write go-like code with async tasks. No issues thus far.

Re: Zero to Production in Rust

#39
I'm pretty interested in learning rust to build APIs, but I'm already productive with Java and Node/Typescript and wonder if it would be worth it, aside from being interesting.

Anyone up for giving me an elevator pitch that it would be? Or, also interested in confirmation that it wouldn't!

Re: Zero to Production in Rust

#40
post #2

This looks really great. £35 Individual, £100 Team, £600 Company, seems like fair/straightforward pricing for a team that has members who know some Rust but haven't built out a production API with it yet. I wish every tech stack had a book like this, and I think it'll be particularly valuable for an exciting new language with a learning curve like Rust. I will note, though, that I'm currently consulting on a team tha…

I have been involved in training several "junior" devs in Rust and I would say that it's more about their ability as a developer rather than them being junior.

Developers who could get by professionally in Python, but were not particularly good, have struggled with Rust.

However, we have several developers who joined us directly from their undergraduate degrees who have picked up Rust extremely easily.

Post reply on HN