Three articles on D

data pulverizer data.pulverizer at gmail.com
Mon Jun 8 00:25:38 UTC 2020


On Sunday, 7 June 2020 at 23:34:56 UTC, Paul Backus wrote:
> On Sunday, 7 June 2020 at 22:42:34 UTC, data pulverizer wrote:
>> 2. Template basics decomposition and value types: Once you've 
>> written your first basic template in D, at some point soon 
>> afterwards you start struggling for how to decompose template 
>> types and articulate the template pattern you want in order to 
>> facilitate template auto-inference by the compiler. That's 
>> what this article helps with: 
>> https://github.com/dataPulverizer/DTemplatesDecompositionAndValueTypes/blob/master/README.md

Thank you for your response.

> Also, the vocabulary used is different from the official 
> vocabulary in the language spec. For example, what the tutorial 
> calls "decomposition" is officially called "template argument 
> deduction" ...

I've made the change to the article.

>
> The examples here seem a bit contrived and unrealistic. It 
> might be difficult for readers to understand how and why they 
> would apply these techniques to their own code.
>

It would probably be helpful for you to pick an example and 
describe what you mean. From my point of view I'm targeting 
people writing numerical code and Julia. Someone like that will 
look at the article and think "hmm okay interesting ...".

The introductory example is a dot product ... those people will 
know what that is and the code itself is simple enough to 
extrapolate and get people curious.

The second example getting static array size is from code that 
actually I use. The code is small in size and simple to follow.

The third example of value type is analogous to Julia's value 
types 
(https://docs.julialang.org/en/v1/manual/types/#%22Value-types%22-1) and targets people that have some familiarity with Julia - makes them feel comfortable knowing that some of the same Julia constructs are available in D.



More information about the Digitalmars-d mailing list