4 ms·
> I for my part would say that Rust is overly complex for most things where C# or Java, and especially any Scripting language, would be a good fit. Algebraic d
by pitaj 4y ago
> I for my part would say that Rust is overly complex for most things where C# or Java, and especially any Scripting language, would be a good fit.
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.
In short, the Rust ecosystem has a tendency to produce amazingly helpful abstractions.
> But you know that D has a GC by default? You can't be "more memory safe" than that.
First of all, D with GC is not a replacement for C. Anything with a GC is not going to fulfill a systems language role.
Secondly, you can be more memory safe than a GC. Most GCs do not protect against data races, but Rust does. I'm unsure exactly where D falls there.
- 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).