memcpy() comparison: C, Rust, and D

Jon Degenhardt via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 1 18:42:06 PST 2017


On Wednesday, 1 February 2017 at 23:49:29 UTC, H. S. Teoh wrote:
> On Wed, Feb 01, 2017 at 11:49:25PM +0000, Mike via 
> Digitalmars-d wrote:
>> On Wednesday, 1 February 2017 at 21:47:58 UTC, Adam D. Ruppe 
>> wrote:
>> > (actually in the real world, it won't since nobody will care 
>> > enough
>> > to write `pure public return const(T) hi(return scope T t) 
>> > nothrow
>> > @nogc @safe @noincompetence @a_million_other_things { return 
>> > t; }`)
>> 
>> I found all the attribution of function definitions a little 
>> unnerving when I started learning D, but at least one other 
>> believed it was idiomatic D.
>
> I think the goal, if it's possible to attain to eventually, is 
> to have the compiler infer most of the attributes, ideally all.
>  This is already done for a good number of attributes for 
> template functions and auto functions.  I agree with you that 
> attribute soup is a Bad Thing for a language.
>
A different spin on the same topic - I've been wondering what the 
anticipated changes to both the standard library and application 
code are going to be as a result of dip25 and dip1000. Is the 
expectation that use of the new annotations will be limited to 
select portions of code bases, or that they will become the 
predominant way to write D code?

Another spin - If a company has a team people building a 
code-base and decides to establish best practices, how might the 
facilities introduced by dip25 and dip1000 fit into those best 
practices?

Clearly, there will be a menu of options available to teams, 
applications, etc. But, I would expect there to be a small number 
of preferred, commonly adopted approaches. And, it would be 
preferable, though not necessary, that best practices and idioms 
used in the standard library were a good starting point for new 
adoptees and development efforts. Hence my question about both 
Phobos and application code.

Perhaps it's too early to answer these questions, but if there 
are expected outcomes it would be useful to understand them.

--Jon


More information about the Digitalmars-d mailing list