3 ms·
> Algebraic data types, which none of those languages have, are incredible for representing states in your program. They help reduce our eliminate the type of l
by still_grokking 4y ago
> Algebraic data types, which none of those languages have, are incredible for representing states in your program. They help reduce our eliminate the type of logic bugs that often show up in UIs and such.
> The lack of null and using Options instead is one such example.
> Rust has fantastic libraries like serde which make de/serialization fast without a need for reflection.
Well, sure. But I'm completely unimpressed.
I'm a Scala developer. I have those features available mostly since "forever".
(Modern serialization based on compile time macros is "only" about a decade old, so quite "new" in Scala).
> In short, the Rust ecosystem has a tendency to produce amazingly helpful abstractions.
They do what they can and the results are OK-isch. But Rust is lacking features. Especially when it comes to abstractions.
Rust would need at least HKTs (higher kinded types) and "context abstractions" ("implicits") to come even close to what's possible in Scala. But Rust type system is still rudimentary in comparison.
Also the meta-programming story is very weak in Rust. I was shocked as I learned that Rust's macros are only on the level of Scheme. That's a shame for a new language, imho.
The only really interesting part about Rust for me is its raw performance. I have to admit that I'm really envious in that regard. (Scala has powerful features but you pay usually a high price for them as the compiler still isn't able to compile that stuff away. The annoying part is that nobody really cares much. They're more concerned with compile times; even Scala compiles at least an order of magnitude faster than Rust).
But actually it's not bad at all that Rust is a small and simple language. It's easy to pick up. (At least if you already know things like HOFs, ADTs, type-classes, Option / Either & Future monads, working with immutable data, and all that).
The other languages with comparable performance are mind twisting and full of bobby traps in comparison. C has no features at all and is outright crazy. C++ has features but that stuff is even more crazy. But Rust is nice and clean! (At least regarding semantics. The syntax is a different story. Rust is one of the ugliest languages. Everything seems patchy and irregular. But OK, that's "only syntax". One gets used to it quite quickly; and they wanted to attract C/C++ programmers, so I can understand why such an ugly syntax was chosen).