Using Rust at a startup: A cautionary tale

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Phoenix

    Peace of mind from prototype to production

  • Really! The flagship web framework for Elixir, “Phoenix” is pretty well made

    https://www.phoenixframework.org/

  • GSL

    Guidelines Support Library

  • > With Rust, though, one needs to learn entirely new ideas — things like lifetimes, ownership, and the borrow checker. These are not familiar concepts to most people working in other common languages ... Some of those “new” ideas are, of course, present in other languages — especially functional ones.

    With C++, lifetime and ownership are just about as important but unfortunately no one's got your back. You can ignore lifetimes and ownership but you do so at your own peril. And the compiler won't tell you you're doing it wrong because the language wasn't designed for it to do so.

    If you want a taste of rust's "mindset" (with respect to limitations imposed by some types) without jumping ship to a new language, try C++'s Guidelines Support Library [1]. It introduces some of the same benefits/friction as switching to rust but without a new language. Opting-in to some of these guidelines might be a gentler way to get some of the benefits of Rust. But it comes with a similarly higher bar.

    [1] https://github.com/microsoft/GSL

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • ihp

    🔥 The fastest way to build type safe web apps. IHP is a new batteries-included web framework optimized for longterm productivity and programmer happiness

  • fastify-type-provider-typebox

    A Type Provider for Typebox

  • My experience is that it's fine(tm). "JavaScript on server-side" does not bother me; V8 owns bones. None of my debugging output includes JS lines because I pack source maps, which TypeScript happily includes.

    Multi-threading isn't complex, because there isn't multi-threading. There's coprocessing via Promises, and there indeed are a lot of Node developers who think you don't need locking functionality because it's not multi-threaded (there was an absolutely bonkers discussion a few years ago where a JS developer insisted you didn't need locks), but whatever, they think that about other languages too, use async-lock or whatever.

    "Maturity" is a word that means different things to different people. There is not a consensus-best-choice framework like Spring Boot in Node. But the tools are there and they're excellent (Python is similar, FWIW--FastAPI is the closest thing to a right answer that I think I've ever used, I wish I liked Python more because that owns). Fastify is perhaps The Best web framework I've ever used, and it has only gotten better with v4 allowing you to engage with type providers to create an end-to-end, automatically typechecked route declaration framework. It lets you do stuff like this, where you specify a request schema as JSON Schema (encoded via typebox) and it'll statically derive the TypeScript type for you whilst also using it for request schema validation:

    https://github.com/fastify/fastify-type-provider-typebox#exa...

    The tools are there. You do have to wire them together. There's value in that, for the way I write code and the stuff I enjoy building.

    Overall, I'll trade some compilation niceties and even some (but to be frank, not much) performance for a vastly better language in day-to-day use. I really like the JVM. I've been using it professionally for twelve years. I also like the CLR. I did Google Summer of Code for the Mono Project in 2008, I've been around. But the day-to-day of writing code in the dominant languages on those platforms for things other than CRUD does frustrate me, and the difficulty of using the type system to effectively encode intent makes it much harder for me to write software that can guide other people to not misuse it.

    (If I ever wrote something at extragalactic scale, yeah, sure, whatever, I'd rewrite hot paths in something else. But I absolutely don't care about that.)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts