Live data from Hacker News

Zero to Production in Rust

zero2prod.com

111–120 of 195 posts

Re: Zero to Production in Rust

#111

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

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

Yep, that's how most people seem to feel about it before they try it.

Re: Zero to Production in Rust

#112

I’d encourage anyone considering Rust development to simply dive in and use freely available resources online. When I was first trialing Rust I didn’t feel like I was missing anything by using free resources. The Rust ecosystem is moving fast enough that a book might only be relevant for a short while anyway. You’d end up having to read the latest documentation to use updated packages anyway. This may not be a bad wa…

I self-taught myself the core parts of Rust, but when I recently decided that I wanted to do Rust full time, books like this (including this one, in fact) easily paid for themselves in terms of time saved even for a heavily discounted value of my time.

Re: Zero to Production in Rust

#113
post #33
post #25

Earlier quoted context omitted.

> 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 cod…

Rust is one the hardest language to read. Take two people that never used Go or Rust and make them read code, good luck with Rust.

Re: Zero to Production in Rust

#114

Earlier quoted context omitted.

> 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 would say the biggest barrier is developers not wanting to jump on yet another "this language will solve all your problems, trust me" train. My experience in my 15 years in software, is that good developers solve problems, not languages or tools.

The languages available today are a vast improvement over what was around 15 years ago. This isn't even all that specific to Rust, even many languages which existed back then have improved massively.

Many of which still have some catchup to do regarding Delphi, C++ Builder, Eiffel, Smalltalk and Common Lisp.

Re: Zero to Production in Rust

#115

Earlier quoted context omitted.

> 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 would say the biggest barrier is developers not wanting to jump on yet another "this language will solve all your problems, trust me" train. My experience in my 15 years in software, is that good developers solve problems, not languages or tools.

Right, it’s not like Rust has already influenced improvements in other languages and package managers. Definitely a fad

Making other languages take affine times more seriously, I agree.

Package managers, which ones?

Perl was the very first, almost every language has their own, and even the growing C++ ones are able to use binary libraries on their package managers.

Re: Zero to Production in Rust

#116

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…

I implemented a simple blog and resume personal web site using rust. I did it mostly as an exercise. I tried just jumping in and had a lot of trouble. I needed to go back and read the rust book. What I found was relatable to what I knew from Scala and C++ but definitely took some effort to learn compared to something like golang which I picked up in a week.

I built using actix 1.x, serde, chrono, rusqlite. I originally tried diesel but it doesn't support certain relationships that are common in SQL. I made my own traits for common CRUD and ORM patterns but I'm not happy with the amount of boilerplate code needed to implement them. I could clean them up with macros but I'm still rethinking the approach.

I did implement my own (unpublished for now) crates to output jsonapi formatted messages and handle uuid primary keys in sqlite, serde from the DB and json.

Overall I'd say it's comparable to coding a web app with C++, but perhaps more straight forward. I added my own middleware for Google Auth without much trouble. It definitely seems to be a "if it complies it works" type experience.

Re: Zero to Production in Rust

#117

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…

Rust has one of the best toolchains for Wasm.

Re: Zero to Production in Rust

#118

Earlier quoted context omitted.

> 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 would say the biggest barrier is developers not wanting to jump on yet another "this language will solve all your problems, trust me" train. My experience in my 15 years in software, is that good developers solve problems, not languages or tools.

>I would say the biggest barrier is developers not wanting to jump on yet another "this language will solve all your problems, trust me" train. Never underestimate what a team of overly enthusiastic junior engineers are capable of :-)

There's got to be a middle ground somewhere. I've worked in many places where the tech stack fossilizes because the ROE of learning how to use new, more productive tooling is too much effort for the senior devs compared to their existing responsibilities, many of which are non-technical in nature.

Meanwhile the junior-intermediate devs spend most of their working hours writing code, so they are extremely sensitive to the 5-10% productivity bump that could be gotten by using {nicer language, better build system, static analysis tooling/sanitizers, ${TOOLING_IMPROVEMENT}.

I'm talking real advances in productivity. Imagine working on a C++98 codebase today in 2021 because you're working on a very large industrial product that's been around for decades. It can be demoralizing, like having to write COBOL or FORTRAN.

Re: Zero to Production in Rust

#119

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…

If you were coming from Python/Ruby then the speed boost of Rust might seem like it is worth it, but if you are coming from Java/C#/Go/F# I agree it is a hard sell for a normal web back-end. But if you have one that is compute heavy, it could be a great fit. If you want to use mostly WASM on the front end, it could be a great fit as well. Don't have to ship a runtime with your wasm, and can share code.

Re: Zero to Production in Rust

#120
post #72

Earlier quoted context omitted.

Go doesn’t offer the same sort of guarantees as Rust does, but the goroutine/channel model nudges you towards a safe style

Go is memory safe for purely sequential code. It's not memory safe to share memory-write access among multiple Go threads. Using CSP idioms only, via Go channels, can preserve memory safety, but is prone to more general race conditions.

Although better, Rust can only protect against races coming from threads accessing in-memory resources.

For races related to external resources, or caused by misuse of OS IPC mechanisms (which is the future thanks Spectre), it offers as much protection as any other language.

Post reply on HN