Hacker News new | ask | show | jobs
by tempsolution 2102 days ago
> Expressive, pretty powerful, ML and Haskell inspired type system

This is not a reason to use rust. It's like saying "I like Ferraries, because they drive fast", failing to specify WHY you need to drive fast (you usually really don't, unless you are on a race track)

> Memory safe. In higher level code you have almost zero justification for `unsafe`, except you really need a C library.

Java, C#, etc.

> Immutable by default. Can feel almost functional, depending on code style.

Okay, however this isn't a big win in practice. Java has this too with @Immutable and mostly that's enough.

> Very coherent language design. The language has few warts, in part thanks to the young age.

Yes, Rust looks fine. Let's see how it evolves. Coherent language design is however again not a reason to use rust, because it fails to mention WHY you need it and WHY it solves a business problem better than Java, C# or C++.

> Great package manager and build system.

Yeah, pretty much all modern languages have that, so it's not worth to even mention. Rust builds are slow, so there is that.

> Great tooling in general (compiler errors, formatter, linter, docs generation, ... )

Really? Ever used Java or C# tooling?

> Library availability is great in certain domains, ok most.

Compared to what? C++? I don't even think there it's true. When comparing to Java or C# library availability and quality is a joke in Rust.

> Statically compiled (though I often wish there was an additional interpreter/repl). Mostly statically linked.

Yeah... What do you need that for? Again no mention of why that's even useful.

> Good performance without much effort.

Like in Java, C# and C++ you mean?

> Good concurrency/parallelism primitives, especially since async

Async is a paradigm that received a lot of criticism lately. It turns out to be cancerous. Fibers will likely replace it and Java is getting it soon. Otherwise yeah, concurrency is something any modern language should solve and maybe Rust has a head-start here. The whole purpose of Rust is focused around safe multi-threading. However other languages don't sleep. You don't switch your company to Rust just because it does one thing better for a couple of years. Other languages will catch up soon.

1 comments

You seem to be very convinced that Rusts main competitors are Java and C#. I don't think this is usually true. Rusts main competitors are C and C++. I agree that in most cases where Java and C# are possible options they should be prefered over Rust. There are however many situations where neither Java nor C# are options.
> There are however many situations where neither Java nor C# are options.

Not too many anymore, and the space for these situations shrinks over time, rather quickly.

20 years ago, almost everything was implemented in C or C++, for all platforms. The computers didn’t have extra RAM for the GC overhead.

Web sites were the first to migrate, probably because security. Desktop GUI apps followed.

On mobile, before iPhone was launched in 2007, people used a lot of C or C++ there. PalmOS only supported C, Symbian SDK was C++ based, most Windows Mobile apps were written in C or C++. For the same reason, not enough resources for a GC. We now have gigabytes of memory in these devices and it’s no longer the case, on Android it’s almost 100% Java or Kotlin, on iOS it’s Swift.

This is happening with videogames, see Unity3D. Even low level soft-realtime multimedia is good enough for .NET now, here’s an example where my C# implementation delivers same performance as C implementation of VLC player: https://github.com/Const-me/Vrmac/tree/master/VrmacVideo

Pretty sure in a couple of years once MS improves a few relevant things in their .NET core (they need better constant propagation, and NEON support) we’ll see high-performance numeric stuff following the trajectory. The hardware SIMD support in .NET core 3.1 is a good step in the right direction.