Gave myself a quick D lesson just to understand the approach to flags here (Yes.keepTerminator rather than just a meaningless bool). Turns out D lets you define a template with any args you like, in this case taking a string for a name of a Flag type, which in turn contains an enum with 'yes' and 'no' boolean values. This means that you can only use the right type of Flag, with a matching name, and its yes/no value.…
Wc in D: 712 Characters Without a Single Branch
31–40 of 89 posts
Re: Wc in D: 712 Characters Without a Single Branch
#32I'm wavering between D and Rust for which one could be used as a better alternative to C++. (Though I don't see C++ getting replaced anytime soon.) Even if Rust is getting most of the attention, D also seems to be a strong candidate.
Re: Wc in D: 712 Characters Without a Single Branch
#33I find D easier to grok coming from a Java/Python background.
D is an amazing language. But what eventually put me off is the lack of documentation for installing and linking libraries in the compilers.
Just as you would for C and C++.
Other languages may need libraries to be installed, but not D.
Re: Wc in D: 712 Characters Without a Single Branch
#34I find D easier to grok coming from a Java/Python background.
My only issue is that it's far more complicated than Java and for a language that fills that same niche it's hard for me to justify putting my resources into learning it even though I do like a lot of the features.
Re: Wc in D: 712 Characters Without a Single Branch
#35Re: Wc in D: 712 Characters Without a Single Branch
#36Re: Wc in D: 712 Characters Without a Single Branch
#37Gave myself a quick D lesson just to understand the approach to flags here (Yes.keepTerminator rather than just a meaningless bool). Turns out D lets you define a template with any args you like, in this case taking a string for a name of a Flag type, which in turn contains an enum with 'yes' and 'no' boolean values. This means that you can only use the right type of Flag, with a matching name, and its yes/no value.…
D is getting named function arguments, which will make the "meaningless bool" a bit more meaningful.
Re: Wc in D: 712 Characters Without a Single Branch
#38I'm wavering between D and Rust for which one could be used as a better alternative to C++. (Though I don't see C++ getting replaced anytime soon.) Even if Rust is getting most of the attention, D also seems to be a strong candidate.
Re: Wc in D: 712 Characters Without a Single Branch
#39Earlier quoted context omitted.
D is getting named function arguments, which will make the "meaningless bool" a bit more meaningful.
How will that work with c compatibility?
But if you use D as a BetterC compiler, then the D compiler can check the O/B rules in the code.
Functions that are O/B checked are marked with the `@live` attribute, meaning that you'll be able to incrementally use O/B in the code. This is much like how you can use the `pure` attribute to incrementally write functionally pure code.
Re: Wc in D: 712 Characters Without a Single Branch
#40Every time I see a post with some D source, I think the language looks great; but for some reason I never try to learn it...