dlang / project-ideas

Collection of impactful projects in the D ecosystem
36 stars 12 forks source link

First class tuples #63

Open 12345swordy opened 4 years ago

12345swordy commented 4 years ago

write a dip that makes tuples built into the language itself to avoid writing tuple!(....) and other unneeded verbiage.

UplinkCoder commented 4 years ago

Do you mean tuple(), from std typecons? or do you mean AliasSeq from std.meta?

In terms of aliasSeq that's something we actually need and I am working on it.

12345swordy commented 4 years ago

tuple() from std typecons

UplinkCoder commented 4 years ago

we are a strongly typed language, why don't you create a struct instead?

12345swordy commented 4 years ago

we are a strongly typed language, why don't you create a struct instead?

That is a complete non sequitur. C# is a strongly typed language, yet it has first class tuples built in.

andre2007 commented 4 years ago

There is a tuple dip started some years ago https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md

Geod24 commented 4 years ago

we are a strongly typed language, why don't you create a struct instead?

There's a difference between duck typing and structural typing. That being said, there's a strong preference (or there was, from Andrei) to have things that can be built as library, be in a library, so this DIP is likely to be an uphill battle.

@12345swordy : Are you volunteering ?

12345swordy commented 4 years ago

@Geod24 Yes I am willing to volunteer on this, if people are willing to assist me on this as I have time restraint on this.

andre2007 commented 3 years ago

I wonder whether it makes sense to have it as a gsoc project: complete the DIP (https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md) and drive through the dip process? Of course that means here is no coding at all to be written by the student...