4 ms·
I'm doing some work on a friend's startup, and we have a pretty stark divide between our hot path gateway service and our lower traffic services. All three of
by strken 4y ago
I'm doing some work on a friend's startup, and we have a pretty stark divide between our hot path gateway service and our lower traffic services.
All three of our services are currently written in typescript with no plans to change, but I've earmarked the gateway as "maybe we'll rewrite it in Rust in three years." It's so small it's nearly trivial (so a rewrite of that specific service will be quickish) and infrequently changed (so hiring won't be as big an issue), it deals with low latency IO-heavy workloads (so we'll possibly want a language without GC pauses), and we really don't want it to break (so it's worth more effort per line).
Not sure how a hybrid approach will work.
- ekidd 4y ago> Not sure how a hybrid approach will work. The hybrid approach works great. We use typed scripting languages for business logic and Rust CLI tools for "inner loops", and this balance gives us the best of both worlds. There is an important caveat here: If you are already comfortable in Rust, then it's a fantastic tool for all sorts of things. But if you're just learning Rust, then there's a one-time cost for getting comfortable. So for a small team with zero prior Rust experience, expect to spend 2-6 weeks getting comfortable. (The learning curve is shorter if you already know about pointers and closures, and longer if it's your first low-level language.) Your plan sounds entirely reasonable.
- orangetuba 4y ago2-6 weeks? I wish I could learn Rust in that time.
- HWR_14 4y ago> The learning curve is shorter if you already know about pointers and closures Every time I read something like this, I'm reminded that pointers and closures aren't universally understood concepts in professional programmers. And I'm sad.
- chungus 4y agoI share this sentiment, it's kind of a bummer. I ran into this non-stop in enterprise Java/C# development environments, more specifically in developers who are not "classically schooled" (i.e. bootcampers). Fact of the matter was, they never needed to know about pointers to do their job. They only even knew the term from the "null pointer exception". I looked into the curriculum of various levels of IT studies and unless you get taught at university level there are little to no memory / hardware oriented classes. It has started to get a bit better since the introduction of Java 8 (don't look up how long ago this was, ouch) and people got familiar with "lambda's".
- klodolph 4y agoThe 2-6 weeks figure seems optimistic to me. I think it’s easy to underestimate how long it takes to switch languages and operate at a high level of productivity in the new language. Yes, switching languages is much easier than learning to program. Yes, I would rather hire a proficient programmer who doesn’t know the language than a mediocre programmer who does. But no, I don’t think that 6 weeks is enough for most people to get their Rust skills to a professional level.
- gwbas1c 4y agoFYI: If you're primarily IO-heavy, the GC pauses aren't going to be a big deal. Something like NodeJS (or Async .Net) will have great performance; even with garbage collection. (IO-heavy is the specific use case that NodeJS was designed to handle.) GC pauses really become a problem when you have long-lived objects in RAM. A generational GC (which pretty much all of them are) is designed to collect short-lived objects extremely fast. Rust definitely has its use; but in the case of a startup making an IO-heavy product, you're going to be better off spending your precious resources on a slightly faster computer instead of struggling with Rust's learning curve.
- staticassertion 4y ago> FYI: If you're primarily IO-heavy, the GC pauses aren't going to be a big deal. Something like NodeJS (or Async .Net) will have great performance; even with garbage collection. (IO-heavy is the specific use case that NodeJS was designed to handle.) This just isn't true. Node is pretty terrible even at IO heavy workloads, especially if you have servers with many cores. Any benchmark will confirm this.
- hu3 4y agoTheir point is that GC is fine. Your're focusing on one of the suggestions: nodejs. But .NET or Go are very fast for typical I/O bound workloads.
- staticassertion 4y agoYes, that's why I quoted one specific part and responded to that specific part.
- hu3 4y agoNo you included the GC part too: > FYI: If you're primarily IO-heavy, the GC pauses aren't going to be a big deal. To further my point: .NET and Java are amazing when it comes to performance for most cases. You get a mature ecosystem, large developer pool, fast runtime and all the comfort that GC offers. I'd argue that choosing Rust for most startups is outright irresponsible.