Live data from Hacker News

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

propelauth.com

41–50 of 496 posts

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

#41
post #26
post #3

So in his opinion, choosing Rust is a premature optimization?

Author here - yeah, that's how I feel about it, at least for startups specifically.

What if your startup is in the embedded systems space, for example? I don't think you'd be doing your MVP in Python.

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

#42
post #14

Earlier quoted context omitted.

I prefer having extra work done writing code (adding "?") than having to do extra work reading code. Exceptions are functionally invisible control flow; it isn't clear to the reader that a function may blow up if the exceptions are unhandled.

In Java functions declares Exceptions in its type signature, so it does all of that automatically. Then you get a compile error if you don't handle it in the function, or you need to declare the function throws it, so it is type safe. Note that people now consider that as a mistake, people prefer having Exceptions be hidden instead of explicit and requiring handling like that.

> Note that people now consider that as a mistake

Correction: Some people. Java's checked and unchecked exception approach is quite nice if used judiciously. It certainly beats checking for error after every function call (default: mostly people ignore error codes) and you even get typed errors so you can trivially incorporate exception handling in the conceptual design as a first class design element.

I am frankly not sure how people get confused about "control flow" and exceptions. (In decades of Java programming the only thing that can still cause minor reading/writing nuisance are generic types and type erasure in over elaborate generic code.)

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

#43

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…

IMHO both exceptions and error handling in Rust (and others) have their upsides and downsides.

Personally, I much prefer Rusts solution, being both more up front and at the same time more terse.

The metaphor is kinda stupid though, the "cavemen" in our scenario knows very well that exceptions exist.

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

#44

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…

Error handling in Rust is actually a lot worse than you think. In fact it may be the single worst aspect of the language.

Fundamentally it is difficult to impossible to fix bugs without knowing what code caused it. Java-style exceptions give you a backtrace for free, which is a huge head start. With Rust you have to do a lot of manual plumbing with something like error_stack to get similar functionality, out-of-the-box Errs do NOT capture this.

Far more productive to work in an environment that does the right thing "for free" vs having to do it manually.

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

#45
post #26
post #3

So in his opinion, choosing Rust is a premature optimization?

Author here - yeah, that's how I feel about it, at least for startups specifically.

... then however, how do you feel about tech debt with Rust? My feeling was that go, rust and such left a lighter burden on the future than say ruby.

Do you think you will need a major rewrite soon?

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

#46
post #10

This is something I hear a lot from other founders. Spinup time of new engineers is like 6mo+, some devs who can churn out normal CRUD product work just fine in Rails or React ~never become productive with Rust, and hiring skilled Rust devs is just crazy hard (though maybe now that Blockchain/Solidity things have cooled there may be more supply).

N = 1, but at startup scale we have definitely not had a hard time hiring skilled Rust devs. Just go on /r/rust and advertise your (non-crypto) job and get a lot of inbound.

(We were specifically looking for remote folks near EU time zones, maybe local in SF is harder?)

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

#48

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?

Python or Go or a mix of both. I have seen new devs with no experience in either get get up to speed quickly in both. For a startup, velocity is critical.

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

#49

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…

The problem with exceptions isn't the syntax, but the hidden control flow (they are essentially a goto in disguise).

Error union return values make a lot more sense, the rest is just syntax sugar details (and that's where opinions differ I guess).

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

#50
If you are writing high performance code use Rust. (Slow development times, high performance)

If you are writing a typical business application use Python. (Fast development times, low performance)

Or if you want to be clever do a hybrid of both. Create Rust modules for your Python code.

This is just about selecting the right tool for the right job.

Post reply on HN