Live data from Hacker News

High-Level Rust: Getting 80% of the Benefits with 20% of the Pain

hamy.xyz

101–110 of 122 posts

Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain

#101
I've been using Rust mostly at a high level myself... Mostly a few Axum web services, or quick CLI tools. Even if you're a little dirty with it (clone instead of fighting the burrow checker or bringing in arc, etc.), it's pretty small, light, portable and performs as good or better than where I usually reach first, which has been a lot of Deno+TS for scripting.

AI has taken this a step further... I'm pretty good at following along with what is happening in Rust even if I don't always remember the syntax while writing myself. I'd say that AI is better at outputting sane Rust than just about any other language I've tried with it.. and that the more planning time you spend, like anything else, the better the output.

I usually am pretty thorough on designing my interfaces/api surface etc well ahead of the code... so doing similar with more details with an AI agent has been somewhat pleasant to work with.

Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain

#102
post #16

Regarding TypeScript: > but types lie at runtime (unsound) requiring you to add your own runtime checks. I don't recall doing that outside of situations when data is crossing system boundaries. The vast majority of languages have an unsound type system, yet people are productive in them. Over the years I've come to realise it's a form of nitpicking. You absolutely need it in some applications, but it's not an importa…

I agree. Ironically have inherited a lot of projects where they picked a "type-safe" language but didn't properly type the system boundaries, including RPC and database. Wrong priorities there.

Adjacent to the article... there are a lot of bits from WCF I really liked and miss. I didn't really like a lot of the default way to use it... I generally would combine all the interfaces and a client instance generator into a single library to share (as opposed to the XML config crap the people tended to default with).

Today, there's tooling around OpenAPI/Swagger, but I don't think it's nearly as nice as using WCF for the server and client interfaces directly.

Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain

#103

Is the DX really that bad? You get a world-class package manager, test suite, formatter, linter, with multi-platform builds out of the box for free. Rust definitely has it's edges, but I think education is the problem, not the DX.

> You get a world-class package manager, test suite, formatter, linter, with multi-platform builds out of the box for free. Yes. Rust is incredible in all these respects, perhaps the best, however the readability is just not good in comparison with e.g. Swift. This is probably due to language limitations like a lack of variadic generics, one of the reasons there are macros everywhere in Rust codebases, which severely…

I don't think macros are all that bad myself... I'd say complex lifetimes are probably the hardest thing to grok when reading rust and that you can avoid a lot of that depending on how your code is structured.

Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain

#104
post #4

Java have less of a DevEx score than C# is crazy work.

Reified generics, value types, nullable reference types, LINQ are only some of the things that would give C# an edge in DevEx today.

Not sure if it's still the case, but C library interop in C# is the main reason I chose to start with the alpha/beta versions of C# over Java around 2000-2001.

Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain

#105
post #97

Earlier quoted context omitted.

Java has first class sum types, pattern matching, and compiler exhaustion on types. It's probably far more expressive than C# currently until they get union types.

Well, C# has more powerful pattern matching, only compiler exhaustiveness on types is missing today. In Java, sum types (sealed interfaces/classes) require all members to have the same parent, so they can be used only in very narrow cases.

As opposed to C# that doesn't have any form of sum types?

Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain

#106

I've been using Rust mostly at a high level myself... Mostly a few Axum web services, or quick CLI tools. Even if you're a little dirty with it (clone instead of fighting the burrow checker or bringing in arc, etc.), it's pretty small, light, portable and performs as good or better than where I usually reach first, which has been a lot of Deno+TS for scripting. AI has taken this a step further... I'm pretty good at f…

> I'd say that AI is better at outputting sane Rust

Which is a recent development. A year ago LLM's really struggled with Rust.

Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain

#107
post #105

Earlier quoted context omitted.

Well, C# has more powerful pattern matching, only compiler exhaustiveness on types is missing today. In Java, sum types (sealed interfaces/classes) require all members to have the same parent, so they can be used only in very narrow cases.

As opposed to C# that doesn't have any form of sum types?

C# will have more advanced sum types this year, it's currently in preview.

Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain

#108
post #97

Earlier quoted context omitted.

I think devx is being misused in this article a bit. Obviously the tooling for java is second to none, aside from maybe the travesty that is gradle. What they apparently mean is how "ergonomic"/"expressive" the actual syntax and type systems of those languages are. In that case c# is ahead of java by a decent margin. Luckily java is still evolving, usually by stealing many of the good ideas from other languages like…

Java has first class sum types, pattern matching, and compiler exhaustion on types. It's probably far more expressive than C# currently until they get union types.

Their sum types aren't particularly useful since they can never be used to implement union types which I believe c# has plans for following their sum types already in preview. So I guess similarly neck and neck.

Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain

#109
post #26
post #8

Earlier quoted context omitted.

Pretty sure by devx they mean something like syntax ergonomics. Because otherwise rust's devx first class (cargo, clippy, crates.io) so kind of a nonstandard definition. I think it's fair to say Java's "syntax ergonomics" are a little below the rest / somewhat manual like rust or C++ by default.

Yeah, but worse than Go?

The go tooling and ecosystem and how it "just works" runs rings around the Java clowncar.

Re: High-Level Rust: Getting 80% of the Benefits with 20% of the Pain

#110
I'm surprised no one in the comments is mentioning Kotlin. Out of all the languages I've worked with it has been the most enjoyable by far. I agree with the article that there isn't much community but I feel like that's arguably the least important category there. You should definitely give it a shot if you've never tried it before.
Post reply on HN