Asked on Reddit: Which of Rust, D, Go, Nim, and Crystal is the strongest and why?
jmh530 via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jun 10 10:34:53 PDT 2015
I'm not really familiar with Go, Nim, or Crystal, but I spent
some time learning about Rust yesterday. I thought it was pretty
interesting. In particular,
1) The GC is optional (memory safety is enforced by the type
system and #2).
2) Smart pointers with separate operators and support for
reference counting.
3) Immutability by default. Someone (somewhere) made an
interesting point that it can be conceptually convenient to have
the most restrictive choice as the default. I'm not sure I agree
with that (maybe the most common choice used in good code), but
at least immutability by default it can be helpful for concurrent
programming.
All of the above seems to have a downside too
1) The memory safety stuff is pretty confusing. Move and copy
both use the equality operator, but you're not always able to use
it depending on the type. I think a separate move operator would
clear up some of the confusion. I also didn't really get a good
handle on how borrowing and lifetimes worked, but it seemed in
need of a simpler explanation.
2) The plethora of options for smart pointers and reference
counting
2) No prefix operators like ++a. Perhaps a consequence of
immutability.
More information about the Digitalmars-d
mailing list