Live data from Hacker News

I love building a startup in Rust but wouldn't pick it again

propelauth.com

211–220 of 496 posts

Re: I love building a startup in Rust but wouldn't pick it again

#211

I can't get it why people would prefer to add "?" to everything instead of just having exceptions which automate that behavior. In the bad old days of C there were two kinds of programs: programs without correct error handling, and programs where half the loc are unhappy paths that do what exceptions do... with a huge amount of work. Today people are repeating the same mistakes of the past, putting a "?" on everythin…

Exceptions make it difficult to find failure-points in the code. The ? annotates that at its call site, which improves discoverability by a lot and reduces readability by only a little.

> Exceptions make it difficult to find failure-points in the code

My experience doing Java, Go and Rust has been completely the opposite. Exception stack traces in Java are amazingly wonderful things - they exactly pin-point the failure points in the code. The amount of hunting I need to do to find out where something failed in the call stack in Go/Rust is tedious. You need a module/crate for error tracing or you up waddling against a strong current of despair.

Re: I love building a startup in Rust but wouldn't pick it again

#212
post #37

If you're thinking about building something in Rust, a good question to ask is, "what would I use if Rust didn't exist?" If your answer is something like Go or Node.js, then Rust is probably not the right choice. If your answer is C or C++ or something similar, then Rust is very likely the right choice. Obv, there are always exceptions here, but this helps you work through things a bit more objectively. Rust can be a…

Three months ago I had made exactly similar comment, it felt nice to me to see the same thought echoed! https://news.ycombinator.com/item?id=33845045

[deleted]

Re: I love building a startup in Rust but wouldn't pick it again

#213

Earlier quoted context omitted.

> and hiring skilled Rust devs is just crazy hard (though maybe now that Blockchain/Solidity things have cooled there may be more supply). Sidenote, we hire Rust at a small shop (~30 devs?). Ironically i've found it _easier_ to hire for Rust. You're totally not wrong, BUT, the quality of the candidates that apply is quite high in our experience. I suspect it's because we get a lot of passionate people. We don't have…

> With that said we don't aim for super senior devs. We're happy to hire a junior, etc. I care much more about the quality of the person than raw experience. Being young and cheap is a good quality, I suppose. Experience is overrated.

> Being young and cheap is a good quality, I suppose. Experience is overrated It's "overrated" until it isn't. And then you learn very, very expensive mistakes. Unfortunately it takes experience to learn why this viewpoint is nothing more than hubris.

Re: I love building a startup in Rust but wouldn't pick it again

#215

Earlier quoted context omitted.

If I am in the business of writing robust code; then "assuming all functions can throw" means at the very least forcing every function call to be surrounded by a try/catch block? It almost always make sense to handle an error locally if you can; for example if I want to retry the operation (let's say I'm writing a distributed database client), it may make sense for me to retry another node rather than unwinding to th…

> It almost always make sense to handle an error locally if you can This is highly presumptuous. I have written many programs that did not need to handle errors locally, and so exception handlers were only at the very top level (or, actually, just below the top-level usually - but the point is that there were generally few and I had flexibility to decide where to put them). Perhaps you and I write very different appl…

> It almost always make sense to handle an error locally if you can

Yes, but “if you can” does a lot of heavy lifting here. In most cases you can’t, and this is when Rust’s ? is used.

Re: I love building a startup in Rust but wouldn't pick it again

#216
post #162

Earlier quoted context omitted.

Go is in a sweet spot where it is often used to compete with both groups: [Rust, C/C++] and [Node, Python, Ruby, etc]. The reason GP said it is probably because of Garbage collection. I've done a bit of Rust in my job, and there are some basic things that Rust doesn't have going for it: - steep learning curve (this means for the first 6 months, you or your colleagues are unproductive, write bad Rust which your compan…

> - Verbose. I've seen a just few lines of JS get replaced with hundreds and thousands of Rust. Please, more detail (=

I should've been clearer, sorry.

The verbosity and complexity of `wasm_bindgen`/serialization between JS and Wasm (written in Rust) is primarily the thing I am frustrated at here when I see hundreds and thousands of Rust code. A concrete example: creating a Websocket client in Javascript/Typescript vs in Rust/Wasm.

In general though (outside of Wasm), Rust is less readable.

And with regards to Rust errors, I've found Rust errors related to Tonic and Diesel to be quite annoying/unreadable. The Diesel docs seem to blame Rust for this (can't find the docs for it right now).

Re: I love building a startup in Rust but wouldn't pick it again

#217

Question for HN, all things being equal (you are not more familiar with one language/framework) what language would you choose to build a startup in?

The one appropriate for what you're trying to build. It may mean multiple languages.

Not everything is a CRUD mobile app trying to be the next tinder for cats.

Re: I love building a startup in Rust but wouldn't pick it again

#218
post #169

Earlier quoted context omitted.

Not really, just do a rolling deployment like you should be doing anyway. No one cares if the new version takes 1 millisecond to start up or 3 seconds because they literally won't notice.

Rolling deployment is a hack imho. Adds complexity and hence yet more potential failure modes.

Hardly, it's a fantastic guardrail when combined with health checks. You can say "you don't need it", but everyone makes mistakes sometimes. Make those mistakes not matter. You also take backups, right? Same idea.

Re: I love building a startup in Rust but wouldn't pick it again

#219

I disagree, I believe that Rust is a fabulous language for early prototypes. Sure, if you're going to throw away your early prototype there are better languages. But nobody ever does that. Instead your prototype evolves into your product and early expedient decisions you made that were appropriate for a prototype aren't appropriate for your product and you have a significant refactor. And Rust is the best language I…

> But nobody ever does that.

Please don't report your own experience samples as plain universal facts. It is one of the more common means by which falsehoods spread. I have no doubt that's not your intention, and you believe what you write, but you cannot have a basis for such a bald statement, and it happens to be false.

I have seen prototypes built and discarded very frequently. Indeed in an earlier incarnation it was my own professional focus.

I have no idea how common it is in your country, or globally, or in specific industrial sectors. Usable stats in tech are hard to come by (in large part because of its ubiquity). But your statement is just false, and commonly repeated.

Re: I love building a startup in Rust but wouldn't pick it again

#220
post #162

Earlier quoted context omitted.

> - Verbose. I've seen a just few lines of JS get replaced with hundreds and thousands of Rust. Please, more detail (=

JS: new HTMLDivElement() Rust: struct WebBrowser { ...

Instantiating an object vs defining one? Yeah definition would be longer.
Post reply on HN