Live data from Hacker News

Why Rust is a great choice for startups

dailyedit.com

121–130 of 294 posts

Re: Why Rust is a great choice for startups

#121
post #5

>(...) despite my experience and best intentions, I was in fact making mistakes with C. Subtle leaks, use-after-free,(...) Rust made it very clear that I was not the programmer I thought I was. This really resonated with me. I feel a lot more confident writing code in Rust than say in C or Java. However, in my opinion, it also comes with a downside: These days, whenever I use a 'more forgiving' programming language I…

Do you pine for the nice days of C/C++, when men were men and spend hours on debugging segmentation faults?

This is quite rare in C++ since C++11.

Re: Why Rust is a great choice for startups

#122
post #89

Earlier quoted context omitted.

I would like to add that async Rust still doesn't really work. That is a big negative for Rust.

This constant refrain must be discouraging to the people who have worked so hard on async rust. Can we please restrict our criticism to specific problems, and temper it with gratitude for the amazing things that the Rust developers have already given us free of charge?

I am not sure what is so "un-tempered" in the original message (assuming it is not technically incorrect) and what makes Rust so special that criticism must be "tempered with gratitude".

Re: Why Rust is a great choice for startups

#123

Actually, I think Rust is a godsend to startups for the following reasons: 1.) startups rarely have time, expertise or budget for extensive unit tests, mock-up tests, UI-automation tests or paid third-party Q/A services, 2.) software product users these days have a strong tendency never to submit bug reports or work with product support, but instead just leave negative reviews and/or just move on to the competition,…

What makes Rust better for these attributes than any other statically typed language with immutable data structures? It sounds like Ocaml would do just as good of a job here.

Ocaml is absolutely playing in similar spaces as rust. I see the tradeoff there as one of runtime performance (Rust) against less syntax / dev effort (Ocaml). If you don't need your code to go fast, Ocaml is probably just fine for you to use. Hell, Jane Street famously does so and has talked in great detail on their podcast and in articles about the many strengths and tradeoffs involved here.

Re: Why Rust is a great choice for startups

#124
post #117

Startups are about cost, time to market, and a high level of efficiency to deliver on a promises ( product ) to sell or get to market. A language selection should consider two things, talent pool and maturity of the tools. When you go hire developers, I want a strong pool to be able to be selective in finding attitude with the right aptitude, and I want them to be productive ASAP, so that means that we might bring in…

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 infrequen…

> 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.

Re: Why Rust is a great choice for startups

#125

Earlier quoted context omitted.

Rustian Safety Rustian Garbage collection

> Rustian Garbage collection Genuinely curious here: the Java GC (still in 2022) is often a major headache in production wrt latency when system is under load. How's the Rust GC in that regard?

Rust isn't a Garbage Collected language.

However, because Rust cares about who owns things, it gets to have all the benefits you get with say RAII types in C++ except seamlessly (in safe Rust anyway).

Imagine you make a Doodad, like you call a constructor for it maybe, or there's some call somewhere that gives you a Doodad. OK. Now you put the Doodad in a Hashtable of Doodads. Well, is that still your Doodad? Are you responsible for ensuring it is properly cleaned up at some point? Or does the Hashtable now take responsibility for it? If somebody looks in the Hashtable, do they get back the Doodad? Now is it no longer the Hashtable's responsibility?

Rust systematically has answers to all these questions, which permeates the language and its ethos, in exchange it gets to have really nice properties.

Re: Why Rust is a great choice for startups

#126

Startups are about cost, time to market, and a high level of efficiency to deliver on a promises ( product ) to sell or get to market. A language selection should consider two things, talent pool and maturity of the tools. When you go hire developers, I want a strong pool to be able to be selective in finding attitude with the right aptitude, and I want them to be productive ASAP, so that means that we might bring in…

On the other hand, you might attract talent that wants to use a specific language like Rust, but hasn't had the chance in their current professional environment.

That'd be a disaster for a startup. In order to use Rust efficiently, one needs to have a significant experience with it; without experience, one wastes a lot of time wrestling with ownership, lifetimes etc.

(I do program in Rust in my (non-trivial) hobby projects).

Re: Why Rust is a great choice for startups

#127
post #124
post #117

Earlier quoted context omitted.

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 infrequen…

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

2-6 weeks? I wish I could learn Rust in that time.

Re: Why Rust is a great choice for startups

#128
post #122

Earlier quoted context omitted.

This constant refrain must be discouraging to the people who have worked so hard on async rust. Can we please restrict our criticism to specific problems, and temper it with gratitude for the amazing things that the Rust developers have already given us free of charge?

I am not sure what is so "un-tempered" in the original message (assuming it is not technically incorrect) and what makes Rust so special that criticism must be "tempered with gratitude".

Rust isn't special; what I said applies to any open-source project. But people have been pretty harsh about async in Rust lately, and IMO the message I was replying to makes the problem sound worse than it is.

Re: Why Rust is a great choice for startups

#129

Actually, I think Rust is a godsend to startups for the following reasons: 1.) startups rarely have time, expertise or budget for extensive unit tests, mock-up tests, UI-automation tests or paid third-party Q/A services, 2.) software product users these days have a strong tendency never to submit bug reports or work with product support, but instead just leave negative reviews and/or just move on to the competition,…

What makes Rust better for these attributes than any other statically typed language with immutable data structures? It sounds like Ocaml would do just as good of a job here.

I don't know OCaml, so I cannot compare the two, but, generally speaking, Rust does not require functional programming, or using only immutable data structures, or using cloning, or using copy-on-write semantics (which have to properly handle the reference-type-inside-a-value-type problem), but works through no-copy data ownership transfer, multiple immutable references, or only a single mutable reference to data at a time, all checked across threads at compile-time. Finally, Rust is not garbage-collected, so it can be used in resource-critical environments, such as embedded, metered serverless, Linux kernel drivers, etc. If you're interested, have a look at the "A Firehose of Rust, for busy people who know some C++"[1] video.

[1] https://www.youtube.com/watch?v=FSyfZVuD32Y

Re: Why Rust is a great choice for startups

#130
post #91
post #33

Earlier quoted context omitted.

This kinda counter-resonates with me. I'm not a superb programmer by any means, but C's memory management rarely caused me bad problems. I find it much easier to deal with than the complexity of languages like C++ and Rust.

Calling malloc isn't even manual memory management to me, it's just calling malloc. Writing malloc (not that hard in general! but tricky to get exactly the allocator performance or security properties you want for your use case) is manual memory management.

> In computer science, manual memory management refers to the usage of manual instructions by the programmer to identify and deallocate unused objects, or garbage.

https://en.wikipedia.org/wiki/Manual_memory_management

So, you can call it however you like, but calling `malloc()`/`free()` manually (emphasis on the `free()`, since allocation is explicit in most languages in form of `new` or something) is manual memory management, and this is how most programmers use this term.

Post reply on HN