digitalmars.D - Tuples, C#, Java, language design
- bearophile (7/7) Dec 28 2009 C# will probably not follow the route of stagnation of Java for some mor...
- justme (2/9) Dec 29 2009 Doesn't D2 already have tuples in Phobos. D has the comma operator which...
- grauzone (3/14) Dec 29 2009 But tuples in D really suck. Compared to other languages, D tuples feel
- justme (2/17) Dec 29 2009 The burden of proving your claims is still there. Isn't D meritocracy - ...
- BCS (9/27) Dec 29 2009 A though on the comma operator: if the comma operator were defined to gi...
- grauzone (4/38) Dec 29 2009 Why not make the programmer write tuple[$-1] instead?
- BCS (6/46) Dec 29 2009 Frankly, while I have no problem with it, I'd also be fine with dumping ...
- Joel C. Salomon (6/18) Dec 30 2009 Can the comma operator be given a different symbol to use? How about,
- retard (2/21) Dec 31 2009 Wouldn't that break the C compatibility?
- bearophile (4/8) Dec 29 2009 D2 has enough warts now, so it's much better to not add some more. Langu...
- grauzone (6/15) Dec 30 2009 I think in this case, it's more about cleaning up and polishing, than
- justme (3/18) Dec 30 2009 So D3 won't ever appear? At least in many open source projects the final...
- Denis Koroskin (6/38) Dec 30 2009 According to development stages you provided, D2 is currently in
- Don (16/60) Dec 30 2009 Yes, that's about right. Let's get an estimate about stablisation:
- bearophile (6/9) Dec 30 2009 There are two other important thing that can be done in that stabilizing...
- grauzone (11/40) Dec 31 2009 On the other hand, one could introduce "fixed tuples" as a new feature,
- Johan Granberg (6/39) Dec 30 2009 I have had the same idea and thinking about it I have not found any prob...
thanks to Mono too. I don't like that string interpolation syntax because it looks unsafe, and that design of tuples can be improved, but they are listening to programmes (even if they risk creating a mudball language): http://www.infoq.com/news/2009/12/Mono-CSharp-Ex More on those tuples: http://tirania.org/blog/archive/2009/Dec-23.html Eventually it will be quite useful to have some very well designed multi-return support in D (like those tuples, but better). Bye, bearophile
Dec 28 2009
bearophile Wrote:time, thanks to Mono too. I don't like that string interpolation syntax because it looks unsafe, and that design of tuples can be improved, but they are listening to programmes (even if they risk creating a mudball language): http://www.infoq.com/news/2009/12/Mono-CSharp-Ex More on those tuples: http://tirania.org/blog/archive/2009/Dec-23.html Eventually it will be quite useful to have some very well designed multi-return support in D (like those tuples, but better).doesn't so such syntax is not possible in D, me thinks.
Dec 29 2009
justme wrote:bearophile Wrote:But tuples in D really suck. Compared to other languages, D tuples feel inflexible, stiff, and complicated.time, thanks to Mono too. I don't like that string interpolation syntax because it looks unsafe, and that design of tuples can be improved, but they are listening to programmes (even if they risk creating a mudball language): http://www.infoq.com/news/2009/12/Mono-CSharp-Ex More on those tuples: http://tirania.org/blog/archive/2009/Dec-23.html Eventually it will be quite useful to have some very well designed multi-return support in D (like those tuples, but better).doesn't so such syntax is not possible in D, me thinks.
Dec 29 2009
grauzone Wrote:justme wrote:The burden of proving your claims is still there. Isn't D meritocracy - nobody listens your opinions unless you post compiler / stdlib patches. I believe the Phobos tuple classes are sufficient until a better system arrives in D3 or D4. D2 book is almost finished so you need to write your patches against D3 now.bearophile Wrote:But tuples in D really suck. Compared to other languages, D tuples feel inflexible, stiff, and complicated.time, thanks to Mono too. I don't like that string interpolation syntax because it looks unsafe, and that design of tuples can be improved, but they are listening to programmes (even if they risk creating a mudball language): http://www.infoq.com/news/2009/12/Mono-CSharp-Ex More on those tuples: http://tirania.org/blog/archive/2009/Dec-23.html Eventually it will be quite useful to have some very well designed multi-return support in D (like those tuples, but better).doesn't so such syntax is not possible in D, me thinks.
Dec 29 2009
justme wrote:grauzone Wrote:My experience with patches is, that they're mostly either ignored or rejected. I guess the chance of an unrequested patch changing a core language feature in crucial ways is 200%. Walter doesn't listen to anyone anyway *g*. The downsides of D tuples has been often mentioned, e.g. here: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=98953 (Sorry, I'm not as eloquent as language_fan to write it up myself, plus nobody would read it.)justme wrote:The burden of proving your claims is still there. Isn't D meritocracy - nobody listens your opinions unless you post compiler / stdlib patches. I believe the Phobos tuple classes are sufficient until a better system arrives in D3 or D4. D2 book is almost finished so you need to write your patches against D3 now.bearophile Wrote:But tuples in D really suck. Compared to other languages, D tuples feel inflexible, stiff, and complicated.time, thanks to Mono too. I don't like that string interpolation syntax because it looks unsafe, and that design of tuples can be improved, but they are listening to programmes (even if they risk creating a mudball language): http://www.infoq.com/news/2009/12/Mono-CSharp-Ex More on those tuples: http://tirania.org/blog/archive/2009/Dec-23.html Eventually it will be quite useful to have some very well designed multi-return support in D (like those tuples, but better).doesn't so such syntax is not possible in D, me thinks.
Dec 29 2009
grauzone wrote:justme wrote:That was incomplete. You have to compare the code examples with the D version: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=98947grauzone Wrote:My experience with patches is, that they're mostly either ignored or rejected. I guess the chance of an unrequested patch changing a core language feature in crucial ways is 200%. Walter doesn't listen to anyone anyway *g*. The downsides of D tuples has been often mentioned, e.g. here: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmar .D&article_id=98953justme wrote:The burden of proving your claims is still there. Isn't D meritocracy - nobody listens your opinions unless you post compiler / stdlib patches. I believe the Phobos tuple classes are sufficient until a better system arrives in D3 or D4. D2 book is almost finished so you need to write your patches against D3 now.bearophile Wrote:But tuples in D really suck. Compared to other languages, D tuples feel inflexible, stiff, and complicated.some more time, thanks to Mono too. I don't like that string interpolation syntax because it looks unsafe, and that design of tuples can be improved, but they are listening to programmes (even if they risk creating a mudball language): http://www.infoq.com/news/2009/12/Mono-CSharp-Ex More on those tuples: http://tirania.org/blog/archive/2009/Dec-23.html Eventually it will be quite useful to have some very well designed multi-return support in D (like those tuples, but better).Doesn't D2 already have tuples in Phobos. D has the comma operator(Sorry, I'm not as eloquent as language_fan to write it up myself, plus nobody would read it.)
Dec 29 2009
Hello justme,bearophile Wrote:A though on the comma operator: if the comma operator were defined to give a tuple type and be implicitly castable to any suffix of it's self, then you could get both the comma expression usage that Walter wants as well as all the fun things that tuple expressions give. int i = 1, j = 2; (i, j) = (j, i); // swap i = (j+= i, i*2 + j); // first expression gets evaluated and dropped. Thoughts?more time, thanks to Mono too. I don't like that string interpolation syntax because it looks unsafe, and that design of tuples can be improved, but they are listening to programmes (even if they risk creating a mudball language): http://www.infoq.com/news/2009/12/Mono-CSharp-Ex More on those tuples: http://tirania.org/blog/archive/2009/Dec-23.html Eventually it will be quite useful to have some very well designed multi-return support in D (like those tuples, but better).Doesn't D2 already have tuples in Phobos. D has the comma operator
Dec 29 2009
BCS wrote:Hello justme,Why not make the programmer write tuple[$-1] instead? i = (j += i, i*2 + j)[$-1]; There's no reason to keep the current comma operator.bearophile Wrote:A though on the comma operator: if the comma operator were defined to give a tuple type and be implicitly castable to any suffix of it's self, then you could get both the comma expression usage that Walter wants as well as all the fun things that tuple expressions give. int i = 1, j = 2; (i, j) = (j, i); // swap i = (j+= i, i*2 + j); // first expression gets evaluated and dropped. Thoughts?more time, thanks to Mono too. I don't like that string interpolation syntax because it looks unsafe, and that design of tuples can be improved, but they are listening to programmes (even if they risk creating a mudball language): http://www.infoq.com/news/2009/12/Mono-CSharp-Ex More on those tuples: http://tirania.org/blog/archive/2009/Dec-23.html Eventually it will be quite useful to have some very well designed multi-return support in D (like those tuples, but better).Doesn't D2 already have tuples in Phobos. D has the comma operator
Dec 29 2009
Hello grauzone,BCS wrote:Frankly, while I have no problem with it, I'd also be fine with dumping the comma operator all together, even making the [$-1] thing illegal ("code has no effect" and all that) but Walter has time and again shot down anything that does away with the comma operator so I was looking at it as a way to have my cake and eat it to.Hello justme,Why not make the programmer write tuple[$-1] instead? i = (j += i, i*2 + j)[$-1]; There's no reason to keep the current comma operator.bearophile Wrote:A though on the comma operator: if the comma operator were defined to give a tuple type and be implicitly castable to any suffix of it's self, then you could get both the comma expression usage that Walter wants as well as all the fun things that tuple expressions give. int i = 1, j = 2; (i, j) = (j, i); // swap i = (j+= i, i*2 + j); // first expression gets evaluated and dropped. Thoughts?some more time, thanks to Mono too. I don't like that string interpolation syntax because it looks unsafe, and that design of tuples can be improved, but they are listening to programmes (even if they risk creating a mudball language): http://www.infoq.com/news/2009/12/Mono-CSharp-Ex More on those tuples: http://tirania.org/blog/archive/2009/Dec-23.html Eventually it will be quite useful to have some very well designed multi-return support in D (like those tuples, but better).Doesn't D2 already have tuples in Phobos. D has the comma operator
Dec 29 2009
On 12/30/2009 12:38 AM, BCS wrote:Hello grauzone,Can the comma operator be given a different symbol to use? How about, e.g., a double comma: auto i = 1, 2; // tuple auto j = 1,,2; // sequence operator —JoelWhy not make the programmer write tuple[$-1] instead? i = (j += i, i*2 + j)[$-1]; There's no reason to keep the current comma operator.Frankly, while I have no problem with it, I'd also be fine with dumping the comma operator all together, even making the [$-1] thing illegal ("code has no effect" and all that) but Walter has time and again shot down anything that does away with the comma operator so I was looking at it as a way to have my cake and eat it to.
Dec 30 2009
Wed, 30 Dec 2009 21:30:14 -0500, Joel C. Salomon wrote:On 12/30/2009 12:38 AM, BCS wrote:Wouldn't that break the C compatibility?Hello grauzone,Can the comma operator be given a different symbol to use? How about, e.g., a double comma: auto i = 1, 2; // tuple auto j = 1,,2; // sequence operatorWhy not make the programmer write tuple[$-1] instead? i = (j += i, i*2 + j)[$-1]; There's no reason to keep the current comma operator.Frankly, while I have no problem with it, I'd also be fine with dumping the comma operator all together, even making the [$-1] thing illegal ("code has no effect" and all that) but Walter has time and again shot down anything that does away with the comma operator so I was looking at it as a way to have my cake and eat it to.
Dec 31 2009
BCS:A though on the comma operator: if the comma operator were defined to give a tuple type and be implicitly castable to any suffix of it's self, then you could get both the comma expression usage that Walter wants as well as all the fun things that tuple expressions give.D2 has enough warts now, so it's much better to not add some more. Languages must be tidy, when possible. It's often better to not have a feature that having a dirty one. Bye, bearophile
Dec 29 2009
bearophile wrote:BCS:I think in this case, it's more about cleaning up and polishing, than adding "warts". The big danger is, that this may require incompatible language changes, which won't be possible anymore after D2. D3? Anyone who talks about D3 must be kidding.A though on the comma operator: if the comma operator were defined to give a tuple type and be implicitly castable to any suffix of it's self, then you could get both the comma expression usage that Walter wants as well as all the fun things that tuple expressions give.D2 has enough warts now, so it's much better to not add some more. Languages must be tidy, when possible. It's often better to not have a feature that having a dirty one.Bye, bearophile
Dec 30 2009
grauzone Wrote:bearophile wrote:So D3 won't ever appear? At least in many open source projects the final released is tagged one to two weeks before the final release. Distributions have then time to repackage the release. Meanwhile, the core developers are already enthusiastically implementing wild new features after a long feature freeze. It's similar kind of tick-tock as Intel has with their CPU line (1 smaller process -> 2 improved core -> goto 1). In successful software projects they have alpha/beta period, feature freeze, stabilization period, release, new alpha/beta period etc. Concurrently new bugfix releases come out just like with D. I haven't heard of new features lately so D2 must be stabilizing now.BCS:I think in this case, it's more about cleaning up and polishing, than adding "warts". The big danger is, that this may require incompatible language changes, which won't be possible anymore after D2. D3? Anyone who talks about D3 must be kidding.A though on the comma operator: if the comma operator were defined to give a tuple type and be implicitly castable to any suffix of it's self, then you could get both the comma expression usage that Walter wants as well as all the fun things that tuple expressions give.D2 has enough warts now, so it's much better to not add some more. Languages must be tidy, when possible. It's often better to not have a feature that having a dirty one.
Dec 30 2009
On Wed, 30 Dec 2009 15:41:58 +0300, justme <justme somewhere.net> wrote:grauzone Wrote:According to development stages you provided, D2 is currently in alpha/beta period. Feature freeze will follow once TDPL is released (around March, 2010). Stabilization and release is even further, and D3 is sooo far away it's hardly imagineable we will see any signs of it in a foreseeable future :)bearophile wrote:So D3 won't ever appear? At least in many open source projects the final released is tagged one to two weeks before the final release. Distributions have then time to repackage the release. Meanwhile, the core developers are already enthusiastically implementing wild new features after a long feature freeze. It's similar kind of tick-tock as Intel has with their CPU line (1 smaller process -> 2 improved core -> goto 1). In successful software projects they have alpha/beta period, feature freeze, stabilization period, release, new alpha/beta period etc. Concurrently new bugfix releases come out just like with D. I haven't heard of new features lately so D2 must be stabilizing now.BCS:to giveA though on the comma operator: if the comma operator were definedthena tuple type and be implicitly castable to any suffix of it's self,well asyou could get both the comma expression usage that Walter wants asLanguages must be tidy, when possible. It's often better to not have a feature that having a dirty one. I think in this case, it's more about cleaning up and polishing, than adding "warts". The big danger is, that this may require incompatible language changes, which won't be possible anymore after D2. D3? Anyone who talks about D3 must be kidding.all the fun things that tuple expressions give.D2 has enough warts now, so it's much better to not add some more.
Dec 30 2009
Denis Koroskin wrote:On Wed, 30 Dec 2009 15:41:58 +0300, justme <justme somewhere.net> wrote:Yes, that's about right. Let's get an estimate about stablisation: There are 1400 open bugs (DMD+Phobos), which are currently being fixed at the rate of 50/month. Historically, new bugs have been found at the rate of 66/month. Since D2 began, 50% of the open bugs have been D2-only. So, 50% of the bugs have been related to new features. Which would suggest that even if the bug rate halves when after the feature freeze, it'll be about 5 years until the bug count drops to zero... :-( Actually, I don't think it's that bad, since some of the most important structural compiler bugs have been fixed, which should greatly reduce the rate that new bugs are found. Even so, I'd recommend at least two years of bug-fixes and library development (and toolchain issues), before we even think about more features.grauzone Wrote:According to development stages you provided, D2 is currently in alpha/beta period. Feature freeze will follow once TDPL is released (around March, 2010). Stabilization and release is even further, and D3 is sooo far away it's hardly imagineable we will see any signs of it in a foreseeable future :)bearophile wrote:So D3 won't ever appear? At least in many open source projects the final released is tagged one to two weeks before the final release. Distributions have then time to repackage the release. Meanwhile, the core developers are already enthusiastically implementing wild new features after a long feature freeze. It's similar kind of tick-tock as Intel has with their CPU line (1 smaller process -> 2 improved core -> goto 1). In successful software projects they have alpha/beta period, feature freeze, stabilization period, release, new alpha/beta period etc. Concurrently new bugfix releases come out just like with D. I haven't heard of new features lately so D2 must be stabilizing now.BCS:to giveA though on the comma operator: if the comma operator were definedself, thena tuple type and be implicitly castable to any suffix of it'swell asyou could get both the comma expression usage that Walter wants asLanguages must be tidy, when possible. It's often better to not have a feature that having a dirty one. I think in this case, it's more about cleaning up and polishing, than adding "warts". The big danger is, that this may require incompatible language changes, which won't be possible anymore after D2. D3? Anyone who talks about D3 must be kidding.all the fun things that tuple expressions give.D2 has enough warts now, so it's much better to not add some more.
Dec 30 2009
Don:I'd recommend at least two years of bug-fixes and library development (and toolchain issues), before we even think about more features.There are two other important thing that can be done in that stabilizing period: 1) find where are the D2 design mistakes and invent better ways to design the same features. 2) Invent new ways to use D2 language (this has happened too all major languages, for example the introduction of the many lazy features of Python3 doesn't come after design of Python2, it comes from the slow invention of new ways to use Python, partially invented by R. Hettinger. Later some of such ideas are being moved from the std library (itertools) to the language itself (the built-in map and filter become lazy, etc)). Bye, bearophile
Dec 30 2009
justme wrote:grauzone Wrote:On the other hand, one could introduce "fixed tuples" as a new feature, that doesn't touch the old tuples. It would be annoying, but allows for perfect backwards compatibility.bearophile wrote:BCS:I think in this case, it's more about cleaning up and polishing, than adding "warts". The big danger is, that this may require incompatible language changes, which won't be possible anymore after D2. D3? Anyone who talks about D3 must be kidding.A though on the comma operator: if the comma operator were defined to give a tuple type and be implicitly castable to any suffix of it's self, then you could get both the comma expression usage that Walter wants as well as all the fun things that tuple expressions give.D2 has enough warts now, so it's much better to not add some more. Languages must be tidy, when possible. It's often better to not have a feature that having a dirty one.So D3 won't ever appear? At least in many open source projects the final released is tagged one to two weeks before the final release. Distributions have then time to repackage the release. Meanwhile, the core developers are already enthusiastically implementing wild new features after a long feature freeze.D3 would just mean "incompatible to D2". The "final" version of D1 (dmd 1.000) was released on Jan 2, 2007, and the first version of D2 (dmd 2.000) on Jun 17, 2007. Can't let that happen again. But adding features after finalization in a backward compatible way would be nice. Other languages can do it too, why not D?It's similar kind of tick-tock as Intel has with their CPU line (1 smaller process -> 2 improved core -> goto 1). In successful software projects they have alpha/beta period, feature freeze, stabilization period, release, new alpha/beta period etc. Concurrently new bugfix releases come out just like with D. I haven't heard of new features lately so D2 must be stabilizing now.That isn't the case. Have a look at the "New/Changed Features" section in the changelog: http://www.digitalmars.com/d/2.0/changelog.html
Dec 31 2009
BCS wrote:Hello justme,I have had the same idea and thinking about it I have not found any problems with it. So I would get hapy if it was implementet. When tupples where first introduced in D the ovious problems with them was the auto flattening and lack of literal syntax, fixing that would probably make using tuoples much nicer. (Allowing things like multiple return value as used in matlab)bearophile Wrote:A though on the comma operator: if the comma operator were defined to give a tuple type and be implicitly castable to any suffix of it's self, then you could get both the comma expression usage that Walter wants as well as all the fun things that tuple expressions give. int i = 1, j = 2; (i, j) = (j, i); // swap i = (j+= i, i*2 + j); // first expression gets evaluated and dropped. Thoughts?more time, thanks to Mono too. I don't like that string interpolation syntax because it looks unsafe, and that design of tuples can be improved, but they are listening to programmes (even if they risk creating a mudball language): http://www.infoq.com/news/2009/12/Mono-CSharp-Ex More on those tuples: http://tirania.org/blog/archive/2009/Dec-23.html Eventually it will be quite useful to have some very well designed multi-return support in D (like those tuples, but better).Doesn't D2 already have tuples in Phobos. D has the comma operator
Dec 30 2009