Live data from Hacker News

Was Rust Worth It?

jsoverson.medium.com

421–430 of 736 posts

Re: Was Rust Worth It?

#421

Earlier quoted context omitted.

C# is underrated by the HN crowd, I find. I quite like how mid sized firms (100-1000 employees) use it.

C# is a lovely language to work with. The only issue I have is with the .NET ... that is, building self-contained binaries to distribute. For comparison: * Hello World win-x64 binary self-contained in .NET 7 is around 70 MB * The same for Go results in 1.2 MB Edit: Missed 'trimming' in .NET, which would result in a binary of size around 11 MB in win-x64

Usually that means you aren't using trimming, .NET speak for dead code removal during linking.

Also remember that standard .NET runtime does a little bit more than Go's runtime, so it might happen that even with trimming, for basic applications Go ends up having an upper hand on file size.

On the other hand, I have had Go static binaries grow up to 200 MB and being require to use UPX to make it manageable, e.g. trivy.

Re: Was Rust Worth It?

#422
post #421

Earlier quoted context omitted.

C# is a lovely language to work with. The only issue I have is with the .NET ... that is, building self-contained binaries to distribute. For comparison: * Hello World win-x64 binary self-contained in .NET 7 is around 70 MB * The same for Go results in 1.2 MB Edit: Missed 'trimming' in .NET, which would result in a binary of size around 11 MB in win-x64

Usually that means you aren't using trimming, .NET speak for dead code removal during linking. Also remember that standard .NET runtime does a little bit more than Go's runtime, so it might happen that even with trimming, for basic applications Go ends up having an upper hand on file size. On the other hand, I have had Go static binaries grow up to 200 MB and being require to use UPX to make it manageable, e.g. trivy…

You're right. But even with trimming I get around 10x the size of the Go binary

Re: Was Rust Worth It?

#423
post #410

I'm glad to see there's a wide range of opinions here. I'm not too concerned with performance or safety (since my code hasn't been seen very often). I use rust just because it has a lot of "libraries that help me develop". While other language libraries have a poor search experience and ranking system, Rust has a great library search system. I use it because I don't have to read blog posts like C/C++ or java to find…

This has mostly been my experience too. I like using Rust because it reduces the cognitive load I have to deal with for many things (performance/safety are nice, but not a priority).

As you've said, finding great libraries is easy, and so is adding/building them. I find this a nice change from e.g. Python (where there are so many way of different competing ways dealing with packaging/dependencies).

Also thanks to the error handling, sum types and the like, I don't have to worry so much that I've deal with all errors, handled all enum variants, etc., the compiler takes care of that.

Re: Was Rust Worth It?

#424
post #416

Earlier quoted context omitted.

Surprisingly, I am faster in Rust than any other language. Something about my prior experiences just made it click just the right way. I don't want to program in anything else anymore. I don't want to deal with obscure C++ error messages, C footguns and lack of ergonomics, I don't want to deal with abstraction hell of Java, or the poor person's typing that python has. I have been programming in Python for the past 6…

> Surprisingly, I am faster in Rust than any other language. Not really surprising, given that you have C and C++ background. That's what I was trying to highlight. Rust isn't a confusing or unproductive language as many project it to be - if you have the conceptual understanding of what happens on the hardware. Especially about stack frames and RAII. If you know those, the borrow checker complaints will immediately…

I'd add that if you have some understanding of how memory ownership should be such that you don't end up with memory leaks, you are fine. The borrow checker just verifies that your mental model is correct, and removes some of the cognitive load from you.

Re: Was Rust Worth It?

#425
post #338

Earlier quoted context omitted.

I rather use compiled managed languages like Swift, D and C# instead, they provide enough low level coding knobs for C and C++ style coding, while being high level productive. Would add Go to the list, but only when I really have to. Nim and Crystal could be alternatives, but don't seem to have big enough communities, at least for what I do. However I do agree with the conclusion, Rust is a great language for scenari…

C# is underrated by the HN crowd, I find. I quite like how mid sized firms (100-1000 employees) use it.

C# is fine, but it feels like a slightly better Java, just without the huge ecosystem of libraries.

Re: Was Rust Worth It?

#426
post #421

Earlier quoted context omitted.

Usually that means you aren't using trimming, .NET speak for dead code removal during linking. Also remember that standard .NET runtime does a little bit more than Go's runtime, so it might happen that even with trimming, for basic applications Go ends up having an upper hand on file size. On the other hand, I have had Go static binaries grow up to 200 MB and being require to use UPX to make it manageable, e.g. trivy…

You're right. But even with trimming I get around 10x the size of the Go binary

Since I edited my comment, see my additional remarks regarding runtime capabilities, and the counterpoint of big Go binaries.

Also note that triming only works properly if the libraries have taken the effort to be trimmable, as the linker errs on the safe side and won't trim unless certain that it is really dead code, and not called via reflection.

Re: Was Rust Worth It?

#427
post #231

I wrote a lot of rust, but after some years it still feels unproductive. I do a lot of zig now and I am like 10 times more productive with it. I can just concentrate on what I want to code and I never have to wonder what tool or what library to use. I know rust gives memory safety and how important that is, but the ergonomic is really bad. Every time I write some rust I feel limited. I always have to search libraries…

I use Rust a lot, and have been really keen on getting into Zig.

Not sure if much has changed (it was a while back), but my biggest problem was with finding and using 3rd party libraries (mostly for the boring stuff like DB connectivity, JSON/YAML parsing, logging, etc.).

E.g. even now if I search for "zig mysql library", the tops hits are all about people discussing it on reddit, than any actual library.

Re: Was Rust Worth It?

#428
post #425

Earlier quoted context omitted.

C# is underrated by the HN crowd, I find. I quite like how mid sized firms (100-1000 employees) use it.

C# is fine, but it feels like a slightly better Java, just without the huge ecosystem of libraries.

Slightly... The difference in type erasure is pretty huge IMHO.

But what libraries are you lacking?

Re: Was Rust Worth It?

#429
post #420
post #388

Earlier quoted context omitted.

Kind of, maybe you need to do some low level coding and don't want to wait for Valhala, or make use of JNI and native libraries, GraalVM/OpenJ9 still aren't as integrated as .NET Native or Native AOT, e.g. writing native shared libraries. Also Java lost the attention span of the gaming industry, besides Android casual games and Minecraft, there are hardly anyone else paying attention to it.

To be fair, C# is ok for game dev, but not great. C# libraries are lagging heavily behind Java. Want a fastest possible library? It's in C++, and not portable to Win/Mac. So good luck with wrap + porting it. Want a decent implementation of an algo? It usually exists for Java but not for C#. Hope you like writing it from scratch. Want a C# implementation of an algo that doesn't allocate to the Nth degree. Again, write…

It is widely better recieved in the AAA gaming developer community than Java, and that is what matters.

I also like Java, but c'mon no decent algorithms being implemented in C#? That is already approaching zealotry.

Re: Was Rust Worth It?

#430

Earlier quoted context omitted.

C# is underrated by the HN crowd, I find. I quite like how mid sized firms (100-1000 employees) use it.

Is it? Every time I see C# being mentioned here people agree how awesome it is. Not that I'm complaining, I love C#

Well, I see it as lack of fanboyism which is interesting and almost unique to the Java/C# ecosystem. A lot C# experts(and I mean REAL, low level experts) seem to also have very high Java expertise..

And those that have Java expertise but not C# seem to demur to those that do; image!

But it's still niche(around here and in the startup world) and gets lumped in with Java and together they are not "hip" or "agile" or whatever.

Post reply on HN