On Sunday, 5 November 2017 at 03:02:52 UTC, rikki cattermole wrote:
On 04/11/2017 6:13 PM, bauss wrote:
On Saturday, 4 November 2017 at 13:27:29 UTC, rikki cattermole wrote:
[...]

It reminds a lot of traits in Rust.

https://doc.rust-lang.org/1.8.0/book/traits.html

Rust traits are a variant of ML's signature. Only they decided to add a whole new concept which is 'impl' to it.

While it is a nice idea, it would be a pain to use in real life and defeat the purpose of a signature. Which is to act as more of a 'concept' abstraction to other items.

Because we have such powerful meta-programming features I see no reason to separate out the two. We can do it all in one which makes it nice and consistent between all the different implementations for a signature type. So far its starting to feel right at home against our structs and class support, I think.

I like Rust's traits more than our way of ad-hoc specification of compile-time interfaces with is(typeof({...})) or __traits(compiles, ...). Given how most idiomatic D code is written, to me that's the biggest deficiency of the language. Reasonable people may, of course, disagree.

Atila

Reply via email to