Live data from Hacker News

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

propelauth.com

451–460 of 496 posts

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

#451

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?

Edit: Had just woken up and didn't notice "you are not more familiar with one or the other". Hm, will have to think on that one.

Haskell. I know it best and know at least 10 people I could hire that also know it.

I can be as safe or as unsafe as needed where it's needed and get good performance without thinking about it most of the time.

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

#453
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…

I would differ that Rust would not be a better choice than Rust.

Seeing Rust as a system programming language only is missing the bigger picture (IMO).

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

#454

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…

After a couple of years of coding Rust, I found the error system, including the ?, well thought out. It is explicit and clear that the error is or maps to the function return error.

The only thing is that Rust rightfully uses the ? to return early system on option as well, which removed the ability to have None coalescing with "?". This was the right choice from a language point of view, but I wish there would be a None coalescing syntax in Rust.

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

#455

Earlier quoted context omitted.

> 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. I've been saying that for a while. If you're building web backends, Rust is not a good choice. Go is so much easier. The green thread system gets rid of the thread/async distinction, garbage collection means you don't have to obsess o…

> A big problem with Rust, long-term, is that the kind of programs that really need it are somewhat out of today's mainstream. It's not that useful for webcrap. It's not that useful for phone apps. The AI people use Jupyter notebooks and Python to drive code on GPUs. One thing this is missing is that Rust is useful for libraries callable by many different languages. You may or may not want to use it to build an actua…

Except that is the exact reason why I would pick C++ instead of Rust, the Java, .NET and JS ecosystems are written on top of C++, and the libraries I might want to write bindings for, are also written in C++.

Adding another language in the middle will only complicate our toolchain.

Regarding Python, with the pressure from Ruby, PHP, JS and Julia JIT compilers, they will eventually get more serious about JIT adoption, and then there is ctypes of OS APIs.

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

#456

Earlier quoted context omitted.

> If you're building web backends, Rust is not a good choice This heuristic wouldn't work for my department because we build web backends in C++. I keep telling the most senior devs here that nobody does this and for good reasons (velocity etc), and their response is "who cares what the rest of the world does, they're just bad at C++."

Google developed Go specifically so they didn't have to use C++ in high-volume web backends, which is what they did previously.

Nope, Google is fine with Java and C++.

Go authors always disliked C++, and got a manager that allowed them to work on their toy language, which eventually became Go.

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

#457

Earlier quoted context omitted.

Rust easily gets 10x improvement in performance over Python in a lot of applications. This is absolutely my experience. A better statement is that it doesn’t get 10x improvement over Go, or other ergonomic compiled languages.

Also in the context of cloud spend: way way way less RAM, which can translate directly to dollars.

Yeah, I just wrote a simple daemon in C that had no performance requirements ( listening to a udp socket and dumping stuff into a pgsql db once a minute) because the Python program would use like at least 20x the RAM. When you're running a bunch of things on a resource constrained place (e.g. a single computer that has to do a ton of things sitting on a rack on the Greenland ice sheet), even just the base Python memory usage from a new process adds up...

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

#458

Earlier quoted context omitted.

Are you referring to the “compile to a big executable” feature? I’d love to use C# without having to deal with distributing the runtime, so I’d like to hear more!

> I’d love to use C# without having to deal with distributing the runtime, so I’d like to hear more! In the later versions of DotNet there are a couple of common ways to distribute (I'd suggest either DotNet 6 [LTS] or preferably DotNet 7 [current]). You'd usually use the dotnet publish command, which ideally produces one of three things, all of which are self-contained and can be deployed to a clean server without a…

There are many features commonly used in C# libraries that preclude AOT as I understand it -- mostly heavy use of reflection.

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

#459

Earlier quoted context omitted.

I think it depends on what you're doing. I'd argue statically typed Python (ie. with type hints) is also good for an early-prototype language and has the benefit of being able to swap out parts at a time via C FFI with Rust or something like PyO3. Pypy with asyncio (so FastAPI?) is what I'd choose for a web framework these days, personally.

I agree; Python is a great choice especially if whatever you're building is heavy in math and/or ML. The ecosystem is just better so it makes sense then to build your backend stack with Python.

Plus with Django you can build an API, storefront, and admin area in like a day. It would probably take a couple weeks with Node/Java and React etc.

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

#460

Earlier quoted context omitted.

> 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. I've been saying that for a while. If you're building web backends, Rust is not a good choice. Go is so much easier. The green thread system gets rid of the thread/async distinction, garbage collection means you don't have to obsess o…

I’ve been writing data ETL pipelines in Rust and having a fantastic time. Most of my data, cost and performance requirements aren’t suited to the likes of FiveTran/etc, and whilst I could theoretically use Python, it’s far too slow, and the propensity to crash unexpectedly (meaning I have to spend extra time debugging) means the development velocity is actually worse than just writing it in Rust. Plus, most of the li…

How much of your ETL is rust vs SQL? I agree pandas for ETL isn’t the fastest but why not isn’t SQL faster still? Or don’t you find yourself in the situation where there is so little logic in the ETL that rust performance/safety isn’t that useful?
Post reply on HN