Live data from Hacker News

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

propelauth.com

51–60 of 496 posts

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

#51
Maybe nowadays we should all use glue-script + compiled-ffi to iterate fast while keep performance under control?

e.g python+cffi, or python+pyo3(for rust), or even lua+capi?

do we really need code everything in compiled language these days? the cold path can be dealt with by scripting languages, and let the c/c++/rust/etc to handle the performance critical path instead.

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

#52
post #26

Earlier quoted context omitted.

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.

Why impose the "embedded systems" space requirement on the OP? The OP does not work in embedded systems space. So it is not relevant to this article. The OP is telling us what they would do, not what you should do and definitely not what embedded systems startups should do.

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

#53
post #32

I've been writing Rust professionally for a few years now and if there's one thing I've learned it's that if you ever write a function that takes a parameter of `impl Fn(&Vec ) -> &'a str` you are going to be in for some pain. Just make it `impl Fn(&Vec ) -> String`. It is highly unlikely that the extra allocation is ever going to be noticed in the performance. Just because Rust pretty much forces you to be explicit…

> It is highly unlikely that the extra allocation is ever going to be noticed in the performance.

I had almost this exact scenario, and yes there is pain in writing it with explicit lifetimes. But I can't agree the performance improvement is negligible; maybe in isolation, but I saw about a 100x speed increase for my application when I switched away from Strings. For me it was because I was doing many of those extra String allocations in a loop, so it killed my performance.

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

#54
Really, unless one needs deployment scenarios where any kind of automatic memory management is not an option, there are several compiled languages with Rust like type systems and much better workflows.

Go pick OCaml, Haskell, Scala or Kotlin with GraalVM or OpenJ9, F# with NativeAOT, Swift, Nim, D, whatever.

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

#55
post #26

Earlier quoted context omitted.

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.

That's fair, I was definitely being a bit too general. There's another comment in this thread that summarizes it better which is asking "what would I use if Rust didn't exist?" and I think that's a more clear line. All of my embedded work was in C/asm so Rust is actually a great choice there.

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

#56
I don't know, I haven't had a fight with the compiler in a long while now. On the other hand a $42 dedicated box benchmarked my project's REST API at 270,000req/s. I don't even use a DB, just structs serialized in JSON to a disk and a NAS once every few seconds. One pet IPv6 only server to manage + CloudFlare (Domain, DNS, Cache). Beats today's peak complexity setups, hands down.

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

#57
My biggest pain point with Rust (in a startup context) is that Rust works really well, until you get to anything related to threading or async.

Yes, the claim is "fearless concurrency" but you'll still deadlocking mutexes and once you're heavily into async you need to start using language constructs that feel REALLY awkward, like pinning, runtime checks like RefCell, and so on.

IMO if Rust could make that whole aspect of the language more elegant, it'd be much easier to scale up to a larger org.

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

#58

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…

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.

Assume all functions can throw and there is no extra work reading. A function that has no possibility of error is so uninteresting in the context of error handling.

Furthermore, handling errors has little to do with where the error is actually caused. In general, you can only do two things with errors: log and kill the operation or retry the operation. Neither of these has anything to do with the leaf function 20 items down in the stack that actually made the network call that failed.

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

#59
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 have ever encountered for refactoring. Just bang away changing the code until it compiles, and it's quite likely that once it compiles it actually works. That's not an experience I've had in any other language. Usually a significant refactor exposes some foot-guns that don't fire until significantly later. So you avoid refactoring and your code ends up a right mess.

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

#60
People who are really interested in rust tend to be top-tier developers. I don't think they're consciously lying about their experiences working with the language but they may not hit the speed bumps that normal people would. My personal abilities make me competent in golang, ruby, python, java, c++. I love the quasi-functional styling of rust but whenever I've tried to build small projects in it I've gotten bogged down in fighting with the compiler in ways I never do in the former. It is fast as all get out tho!
Post reply on HN