Which language constructs could be done as a library if we accept some breaking changes?

jmh530 john.michael.hall at gmail.com
Mon Nov 29 16:14:29 UTC 2021


On Monday, 29 November 2021 at 16:05:46 UTC, Ola Fosheim Grøstad 
wrote:
> [snip]
>
>> 3. Replace `interface` types and ad hoc 
>> Design-by-Introspection patterns like `isInputRange`, 
>> `hasMember!(S1, "member")` with TypeScript's object types: 
>> https://www.typescriptlang.org/docs/handbook/2/objects.html 
>> which offer a very powerful, yet elegant and concise way of 
>> describing object shapes.
>
> Concepts/traits in C++ and Rust are making the lack of this 
> feature more apparent, I guess.
> [snip]

Typescript's object types look to me like Go's interfaces (which 
are like Rust's traits), but with a bit more flexibility. They 
look more runtime-oriented than C++'s concepts.


More information about the Digitalmars-d mailing list