Asked on Reddit: Which of Rust, D, Go, Nim, and Crystal is the strongest and why?

Dave via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 10 14:22:40 PDT 2015


On Wednesday, 10 June 2015 at 21:09:23 UTC, jmh530 wrote:
> On Wednesday, 10 June 2015 at 18:13:53 UTC, Dave wrote:
>
>>
>> Just a thought from a random spectator ;)
>
> Interesting perspective. While I find the plethora of keywords 
> in D a tad confusing (nowhere near as confusing as rust's 
> borrowing!),

I won't try to defend Rust's syntax (and they certainly don't let
you opt out of a whole lot).

> I'm not sure it would necessarily mean that D would be 
> discarded in favor of something else. There's a lot to like 
> about D as a language.

If that something is more favorable why would they not? Only
answers to that is stubbornness and resistance to change ;)

> More generally, it's a question of what paradigm you are trying 
> to enforce. I think your paradigm is really about minimizing 
> bugs, rather than necessarily wanting restriction.

If someone wants to annotate @system and do all the dirty things
they want. So be it. At least others that use their code
(assuming transitiveness) knows that they are doing it.

> Nevertheless, I'm sure there are many who agree. My preference 
> is a bit simpler: I want to write good code without a lot of 
> clutter. So I think that the default option should be whatever 
> enforces that. I don't see a reason why you should have a whole 
> string of keywords before every function.

That would depend on the syntax of the language mostly. I'm sure
if designed well, you could avoid unnecessary "clutter". Maybe by
allow people to define their own attributes that can be used in
place of many attributes (as long as it is easy to look it up).

> To your grepable point, another alternative is that you allow 
> the annotations in either case so you could have a throw 
> keyword and a nothrow keyword.

Problem with "opt-in" constructs, is if people don't have to they
generally "opt-out". So expect the default to be the most common.
You might get library writers writing idiomatically, but I
wouldn't expect it from an application development side. Adding
an extra keyword per function is probably not that big of a deal
in the long run. Especially if it prevents code.

All of this is kind of late for D. Waaaay too many breaking 
changes. But maybe something for D3...;)


More information about the Digitalmars-d mailing list