digitalmars.D - Broken?
- Steve Teale (16/16) Mar 11 2014 What D needs at this point is a dictator. There are about 30
- John Colvin (8/24) Mar 11 2014 The buck does stop with Walter and Andrei. What you're seeing is
- Steve Teale (10/18) Mar 11 2014 I'm probably thinking more of some organization where if a
- Russel Winder (14/17) Mar 12 2014 Python used to be Guido's language, but he and the community evolved out
- Steven Schveighoffer (25/37) Mar 11 2014 But it already is this way. What we have now are the gatekeepers of Walt...
- Steve Teale (5/6) Mar 11 2014 Functions final by default? I read the list of changes for 2.065,
- Dicebot (5/11) Mar 11 2014 Not in 2.065
- Steve Teale (6/19) Mar 11 2014 Well if we're going there, we should go the whole hog and have
- Indica (14/34) Mar 11 2014 It sounds like what you are wanting is explicit project
- Indica (3/3) Mar 11 2014 I'd like to point out that Walter and Andrei can't do it all
- Steve Teale (5/8) Mar 11 2014 This is one of the motivations for my remark. They both have
- Andrei Alexandrescu (22/29) Mar 12 2014 I could use more tan, can't wait for the summer :o).
- bearophile (11/16) Mar 12 2014 If you don't change your bed once in a while, it will start to
- Nick Sabalausky (7/13) Mar 12 2014 Very true (see C++ and why D was needed ;) ), but of course the
- deadalnix (6/13) Mar 12 2014 Be careful. Sunglasses and sun cream indice 120 or you'll burn to
- H. S. Teoh (11/22) Mar 12 2014 Yes, I also applaud this attitude. Taking decisive action not only saves
- Joseph Cassman (4/40) Mar 12 2014 Appreciate the change. The increased clarity is helpful. Thanks.
- Jonathan M Davis (7/11) Mar 13 2014 Another major area which we've discussed changing (and agreed on - we ju...
- Steve Teale (12/27) Mar 13 2014 Walter is a complex and proud man, like most of us. I love him
- Dicebot (7/12) Mar 11 2014 There is no point in project management with no team to manage.
- Nick Sabalausky (5/10) Mar 11 2014 There has been much debate in the programming community over what
- Steve Teale (13/26) Mar 11 2014 What I meant by final is simply the third leg of a tuffet. As I
- deadalnix (2/15) Mar 11 2014 What ???
- bearophile (5/9) Mar 11 2014 What's the point of having "virtual" if the default doesn't
- Dicebot (10/19) Mar 11 2014 frequently mentioned example:
- "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= (5/8) Mar 11 2014 Doesn't this make room for undetected bugs?
- Dicebot (6/17) Mar 11 2014 Mostly depends on the way you format the code. It is perfectly
- Manu (22/44) Mar 11 2014 I'm really trying to keep my lid on here...
- monarch_dodra (10/46) Mar 12 2014 Case in point:
- Manu (3/41) Mar 12 2014 Thank you.
- Paulo Pinto (5/70) Mar 12 2014 It can also happen the other way if I mark a method virtual that
- Kapps (12/18) Mar 13 2014 Not really. The way C# handles it (and I assume the way D would
- Andrei Alexandrescu (3/5) Mar 12 2014 I think the example given works against your argument.
- monarch_dodra (3/8) Mar 12 2014 How so? The example was his argument verbatim.
- Andrei Alexandrescu (5/14) Mar 12 2014 His argument assumed at core that the library designer knows better than...
- Sean Kelly (18/33) Mar 12 2014 And this argument is absolutely correct, in my experience. By
- Sean Kelly (18/18) Mar 12 2014 And for the record, I'm absolutely pedantic about adding "final"
- Jacob Carlborg (6/11) Mar 12 2014 There's a book, Effective Java, that recommends all methods should be
- Dmitry Olshansky (4/26) Mar 12 2014 Seconded.
- Kapps (17/33) Mar 13 2014 There were countless arguments to demonstrate that this *is* the
- w0rp (16/16) Mar 13 2014 I used to believe that virtual was a better default, but these
- Manu (5/10) Mar 12 2014 How so?
- Michel Fortin (19/23) Mar 12 2014 I'll add another argument to the mix.
- Steven Schveighoffer (10/24) Mar 12 2014 Private virtual functions make 0 sense. A private function cannot be
- Michel Fortin (10/28) Mar 12 2014 You're mixing C++ private with D private. Private just means the symbol
- Steven Schveighoffer (8/29) Mar 12 2014 OK, I can see that being useful. You are right, I was thinking C++ priva...
- monarch_dodra (18/21) Mar 12 2014 Even in C++, private virtual a key part of the "non-virtual
- Steven Schveighoffer (20/36) Mar 12 2014 Nonsense. If I'm writing a function, I can call it. There is no way to
- Andrej Mitrovic (5/6) Mar 12 2014 Protected still allows subclasses to *call* the methods. The idea is
- Szymon Gatner (5/23) Mar 12 2014 The point is that you can't call parent's virtual (often
- monarch_dodra (22/30) Mar 12 2014 Yes, you are right. You can always call the function directly if
- Timon Gehr (11/18) Mar 12 2014 In a different module, attempting an override should behave as if the
- Steve Teale (4/8) Mar 12 2014 That's when you need 'direct' ;=)
- Andrej Mitrovic (11/15) Mar 12 2014 It can if it's in the same module. You may want to have the benefit of
- Szymon Gatner (6/37) Mar 12 2014 Private virtual functions actually make a LOT of sense in C++.
- Andrej Mitrovic (3/5) Mar 12 2014 The last word from Walter was that he agreed tying access specifiers
- deadalnix (6/19) Mar 12 2014 No.
- Andrei Alexandrescu (18/41) Mar 12 2014 There's an asymmetry introduced by the fact there's today code in use.
- Manu (61/99) Mar 12 2014 *sigh*
- Brad Anderson (6/19) Mar 11 2014 Have a link to where that was decided? I was under the impression
- Steven Schveighoffer (10/19) Mar 11 2014 It was buried in that thread. Here is a bugzilla issue that links to
- Dicebot (8/17) Mar 11 2014 There is also actual pull request (which I can't link right now
- Dicebot (1/1) Mar 11 2014 PR: https://github.com/D-Programming-Language/dmd/pull/2895
- Steven Schveighoffer (5/10) Mar 11 2014 BTW, I'm somewhat amused that this was as unknown to everyone else as it...
- Dicebot (4/9) Mar 11 2014 I only know it because I am subscribed to all activity in dmd
- bearophile (10/14) Mar 11 2014 I have seen D code in the wild where all member functions are
- Daniel =?ISO-8859-1?Q?Koz=E1k?= (2/5) Mar 11 2014 What is the current status of this?
- Andrei Alexandrescu (3/8) Mar 11 2014 I am opposed to making functions final by default.
- Vladimir Panteleev (4/15) Mar 11 2014 Because of the breakage, or because you think virtual-by-default
- Andrei Alexandrescu (6/19) Mar 11 2014 A combination of both. The change would break a lot of code and it seems...
- John Colvin (4/29) Mar 11 2014 You do support the introduction of the virtual keyword though,
- Andrei Alexandrescu (3/28) Mar 11 2014 If explained a good use case, I would.
- Michel Fortin (20/24) Mar 11 2014 class Foo
- Andrei Alexandrescu (5/25) Mar 11 2014 Got it, thanks. If we don't move forward with final by default, this is
- Walter Bright (19/33) Mar 12 2014 class Foo
- monarch_dodra (2/36) Mar 12 2014 Dat indentation/scoping! It works, but it makes my eyes bleed.
- bearophile (10/11) Mar 12 2014 It looks bad :-(
- Dmitry Olshansky (4/15) Mar 12 2014 ~nothrow
- Namespace (18/52) Mar 12 2014 With that in mind you can also claim that @system <-> @safe and
- deadalnix (3/38) Mar 12 2014 I was thinking about ~final, but yes, we need some way to get out
- Steven Schveighoffer (21/56) Mar 13 2014 Fixed it for you.
- Daniel Murphy (2/23) Mar 13 2014 This looks much worse with all the method bodies still in there.
- Daniel Murphy (14/19) Mar 12 2014 FWIW this is exactly where I was back before dconf13.
- Andrei Alexandrescu (3/5) Mar 12 2014 Most breakages are very small and trivially handled. That's not the poin...
- bearophile (6/8) Mar 12 2014 Unexpected regressions, silent dangerous breakage, safe but hard
- Andrei Alexandrescu (6/12) Mar 12 2014 That's why I said "most" and not "all".
- Jacob Carlborg (10/14) Mar 12 2014 There has previously been suggestions of adding syntax turn off/negating...
- bearophile (12/13) Mar 11 2014 Walter has agreed to make functions final by default. And this
- Brian Rogoff (10/15) Mar 11 2014 If he resisted for a long time, it makes little sense to say "he
- Joakim (30/46) Mar 11 2014 I like it. :) It's Walter's project and he solicited opinions.
- Dmitry Olshansky (4/6) Mar 11 2014 Good management hardly ever won a contest in design.
- Dicebot (11/27) Mar 11 2014 It already works that way. Only thing is not obvious is actual
- Mathias LANG (13/23) Mar 11 2014 I tend to agree with you. Someone once pointed out that we should
- bearophile (4/7) Mar 11 2014 Please add it to bugzilla.
- Walter Bright (2/3) Mar 11 2014 http://www.youtube.com/watch?v=poDaTeyqIm4
- Steve Teale (3/6) Mar 12 2014 Ace Walter - how do you find the time? I believe that you are
- Walter Bright (2/4) Mar 12 2014 I rely on the fresh blood of unborn kittens.
- Steve Teale (3/4) Mar 13 2014 I must try it. Sadly our youngest cat has disappeared over about
- Brad Anderson (11/27) Mar 11 2014 I think the only thing lacking—and some people already alluded to
- Joseph Cassman (31/47) Mar 11 2014 I started trying to use D a few years ago and also had to take a
- Andrej Mitrovic (4/5) Mar 13 2014 You see these massive protests and overthrows of people who hold
What D needs at this point is a dictator. There are about 30 pages of discussion about Walter's std.array.front post, and Steve S's counter post. It reminds me of the way it was maybe 4 years ago, when there was so much bickering that I just gave up for some time, and went away. Who is going to go through all that stuff, and winnow a compromise out of it. Everyone has a job, or some vital preoccupation with their own project. The buck has to stop somewhere - is it Walter, or Andrei, or can any proposal or comment be stalled by sheer weight of contrary views? This is probably a management issue, not a technical one. Trouble is there's no manager, and even if their was, he'd have no minions. What to do? Steve
Mar 11 2014
On Tuesday, 11 March 2014 at 17:47:56 UTC, Steve Teale wrote:What D needs at this point is a dictator. There are about 30 pages of discussion about Walter's std.array.front post, and Steve S's counter post. It reminds me of the way it was maybe 4 years ago, when there was so much bickering that I just gave up for some time, and went away. Who is going to go through all that stuff, and winnow a compromise out of it. Everyone has a job, or some vital preoccupation with their own project. The buck has to stop somewhere - is it Walter, or Andrei, or can any proposal or comment be stalled by sheer weight of contrary views? This is probably a management issue, not a technical one. Trouble is there's no manager, and even if their was, he'd have no minions. What to do? SteveThe buck does stop with Walter and Andrei. What you're seeing is community discussion, which informs their ultimate decisions. Are you saying that people shouldn't be discussing language decisions and that it should just be left to a couple of people? Also, of course Walter can decide not to do something due to community pressure. He has the ultimate say, it's his language, but that doesn't mean he shouldn't listen.
Mar 11 2014
On Tuesday, 11 March 2014 at 18:01:23 UTC, John Colvin wrote:The buck does stop with Walter and Andrei. What you're seeing is community discussion, which informs their ultimate decisions. Are you saying that people shouldn't be discussing language decisions and that it should just be left to a couple of people? Also, of course Walter can decide not to do something due to community pressure. He has the ultimate say, it's his language, but that doesn't mean he shouldn't listen.I'm probably thinking more of some organization where if a discussion went off scale, something would happen, like a vote on the 3 main protagonists. If those 3 were not willing or able to get together and come up with a compromise, then the status quo should prevail until W/A decide otherwise. Lacking some compromise of that sort, D just becomes Balkanized. It did, and it recovered, but I think it sets things back. Steve
Mar 11 2014
On Tue, 2014-03-11 at 18:01 +0000, John Colvin wrote: [=E2=80=A6]Also, of course Walter can decide not to do something due to=20 community pressure. He has the ultimate say, it's his language,=20 but that doesn't mean he shouldn't listen.Python used to be Guido's language, but he and the community evolved out of that phase. It has not diminished Guido's status or standing. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Mar 12 2014
On Tue, 11 Mar 2014 13:47:55 -0400, Steve Teale <steve.teale britseyeview.com> wrote:What D needs at this point is a dictator. There are about 30 pages of discussion about Walter's std.array.front post, and Steve S's counter post. It reminds me of the way it was maybe 4 years ago, when there was so much bickering that I just gave up for some time, and went away. Who is going to go through all that stuff, and winnow a compromise out of it. Everyone has a job, or some vital preoccupation with their own project. The buck has to stop somewhere - is it Walter, or Andrei, or can any proposal or comment be stalled by sheer weight of contrary views? This is probably a management issue, not a technical one. Trouble is there's no manager, and even if their was, he'd have no minions. What to do?But it already is this way. What we have now are the gatekeepers of Walter and Andrei, and they (rightfully) hold a very high bar as to what should go into the language. They are the dictators, that we get to question and debate with. I don't consider it bickering at all. Debate, and especially heated debate, has always been a part of the forums. What else would you expect? Any time you have an open platform for discussion, things like this will show up. You can probably just ignore it, unless you care. In fact my newsreader has a feature to ignore entire threads. I ignore many of them, simply because I don't have the time in the day to debate everything. But things I care about, I want to make sure my point of view is being expressed, even if it's not me expressing it (in this case, nobody seemed to be presenting that view). This is not a democracy, and it's a good thing that it's not. But it absolutely must remain an open platform for people to voice opinions. Consider how long Walter resisted the call to make functions final by default, until he suddenly switched sides. I think of it like a dictatorship with 1000 advisors. And no death squads :) BTW, I don't expect a compromise, or really any movement, on the string issue. At least until someone has the wherewithal and motivation to actually try some things out with experimentation, and identify what the result might be. Until then, everything is theory. I was actually quite surprised Walter even considered fixing the problem to begin with. -Steve
Mar 11 2014
On Tuesday, 11 March 2014 at 18:14:52 UTC, Steven Schveighoffer wrote:On Tue, 11 Mar 2014 13:47:55 -0400, Steve TealeFunctions final by default? I read the list of changes for 2.065, and that one got by me completely. Aargh!
Mar 11 2014
On Tuesday, 11 March 2014 at 18:29:35 UTC, Steve Teale wrote:On Tuesday, 11 March 2014 at 18:14:52 UTC, Steven Schveighoffer wrote:Not in 2.065 2.066 will introduce "virtual" keyword 2.067+ will change the defaults if it will still be considered good ideaOn Tue, 11 Mar 2014 13:47:55 -0400, Steve TealeFunctions final by default? I read the list of changes for 2.065, and that one got by me completely. Aargh!
Mar 11 2014
On Tuesday, 11 March 2014 at 18:35:57 UTC, Dicebot wrote:On Tuesday, 11 March 2014 at 18:29:35 UTC, Steve Teale wrote:Well if we're going there, we should go the whole hog and have final, direct, and virtual. It's a system programming language, so you should be able to walk down the street naked as long as you are prepared to put up with the consequences. SteveOn Tuesday, 11 March 2014 at 18:14:52 UTC, Steven Schveighoffer wrote:Not in 2.065 2.066 will introduce "virtual" keyword 2.067+ will change the defaults if it will still be considered good ideaOn Tue, 11 Mar 2014 13:47:55 -0400, Steve TealeFunctions final by default? I read the list of changes for 2.065, and that one got by me completely. Aargh!
Mar 11 2014
On Tuesday, 11 March 2014 at 18:42:23 UTC, Steve Teale wrote:On Tuesday, 11 March 2014 at 18:35:57 UTC, Dicebot wrote:It sounds like what you are wanting is explicit project management. Possibly D could use a little work in that direction? Something like MS Project or a free alternative available to all(read only or git based with pulls). If it could be integrated with git then it would truly be powerful with pull requests, bounties, etc all showing up. Anyone could open it and see the current state, blocking issues, etc. Since Project can find the best "course of action" it would at least be efficient but might take quite a bit of work setting up. With such project management anyone could load up and see the current state, which I think would make D's direction quite a bit more concrete for people.On Tuesday, 11 March 2014 at 18:29:35 UTC, Steve Teale wrote:Well if we're going there, we should go the whole hog and have final, direct, and virtual. It's a system programming language, so you should be able to walk down the street naked as long as you are prepared to put up with the consequences. SteveOn Tuesday, 11 March 2014 at 18:14:52 UTC, Steven Schveighoffer wrote:Not in 2.065 2.066 will introduce "virtual" keyword 2.067+ will change the defaults if it will still be considered good ideaOn Tue, 11 Mar 2014 13:47:55 -0400, Steve TealeFunctions final by default? I read the list of changes for 2.065, and that one got by me completely. Aargh!
Mar 11 2014
I'd like to point out that Walter and Andrei can't do it all themselves. It takes a team and part of pulling it off is well defined goals and job descriptions with devoted people.
Mar 11 2014
On Tuesday, 11 March 2014 at 18:56:15 UTC, Indica wrote:I'd like to point out that Walter and Andrei can't do it all themselves. It takes a team and part of pulling it off is well defined goals and job descriptions with devoted people.This is one of the motivations for my remark. They both have probably more tan enough to do without having to wade through the tremendous volume of responses. Steve
Mar 11 2014
On 3/11/14, 11:36 PM, Steve Teale wrote:On Tuesday, 11 March 2014 at 18:56:15 UTC, Indica wrote:I could use more tan, can't wait for the summer :o). I'm glad you brought this up and that there was some good discussion following it. Walter is a very nice man. He dislikes saying "no" to people on account of them getting mad at him or the language. So he'd rather not answer. Lately we figured that's actually worse because it creates frustration (the perception is the request/effort is ignored, not acknowledged and declined). So we set to become more decisive about things. You may have noticed in recent history that we started more often to set the foot on the ground on one topic or another. We hope that that is healthy for the community. It also means for us all to accept the reality that in matters of judgment we can't always do what others believe is best, and on occasion (hopefully not too often!) even not what would objectively be the best decision. What I'd like us to achieve and convey in future debates is that whatever decision we make, we are making it in full understanding of all involved arguments. The "perpetual design" stage of D has ended. We've made our bed, it's time to lie in it. I foresee only one more area of possible breakage - thread support, and hopefully only code that was already broken should cease to compile. AndreiI'd like to point out that Walter and Andrei can't do it all themselves. It takes a team and part of pulling it off is well defined goals and job descriptions with devoted people.This is one of the motivations for my remark. They both have probably more tan enough to do without having to wade through the tremendous volume of responses.
Mar 12 2014
Andrei Alexandrescu:The "perpetual design" stage of D has ended. We've made our bed, it's time to lie in it.If you don't change your bed once in a while, it will start to smell. A language dies if it doesn't keep a subgroup of people for its design, and when necessarily its redesign. Adapted from Simon Peyton Jones: ~We should avoid D success at all costs~I foresee only one more area of possible breakage - thread support, and hopefully only code that was already broken should cease to compile.There is also to fix the small mess with tuples. I suggest to deprecate some usages of the comma. And there are few more small things to fix. Bye, bearophile
Mar 12 2014
On 3/12/2014 8:49 PM, bearophile wrote:Andrei Alexandrescu:Very true (see C++ and why D was needed ;) ), but of course the "perpetual design" stage of *D2* is over. I can certainly see an eventual D3 or D++ or E or whatever (with a smoother upgrade path than D1->D2), but not until D2 matures further. At some point we have to dial back on breaking changes and let things settle before the next round of "bedding changes".The "perpetual design" stage of D has ended. We've made our bed, it's time to lie in it.If you don't change your bed once in a while, it will start to smell. A language dies if it doesn't keep a subgroup of people for its design, and when necessarily its redesign.
Mar 12 2014
On Thursday, 13 March 2014 at 00:37:42 UTC, Andrei Alexandrescu wrote:I could use more tan, can't wait for the summer :o).Be careful. Sunglasses and sun cream indice 120 or you'll burn to ashes.Lately we figured that's actually worse because it creates frustration (the perception is the request/effort is ignored, not acknowledged and declined). So we set to become more decisive about things. You may have noticed in recent history that we started more often to set the foot on the ground on one topic or another.Yes, that is a good change. More frustrating on the short run, but less on exhausting on the long run.
Mar 12 2014
On Thu, Mar 13, 2014 at 05:10:42AM +0000, deadalnix wrote:On Thursday, 13 March 2014 at 00:37:42 UTC, Andrei Alexandrescu[...]Yes, I also applaud this attitude. Taking decisive action not only saves time / energy arguing back and forth, it also boosts morale and gives a sense of direction. Keeping silent about things hurts morale because it can be (wrongly) perceived as ignoring the issue, being indecisive, or deliberately stonewalling. Any feedback is better than silence, even if it's a "no". T -- Freedom of speech: the whole world has no right *not* to hear my spouting off!Lately we figured that's actually worse because it creates frustration (the perception is the request/effort is ignored, not acknowledged and declined). So we set to become more decisive about things. You may have noticed in recent history that we started more often to set the foot on the ground on one topic or another.Yes, that is a good change. More frustrating on the short run, but less on exhausting on the long run.
Mar 12 2014
On Thursday, 13 March 2014 at 00:37:42 UTC, Andrei Alexandrescu wrote:On 3/11/14, 11:36 PM, Steve Teale wrote:Appreciate the change. The increased clarity is helpful. Thanks. JosephOn Tuesday, 11 March 2014 at 18:56:15 UTC, Indica wrote:I could use more tan, can't wait for the summer :o). I'm glad you brought this up and that there was some good discussion following it. Walter is a very nice man. He dislikes saying "no" to people on account of them getting mad at him or the language. So he'd rather not answer. Lately we figured that's actually worse because it creates frustration (the perception is the request/effort is ignored, not acknowledged and declined). So we set to become more decisive about things. You may have noticed in recent history that we started more often to set the foot on the ground on one topic or another. We hope that that is healthy for the community. It also means for us all to accept the reality that in matters of judgment we can't always do what others believe is best, and on occasion (hopefully not too often!) even not what would objectively be the best decision. What I'd like us to achieve and convey in future debates is that whatever decision we make, we are making it in full understanding of all involved arguments. The "perpetual design" stage of D has ended. We've made our bed, it's time to lie in it. I foresee only one more area of possible breakage - thread support, and hopefully only code that was already broken should cease to compile. AndreiI'd like to point out that Walter and Andrei can't do it all themselves. It takes a team and part of pulling it off is well defined goals and job descriptions with devoted people.This is one of the motivations for my remark. They both have probably more tan enough to do without having to wade through the tremendous volume of responses.
Mar 12 2014
On Wednesday, March 12, 2014 17:37:37 Andrei Alexandrescu wrote:The "perpetual design" stage of D has ended. We've made our bed, it's time to lie in it. I foresee only one more area of possible breakage - thread support, and hopefully only code that was already broken should cease to compile.Another major area which we've discussed changing (and agreed on - we just haven't actually managed to implement the changes) is removing toString, toHash, opEquals, and opCmp from Object to fix the const problem. That's likely to introduce breaking changes - well worth it IMHO, and hopefully it can be done with minimal disruption - but it's a pretty big change nonetheless - Jonathan M Davis
Mar 13 2014
On Thursday, 13 March 2014 at 00:37:42 UTC, Andrei Alexandrescu wrote:On 3/11/14, 11:36 PM, Steve Teale wrote:Walter is a complex and proud man, like most of us. I love him dearly - he (along with John Haggins - who you maybe never heard of), changed my life. I'm getting old now, so the old adage "if it ain't broken, don't mend it" becomes very appealing. Except, of course for 'direct' ;=) I think, looking at the current arguments, that C++ may have got it right there. And, since it wasn't there before, can it break anything? Steve SteveOn Tuesday, 11 March 2014 at 18:56:15 UTC, Indica wrote:Walter is a very nice man. He dislikes saying "no" to people on account of them getting mad at him or the language. So he'd rather not answer.I'd like to point out that Walter and Andrei can't do it all themselves. It takes a team and part of pulling it off is well defined goals and job descriptions with devoted people.This is one of the motivations for my remark. They both have probably more than enough to do without having to wade through the tremendous volume of responses.
Mar 13 2014
On Tuesday, 11 March 2014 at 18:54:37 UTC, Indica wrote:It sounds like what you are wanting is explicit project management. Possibly D could use a little work in that direction? Something like MS Project or a free alternative available to all(read only or git based with pulls).There is no point in project management with no team to manage. As far as I understand there is no structured collaboration inside D core team and no strict responsibilities, just group of people working on what they consider important and sometimes communicating to figure out corner cases. At least this is what I see judging by GitHub / NG activity.
Mar 11 2014
On 3/11/2014 2:42 PM, Steve Teale wrote:Well if we're going there, we should go the whole hog and have final, direct, and virtual.Pardon my ignorance: What's 'direct'?It's a system programming language, so you should be able to walk down the street naked as long as you are prepared to put up with the consequences.There has been much debate in the programming community over what exactly "system programming language" means. I think you, sir, have found the winner! Gets my vote, anyway! :)
Mar 11 2014
On Tuesday, 11 March 2014 at 22:24:15 UTC, Nick Sabalausky wrote:On 3/11/2014 2:42 PM, Steve Teale wrote:What I meant by final is simply the third leg of a tuffet. As I understand it, final means called directly, and you can't override, virtual means called through the vtable and you can override, direct means called directly, but you can override (hide) in a derived class, like if you define a method with the same signature in a derived class in C++ when the base class method is not marked as virtual. I tried that with G++ the other day, and it still seems to compile. There may be other possibilities, I have not attempted to draw the matrix table. SteveWell if we're going there, we should go the whole hog and have final, direct, and virtual.Pardon my ignorance: What's 'direct'?It's a system programming language, so you should be able to walk down the street naked as long as you are prepared to put up with the consequences.There has been much debate in the programming community over what exactly "system programming language" means. I think you, sir, have found the winner! Gets my vote, anyway! :)
Mar 11 2014
On Tuesday, 11 March 2014 at 18:35:57 UTC, Dicebot wrote:On Tuesday, 11 March 2014 at 18:29:35 UTC, Steve Teale wrote:What ???On Tuesday, 11 March 2014 at 18:14:52 UTC, Steven Schveighoffer wrote:Not in 2.065 2.066 will introduce "virtual" keyword 2.067+ will change the defaults if it will still be considered good ideaOn Tue, 11 Mar 2014 13:47:55 -0400, Steve TealeFunctions final by default? I read the list of changes for 2.065, and that one got by me completely. Aargh!
Mar 11 2014
Dicebot:Not in 2.065 2.066 will introduce "virtual" keyword 2.067+ will change the defaults if it will still be considered good ideaWhat's the point of having "virtual" if the default doesn't change? Bye, bearophile
Mar 11 2014
On Tuesday, 11 March 2014 at 21:24:22 UTC, bearophile wrote:Dicebot:frequently mentioned example: class Something { final: // want all to be final by default // ... virtual void foo() {} // but this one function } I think just keeping "virtual" but not changing defaults is a good practical compromise.Not in 2.065 2.066 will introduce "virtual" keyword 2.067+ will change the defaults if it will still be considered good ideaWhat's the point of having "virtual" if the default doesn't change? Bye, bearophile
Mar 11 2014
On Tuesday, 11 March 2014 at 21:29:00 UTC, Dicebot wrote:final: // want all to be final by default // ... virtual void foo() {} // but this one functionDoesn't this make room for undetected bugs? Generally the syntax should have enough redundancy to prevent a single typo (missing ":") from completely changing the semantics. Ola.
Mar 11 2014
On Tuesday, 11 March 2014 at 21:35:12 UTC, Ola Fosheim Grøstad wrote:On Tuesday, 11 March 2014 at 21:29:00 UTC, Dicebot wrote:Mostly depends on the way you format the code. It is perfectly consistent with existing safe / system interaction though and allows to define defaults in user code without changing anything in the language ;)final: // want all to be final by default // ... virtual void foo() {} // but this one functionDoesn't this make room for undetected bugs? Generally the syntax should have enough redundancy to prevent a single typo (missing ":") from completely changing the semantics. Ola.
Mar 11 2014
On 12 March 2014 07:28, Dicebot <public dicebot.lv> wrote:On Tuesday, 11 March 2014 at 21:24:22 UTC, bearophile wrote:I'm really trying to keep my lid on here... I'll just remind that in regard to this particular point which sounds reasonable, it's easy to forgot that *all library code where the author didn't care* is now unusable by anybody who does. The converse would not be true if the situation was reversed. virtual-by-default is incompatible with optimisation, and it's reliable to assume that anybody who doesn't explicitly care about this will stick with the default, which means many potentially useful libraries may be eliminated for use by many customers. Also, as discussed at length, revoking virtual from a function is a breaking change, adding virtual is not. Which means that, instead of making a controlled breaking change with a clear migration path here and now, we are committing every single instance of any user's intent to 'optimise' their libraries (by finalising unnecessarily virtuals) to breaking changes in their ABI - which *will* occur, since virtual is the default. According to semantic versioning, this requires bumping the major version number... that's horrible! What's better; implementing a controlled deprecation path now, or leaving it up to any project that ever uses the 'class' keyword to eventually confront breaking changes in their API when they encounter a performance oriented customer?Dicebot: Not in 2.065frequently mentioned example: class Something { final: // want all to be final by default // ... virtual void foo() {} // but this one function } I think just keeping "virtual" but not changing defaults is a good practical compromise.2.066 will introduce "virtual" keyword 2.067+ will change the defaults if it will still be considered good ideaWhat's the point of having "virtual" if the default doesn't change? Bye, bearophile
Mar 11 2014
On Wednesday, 12 March 2014 at 03:05:00 UTC, Manu wrote:I'm really trying to keep my lid on here... I'll just remind that in regard to this particular point which sounds reasonable, it's easy to forgot that *all library code where the author didn't care* is now unusable by anybody who does. The converse would not be true if the situation was reversed. virtual-by-default is incompatible with optimisation, and it's reliable to assume that anybody who doesn't explicitly care about this will stick with the default, which means many potentially useful libraries may be eliminated for use by many customers. Also, as discussed at length, revoking virtual from a function is a breaking change, adding virtual is not. Which means that, instead of making a controlled breaking change with a clear migration path here and now, we are committing every single instance of any user's intent to 'optimise' their libraries (by finalising unnecessarily virtuals) to breaking changes in their ABI - which *will* occur, since virtual is the default. According to semantic versioning, this requires bumping the major version number... that's horrible! What's better; implementing a controlled deprecation path now, or leaving it up to any project that ever uses the 'class' keyword to eventually confront breaking changes in their API when they encounter a performance oriented customer?Case in point: https://github.com/D-Programming-Language/phobos/pull/1771 "mark std.zip classes as final" Long story short: MartinNowak decided to make the Zip classes final, since it made no sense to have any of the functions virtual, or to have anybody derive from them anyways. https://github.com/D-Programming-Language/phobos/pull/1771#issuecomment-36524041 Comment from Dav1dde: "Just to let you know, it broke my code"
Mar 12 2014
On 12 March 2014 20:40, monarch_dodra <monarchdodra gmail.com> wrote:On Wednesday, 12 March 2014 at 03:05:00 UTC, Manu wrote:Thank you. There you go, it's not even hypothetical.I'm really trying to keep my lid on here... I'll just remind that in regard to this particular point which sounds reasonable, it's easy to forgot that *all library code where the author didn't care* is now unusable by anybody who does. The converse would not be true if the situation was reversed. virtual-by-default is incompatible with optimisation, and it's reliable to assume that anybody who doesn't explicitly care about this will stick with the default, which means many potentially useful libraries may be eliminated for use by many customers. Also, as discussed at length, revoking virtual from a function is a breaking change, adding virtual is not. Which means that, instead of making a controlled breaking change with a clear migration path here and now, we are committing every single instance of any user's intent to 'optimise' their libraries (by finalising unnecessarily virtuals) to breaking changes in their ABI - which *will* occur, since virtual is the default. According to semantic versioning, this requires bumping the major version number... that's horrible! What's better; implementing a controlled deprecation path now, or leaving it up to any project that ever uses the 'class' keyword to eventually confront breaking changes in their API when they encounter a performance oriented customer?Case in point: https://github.com/D-Programming-Language/phobos/pull/1771 "mark std.zip classes as final" Long story short: MartinNowak decided to make the Zip classes final, since it made no sense to have any of the functions virtual, or to have anybody derive from them anyways. https://github.com/D-Programming-Language/phobos/pull/1771#issuecomment- 36524041 Comment from Dav1dde: "Just to let you know, it broke my code"
Mar 12 2014
On Wednesday, 12 March 2014 at 11:40:39 UTC, Manu wrote:On 12 March 2014 20:40, monarch_dodra <monarchdodra gmail.com> wrote:It can also happen the other way if I mark a method virtual that used to be final, which was overloaded in a subclass, right? -- PauloOn Wednesday, 12 March 2014 at 03:05:00 UTC, Manu wrote:Thank you. There you go, it's not even hypothetical.I'm really trying to keep my lid on here... I'll just remind that in regard to this particular point which sounds reasonable, it's easy to forgot that *all library code where the author didn't care* is now unusable by anybody who does. The converse would not be true if the situation was reversed. virtual-by-default is incompatible with optimisation, and it's reliable to assume that anybody who doesn't explicitly care about this will stick with the default, which means many potentially useful libraries may be eliminated for use by many customers. Also, as discussed at length, revoking virtual from a function is a breaking change, adding virtual is not. Which means that, instead of making a controlled breaking change with a clear migration path here and now, we are committing every single instance of any user's intent to 'optimise' their libraries (by finalising unnecessarily virtuals) to breaking changes in their ABI - which *will* occur, since virtual is the default. According to semantic versioning, this requires bumping the major version number... that's horrible! What's better; implementing a controlled deprecation path now, or leaving it up to any project that ever uses the 'class' keyword to eventually confront breaking changes in their API when they encounter a performance oriented customer?Case in point: https://github.com/D-Programming-Language/phobos/pull/1771 "mark std.zip classes as final" Long story short: MartinNowak decided to make the Zip classes final, since it made no sense to have any of the functions virtual, or to have anybody derive from them anyways. https://github.com/D-Programming-Language/phobos/pull/1771#issuecomment- 36524041 Comment from Dav1dde: "Just to let you know, it broke my code"
Mar 12 2014
On Wednesday, 12 March 2014 at 11:59:45 UTC, Paulo Pinto wrote:On Wednesday, 12 March 2014 at 11:40:39 UTC, Manu wrote: It can also happen the other way if I mark a method virtual that used to be final, which was overloaded in a subclass, right? -- Pauloas well) is that shadowing a virtual method is a warning. If Bar derives from Foo and implements foobar(int), then at some point Foo decides to add foobar(int), Bar's foobar(int) will not be virtual but a warning will be given that it shadows Foo.foobar(int). You can then either mark it override, or you can mark it new to indicate that you are aware it shadows the method and don't want to overload it. So going from final to virtual is not a breaking change (but you will receive a warning until you acknowledge that you're shadowing the method), but going from virtual to final is a breaking change.
Mar 13 2014
On 3/12/14, 4:40 AM, Manu wrote:Thank you. There you go, it's not even hypothetical.I think the example given works against your argument. Andrei
Mar 12 2014
On Wednesday, 12 March 2014 at 16:46:26 UTC, Andrei Alexandrescu wrote:On 3/12/14, 4:40 AM, Manu wrote:How so? The example was his argument verbatim.Thank you. There you go, it's not even hypothetical.I think the example given works against your argument. Andrei
Mar 12 2014
On 3/12/14, 10:05 AM, monarch_dodra wrote:On Wednesday, 12 March 2014 at 16:46:26 UTC, Andrei Alexandrescu wrote:His argument assumed at core that the library designer knows better than the library user what the customization points are, and that most functions are virtual by mistake. AndreiOn 3/12/14, 4:40 AM, Manu wrote:How so? The example was his argument verbatim.Thank you. There you go, it's not even hypothetical.I think the example given works against your argument. Andrei
Mar 12 2014
On Wednesday, 12 March 2014 at 17:08:59 UTC, Andrei Alexandrescu wrote:On 3/12/14, 10:05 AM, monarch_dodra wrote:And this argument is absolutely correct, in my experience. By making virtuality an explicit choice, the library designer is specifying that a given function is a part of the published interface for a class and overriding it has some explicit purpose that will be maintained over time. In a "virtual by default" world, there is no explicit contract regarding the virtuality of functions, and so the library writer may not feel any obligation to retain those functions at all, their signatures, or their application to the operation of the class. Unless a particular function is documented as overridable, you can't assume that the library writer didn't simply forget to mark it final. Doing otherwise puts the library writer in an awkward position by imposing an obligation to preserve behavior that was never intended to be public in the first place. The example provided demonstrated this exact problem.On Wednesday, 12 March 2014 at 16:46:26 UTC, Andrei Alexandrescu wrote:His argument assumed at core that the library designer knows better than the library user what the customization points are, and that most functions are virtual by mistake.On 3/12/14, 4:40 AM, Manu wrote:How so? The example was his argument verbatim.Thank you. There you go, it's not even hypothetical.I think the example given works against your argument. Andrei
Mar 12 2014
And for the record, I'm absolutely pedantic about adding "final" qualifiers to functions that aren't intended to be overridable, and yet it recently came to light that the methods a class in Druntime that I created (Condition) are not labeled final. I can't imagine any reason why I'd have made that decision explicitly, since there's no real function to having them be overridable. It was obviously a mistake on my part, and yet there are two instances where Condition has been subclassed and these methods overridden (once by me, to be honest), to questionable ends. And so at this point I can't add the "final" qualifier without breaking user code, even though it was always meant to be there. In short, I don't think that saying this is often overlooked is even necessarily an assertion that library writers are sloppy or don't care about performance. It being the default behavior and having no detectable issues at design time means that these problems will slip in from time to time. It's hard to grep for the lack of a keyword.
Mar 12 2014
On 2014-03-12 20:51, Sean Kelly wrote:And this argument is absolutely correct, in my experience. By making virtuality an explicit choice, the library designer is specifying that a given function is a part of the published interface for a class and overriding it has some explicit purpose that will be maintained over time.There's a book, Effective Java, that recommends all methods should be marked as final unless explicitly intended to be overridden. The argument is that a class needs to be explicitly designed for subclassing. -- /Jacob Carlborg
Mar 12 2014
12-Mar-2014 23:51, Sean Kelly пишет:On Wednesday, 12 March 2014 at 17:08:59 UTC, Andrei Alexandrescu wrote:Seconded. -- Dmitry OlshanskyOn 3/12/14, 10:05 AM, monarch_dodra wrote:And this argument is absolutely correct, in my experience. By making virtuality an explicit choice, the library designer is specifying that a given function is a part of the published interface for a class and overriding it has some explicit purpose that will be maintained over time.On Wednesday, 12 March 2014 at 16:46:26 UTC, Andrei Alexandrescu wrote:His argument assumed at core that the library designer knows better than the library user what the customization points are, and that most functions are virtual by mistake.On 3/12/14, 4:40 AM, Manu wrote:How so? The example was his argument verbatim.Thank you. There you go, it's not even hypothetical.I think the example given works against your argument. Andrei
Mar 12 2014
On Wednesday, 12 March 2014 at 17:08:59 UTC, Andrei Alexandrescu wrote:On 3/12/14, 10:05 AM, monarch_dodra wrote:There were countless arguments to demonstrate that this *is* the case. If the developer had not considered whether the function is safe to be virtual, it's not safe. A change request could be made for exposing a customization point, but it is something that needs to be done explicitly by the library designer, not just override and hope that it works out. And of course, once you do expose it you're stuck with it and the design that supports it unless you want to break user code. It would be interesting to scrape Github projects using Java percentage of virtual functions is between each of them, as well as see how many easily statically noticed probable bugs there are (i.e., virtual property operating on a backing field which is then accessed directly by a different method in the base class) in each of them.On Wednesday, 12 March 2014 at 16:46:26 UTC, Andrei Alexandrescu wrote:His argument assumed at core that the library designer knows better than the library user what the customization points are, and that most functions are virtual by mistake. AndreiOn 3/12/14, 4:40 AM, Manu wrote:How so? The example was his argument verbatim.Thank you. There you go, it's not even hypothetical.I think the example given works against your argument. Andrei
Mar 13 2014
I used to believe that virtual was a better default, but these days I think the opposite. My reasoning is that inheritance is a very poor tool for code reuse. The way I see it now, inheritance is a tool for modelling "is a" relationships and variations on objects, but it's bad to use it in an API as a "to implement your business logic inherit here" thing. You get much better code reuse out of functions, especially with generic programming. (D being the number one generic language with its templates and CTFE.) The more loosely coupled the data becomes from the business logic, the higher application quality appears to be and the more breakage decreases. Presenting an interface for a library whereby the types can automatically be overridden is a good way to lead people into writing code that's going to break later and may burden the library's implementer with supporting something he didn't know he'd need to support. (e.g. in Nowak's ZIP library.)
Mar 13 2014
On 13 March 2014 02:46, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org>wrote:On 3/12/14, 4:40 AM, Manu wrote:How so? Virtual was removed, code broke. This is the default state of D. The other direction has no such problem.Thank you. There you go, it's not even hypothetical.I think the example given works against your argument.
Mar 12 2014
On 2014-03-12 03:04:38 +0000, Manu <turkeyman gmail.com> said:virtual-by-default is incompatible with optimisation, and it's reliable to assume that anybody who doesn't explicitly care about this will stick with the default, which means many potentially useful libraries may be eliminated for use by many customers.I'll add another argument to the mix. Currently, you can't have private/package functions that are virtual, contrary to what TDPL says. To make things coherent we could change private function so they become virtual by default. You might be able to see the problem with this option: making private function virtual by default is likely to add many performance regressions in existing code, silently. Or we could implement final by default. This option would instead force people to add 'virtual' here and there, but otherwise existing code is likely to run faster after that. We could always keep things as they currently are: private/package is not virtual, everything else is virtual unless marked final. Honestly I'd like to se that go. The protection attribute should have nothing to do with whether a function is virtual or not. -- Michel Fortin michel.fortin michelf.ca http://michelf.ca
Mar 12 2014
On Wed, 12 Mar 2014 08:32:14 -0400, Michel Fortin <michel.fortin michelf.ca> wrote:On 2014-03-12 03:04:38 +0000, Manu <turkeyman gmail.com> said:Private virtual functions make 0 sense. A private function cannot be accessed by a derived class. Who gets to access a overriden virtual function? The base class only? If I'm writing a function, I certainly should be able to access it, no? Even if you want to restrict my access, you cannot, I'm in control of that code! Package, I'm less concerned about. You can make that virtual, I don't ever use package functions. -Stevevirtual-by-default is incompatible with optimisation, and it's reliable to assume that anybody who doesn't explicitly care about this will stick with the default, which means many potentially useful libraries may be eliminated for use by many customers.I'll add another argument to the mix. Currently, you can't have private/package functions that are virtual, contrary to what TDPL says. To make things coherent we could change private function so they become virtual by default. You might be able to see the problem with this option: making private function virtual by default is likely to add many performance regressions in existing code, silently.
Mar 12 2014
On 2014-03-12 12:48:59 +0000, "Steven Schveighoffer" <schveiguy yahoo.com> said:On Wed, 12 Mar 2014 08:32:14 -0400, Michel Fortin <michel.fortin michelf.ca> wrote:You're mixing C++ private with D private. Private just means the symbol is only accessible within the same module. You can have a whole class hierarchy in a module if you want, and thus could override private functions assuming they could be virtual. -- Michel Fortin michel.fortin michelf.ca http://michelf.caI'll add another argument to the mix. Currently, you can't have private/package functions that are virtual, contrary to what TDPL says. To make things coherent we could change private function so they become virtual by default. You might be able to see the problem with this option: making private function virtual by default is likely to add many performance regressions in existing code, silently.Private virtual functions make 0 sense. A private function cannot be accessed by a derived class. Who gets to access a overriden virtual function? The base class only? If I'm writing a function, I certainly should be able to access it, no? Even if you want to restrict my access, you cannot, I'm in control of that code!
Mar 12 2014
On Wed, 12 Mar 2014 09:15:14 -0400, Michel Fortin <michel.fortin michelf.ca> wrote:On 2014-03-12 12:48:59 +0000, "Steven Schveighoffer" <schveiguy yahoo.com> said:OK, I can see that being useful. You are right, I was thinking C++ private. So essentially, a virtual private function can only be overridden in classes defined in the same module. What happens when you do it in a separate module, an error? What if you want to define that function name, but it's taken by the base class, what happens? -SteveOn Wed, 12 Mar 2014 08:32:14 -0400, Michel Fortin <michel.fortin michelf.ca> wrote:You're mixing C++ private with D private. Private just means the symbol is only accessible within the same module. You can have a whole class hierarchy in a module if you want, and thus could override private functions assuming they could be virtual.I'll add another argument to the mix. Currently, you can't have private/package functions that are virtual, contrary to what TDPL says. To make things coherent we could change private function so they become virtual by default. You might be able to see the problem with this option: making private function virtual by default is likely to add many performance regressions in existing code, silently.Private virtual functions make 0 sense. A private function cannot be accessed by a derived class. Who gets to access a overriden virtual function? The base class only? If I'm writing a function, I certainly should be able to access it, no? Even if you want to restrict my access, you cannot, I'm in control of that code!
Mar 12 2014
On Wednesday, 12 March 2014 at 13:22:34 UTC, Steven Schveighoffer wrote:OK, I can see that being useful. You are right, I was thinking C++ private. -SteveEven in C++, private virtual a key part of the "non-virtual interface" thing. EG: You define your base class as having only non-virtual public functions, and private virtual function. They are private, so the derived classes can't *call* them, but they can still override them. The idea is that the base class holds any "non-modifyable" behavior, and the virtual functions are only "customizeable sub-part behavior". For example, C++ streams work that way: All the public functions are non-virtual. To create your own streams, you are supposed to only override a set of low level functions, and then the base class takes care of calling them correctly. In any case, that's how "private virtual" makes sense in C++. I'm less fluent with how it works D classes, but last time I read TDPL, I seem to remember it was built-in in some way.
Mar 12 2014
On Wed, 12 Mar 2014 09:45:22 -0400, monarch_dodra <monarchdodra gmail.com> wrote:On Wednesday, 12 March 2014 at 13:22:34 UTC, Steven Schveighoffer wrote:Nonsense. If I'm writing a function, I can call it. There is no way to prevent it. e.g.: class X { virtual void _foo() {/* default impl */} public: void foo() {_foo();} } class Y : public X { virtual void _foo() {_foo2();} void _foo2() { /* do whatever I want here */} } OK, so your idea is that I can't call my copy of _foo, which if that's how it works, is dumb in my opinion. But if that's the case, I'm in control of its implementation, I can just forward to another function that I can call.OK, I can see that being useful. You are right, I was thinking C++ private. -SteveEven in C++, private virtual a key part of the "non-virtual interface" thing. EG: You define your base class as having only non-virtual public functions, and private virtual function. They are private, so the derived classes can't *call* them, but they can still override them.The idea is that the base class holds any "non-modifyable" behavior, and the virtual functions are only "customizeable sub-part behavior". For example, C++ streams work that way: All the public functions are non-virtual. To create your own streams, you are supposed to only override a set of low level functions, and then the base class takes care of calling them correctly.The idea is fine, but protected serves this purpose just as well. -Steve
Mar 12 2014
On 3/12/14, Steven Schveighoffer <schveiguy yahoo.com> wrote:The idea is fine, but protected serves this purpose just as well.Protected still allows subclasses to *call* the methods. The idea is that the base class provides a public API which implements the calling, because only it knows in which order some private functions should be called.
Mar 12 2014
On Wednesday, 12 March 2014 at 13:53:28 UTC, Steven Schveighoffer wrote:On Wed, 12 Mar 2014 09:45:22 -0400, monarch_dodra <monarchdodra gmail.com> wrote:The point is that you can't call parent's virtual (often abstract) method. Of course you can call method you define but that is not the point of NVI.On Wednesday, 12 March 2014 at 13:22:34 UTC, Steven Schveighoffer wrote:Nonsense. If I'm writing a function, I can call it. There is no way to prevent it. e.g.:OK, I can see that being useful. You are right, I was thinking C++ private. -SteveEven in C++, private virtual a key part of the "non-virtual interface" thing. EG: You define your base class as having only non-virtual public functions, and private virtual function. They are private, so the derived classes can't *call* them, but they can still override them.
Mar 12 2014
On Wednesday, 12 March 2014 at 13:53:28 UTC, Steven Schveighoffer wrote:Nonsense. If I'm writing a function, I can call it. There is no way to prevent it.Yes, you are right. You can always call the function directly if you so wish, since you *are* defining it. But the idea is that it should just be a "piece of implementation" that should only be used in a controlled environment, as defined by the base class.OK, so your idea is that I can't call my copy of _foo, which if that's how it works, is dumb in my opinion. But if that's the case, I'm in control of its implementation, I can just forward to another function that I can call.Absolutely. And in NVI, arguably, that's a good idea. By doing this, you are basically creating a second level NVI for a potential third level implementation. *if* your derived class made a direct call to the virtual (protected) function, then you'd be voiding the base classes' guarantees for any other derived class.The idea is fine, but protected serves this purpose just as well.The basic idea of NVI is encapsulation of behavior. The derived class, while they are the ones defining the implementation, are considered no different from any other client, and are not given call rights. If you make the functions protected, then you are granting them access to implementation internals, which means weaker encapsulation. For a 1-level hierarchy, it doesn't make much difference, but the deeper you go, and the less robust the design gets.
Mar 12 2014
On 03/12/2014 02:22 PM, Steven Schveighoffer wrote:In a different module, attempting an override should behave as if the base class didn't define the member function.OK, I can see that being useful. You are right, I was thinking C++ private. So essentially, a virtual private function can only be overridden in classes defined in the same module. What happens when you do it in a separate module, an error?What if you want to define that function name, but it's taken by the base class, what happens?It's not taken. There are corner cases, when eg. the module with the private member function imports a module with a public member function hiding the private one (i.e., circular imports) and then uses this newly defined member function, possibly expecting to call its own private member. Then it should maybe be an error. :o) Anyway, I think the main issue with virtual private and virtual package is that they'd influence the class ABI.
Mar 12 2014
On Wednesday, 12 March 2014 at 13:22:34 UTC, Steven Schveighoffer wrote:when you do it in a separate module, an error? What if you want to define that function name, but it's taken by the base class, what happens? -SteveThat's when you need 'direct' ;=) Steve
Mar 12 2014
On 3/12/14, Steven Schveighoffer <schveiguy yahoo.com> wrote:Private virtual functions make 0 sense. A private function cannot be accessed by a derived class.It can if it's in the same module. You may want to have the benefit of virtual functions, but also the benefit of those methods being accessible in some internal API, but not to the user. If you make them protected, they're accessible by user-derived classes. You could make them package, but currently package is forced non-virtual as well.Package, I'm less concerned about. You can make that virtual, I don't ever use package functions.There is definitely a need for this. DFeed is full of these style of comments: /+ package +/ /+ protected +/ override int _rtype() // package It's obviously supposed to be hidden from the user, but it can't be. So underscores are prepended instead.
Mar 12 2014
On Wednesday, 12 March 2014 at 12:48:58 UTC, Steven Schveighoffer wrote:On Wed, 12 Mar 2014 08:32:14 -0400, Michel Fortin <michel.fortin michelf.ca> wrote:Private virtual functions actually make a LOT of sense in C++. Ever heard of NVI? It is actually good design practice to make class virtuals private in many cases and relay on Template Method pattern. Even Andrei advices that in C++ Coding Standards.On 2014-03-12 03:04:38 +0000, Manu <turkeyman gmail.com> said:Private virtual functions make 0 sense. A private function cannot be accessed by a derived class. Who gets to access a overriden virtual function? The base class only? If I'm writing a function, I certainly should be able to access it, no? Even if you want to restrict my access, you cannot, I'm in control of that code! Package, I'm less concerned about. You can make that virtual, I don't ever use package functions. -Stevevirtual-by-default is incompatible with optimisation, and it's reliable to assume that anybody who doesn't explicitly care about this will stick with the default, which means many potentially useful libraries may be eliminated for use by many customers.I'll add another argument to the mix. Currently, you can't have private/package functions that are virtual, contrary to what TDPL says. To make things coherent we could change private function so they become virtual by default. You might be able to see the problem with this option: making private function virtual by default is likely to add many performance regressions in existing code, silently.
Mar 12 2014
On 3/12/14, Michel Fortin <michel.fortin michelf.ca> wrote:Currently, you can't have private/package functions that are virtual, contrary to what TDPL says.The last word from Walter was that he agreed tying access specifiers to virtuality is wrong, but that it needs a proper DIP.
Mar 12 2014
On Wednesday, 12 March 2014 at 12:32:14 UTC, Michel Fortin wrote:I'll add another argument to the mix. Currently, you can't have private/package functions that are virtual, contrary to what TDPL says. To make things coherent we could change private function so they become virtual by default. You might be able to see the problem with this option: making private function virtual by default is likely to add many performance regressions in existing code, silently.No. In the case of private functions, by definition, the compiler have all overrides in the module and can finalize what needs to be.We could always keep things as they currently are: private/package is not virtual, everything else is virtual unless marked final. Honestly I'd like to se that go. The protection attribute should have nothing to do with whether a function is virtual or not.That is horrible. Bad separation of concerns.
Mar 12 2014
On 3/11/14, 8:04 PM, Manu wrote:I'm really trying to keep my lid on here...Yep, here we go again :o).I'll just remind that in regard to this particular point which sounds reasonable, it's easy to forgot that *all library code where the author didn't care* is now unusable by anybody who does. The converse would not be true if the situation was reversed.There's an asymmetry introduced by the fact there's today code in use.virtual-by-default is incompatible with optimisation, and it's reliable to assume that anybody who doesn't explicitly care about this will stick with the default, which means many potentially useful libraries may be eliminated for use by many customers.Virtual by default is, however, compatible with customization and flexibility. Unstated assumption: "many potential useful libraries" assumes many libraries use traditional OO design in their core components. Unstated assumption: "many customers".Also, as discussed at length, revoking virtual from a function is a breaking change, adding virtual is not.Changing the default is a breaking change.Which means that, instead of making a controlled breaking change with a clear migration path here and now, we are committing every single instance of any user's intent to 'optimise' their libraries (by finalising unnecessarily virtuals) to breaking changes in their ABI - which *will* occur, since virtual is the default.Unstated assumption: "every single instance" assumes again that people interested in writing fast libraries have virtual calls as a major bottleneck, and furthermore they didn't care about speed to start with, to wake up later. This pictures library designers as quite incompetent people.According to semantic versioning, this requires bumping the major version number... that's horrible!Appeal to emotion.What's better; implementing a controlled deprecation path now, or leaving it up to any project that ever uses the 'class' keyword to eventually confront breaking changes in their API when they encounter a performance oriented customer?It's better to leave things be. All I see is the same anecdote gets vividly told again whenever the topic comes up. Andrei
Mar 12 2014
On 13 March 2014 03:47, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org>wrote:On 3/11/14, 8:04 PM, Manu wrote:*sigh* I'll just remind that in regard to this particular point which soundsI'm really trying to keep my lid on here...Yep, here we go again :o).Do you think the deprecation path is particularly disruptive? It can be implemented over a reasonably long time. virtual-by-default is incompatible with optimisation, and it's reliablereasonable, it's easy to forgot that *all library code where the author didn't care* is now unusable by anybody who does. The converse would not be true if the situation was reversed.There's an asymmetry introduced by the fact there's today code in use.I completely disagree with the everything-should-be-virtual idea in principle; I think it's dangerous and irresponsible API design, but that's my opinion. Whether you are into that or not, I see it as a design decision, and I think it's reasonable to make that decision explicit by typing 'virtual:'. What's not subjective, is that the optimiser can't optimise virtual-by-default. That's just a fact, and one which I care about deeply. I think it's also statistically reliable that people will stick with the default in almost all cases. Unstated assumption: "many potential useful libraries" assumes manyto assume that anybody who doesn't explicitly care about this will stick with the default, which means many potentially useful libraries may be eliminated for use by many customers.Virtual by default is, however, compatible with customization and flexibility.libraries use traditional OO design in their core components.In my experience; physics, sound, scene graph... these sorts of things are common libraries, and also heavy users of OO. Each of those things are broken into small pieces implemented as many objects. If people then make use of properties, we're in a situation which is much worse than what we already struggle with in C++. Unstated assumption: "many customers". Do I need to quantify? I work in a gigantic industry. You might call it niche, but it's like, really, really big. I often attend an annual conference called GDC which attracts multiple 10s of thousands of developers each year. It's probably the biggest software developer conference in the world. A constantly recurring theme at those conferences is low-level performance on embedded hardware, and specifically, the mistakes that PC developers make when first moving to embedded architectures. There's a massive audience for these topics, because everyone is suffering the same problems. Virtual is one of the most expensive hazards, just not on x86. Most computers in the world today don't run x86 processors. Also, as discussed at length, revoking virtual from a function is aYes, but there is an opportunity for a smooth transition and elimination of the problem, rather than committing to consistent recurrence of breaking libraries in the future whenever anyone wants to optimise in this way. Which means that, instead ofbreaking change, adding virtual is not.Changing the default is a breaking change.YES! This is absolutely my professional experience! I've repeated this many times. Many(/most) libraries I've wanted to use in the past are written for a PC; rarely any real consideration for low-level performance. Those that are tested for cross-compiling are often _originally_ written for a PC; API is architecturally pre-disposed to poor performance. This is precisely the sort of thing that library authors don't care about until some subset of customers come along that do. At that point, they are faced with a conundrum; breaking the API or ignoring the minority - which can often take years to resolve, meanwhile buggering up our schedule or wasting our time re-inventing some wheel. PC programmers are careless programmers on average. Because x86 is the most tolerant architecture WRT low-level performance by far, unless library authors actively test their software on a wide variety of machines, they have no real bearing to judge their code. According to semantic versioning, this requires bumping the majormaking a controlled breaking change with a clear migration path here and now, we are committing every single instance of any user's intent to 'optimise' their libraries (by finalising unnecessarily virtuals) to breaking changes in their ABI - which *will* occur, since virtual is the default.Unstated assumption: "every single instance" assumes again that people interested in writing fast libraries have virtual calls as a major bottleneck, and furthermore they didn't care about speed to start with, to wake up later. This pictures library designers as quite incompetent people.Bumping major version numbers is not an emotional expression. People take semantic versioning very seriously. What's better; implementing a controlled deprecation path now, orversion number... that's horrible!Appeal to emotion.Whatever.leaving it up to any project that ever uses the 'class' keyword to eventually confront breaking changes in their API when they encounter a performance oriented customer?It's better to leave things be. All I see is the same anecdote gets vividly told again whenever the topic comes up.
Mar 12 2014
On Tuesday, 11 March 2014 at 18:35:57 UTC, Dicebot wrote:On Tuesday, 11 March 2014 at 18:29:35 UTC, Steve Teale wrote:Have a link to where that was decided? I was under the impression that virtual was accepted as a compromise so people could just stick "final:" at the top of their classes have have something acceptably close to final-by-default. I can't remember if I actually managed to keep up with that behemoth of a thread though.On Tuesday, 11 March 2014 at 18:14:52 UTC, Steven Schveighoffer wrote:Not in 2.065 2.066 will introduce "virtual" keyword 2.067+ will change the defaults if it will still be considered good ideaOn Tue, 11 Mar 2014 13:47:55 -0400, Steve TealeFunctions final by default? I read the list of changes for 2.065, and that one got by me completely. Aargh!
Mar 11 2014
On Tue, 11 Mar 2014 17:35:20 -0400, Brad Anderson <eco gnuk.net> wrote:On Tuesday, 11 March 2014 at 18:35:57 UTC, Dicebot wrote:It was buried in that thread. Here is a bugzilla issue that links to Walter's post. I wasn't aware until recently. Re-reading the thread where Walter agreed, I can't find a clear response from Andrei that he was in agreement or not, but I suspect not (especially after reading his responses here). https://d.puremagic.com/issues/show_bug.cgi?id=11616 Perhaps the feature should be put on hold for now? Haven't heard Walter re-affirm his position. -SteveNot in 2.065 2.066 will introduce "virtual" keyword 2.067+ will change the defaults if it will still be considered good ideaHave a link to where that was decided? I was under the impression that virtual was accepted as a compromise so people could just stick "final:" at the top of their classes have have something acceptably close to final-by-default. I can't remember if I actually managed to keep up with that behemoth of a thread though.
Mar 11 2014
On Tuesday, 11 March 2014 at 21:46:05 UTC, Steven Schveighoffer wrote:It was buried in that thread. Here is a bugzilla issue that links to Walter's post. I wasn't aware until recently. Re-reading the thread where Walter agreed, I can't find a clear response from Andrei that he was in agreement or not, but I suspect not (especially after reading his responses here). https://d.puremagic.com/issues/show_bug.cgi?id=11616 Perhaps the feature should be put on hold for now? Haven't heard Walter re-affirm his position. -SteveThere is also actual pull request (which I can't link right now because github is down for me). What I have listed is summary of plans from that bugzilla entry and PR at point where Walter has agreed. Recently Andrei has noticed merged PR and objected to it so what will happen next is unclear.
Mar 11 2014
PR: https://github.com/D-Programming-Language/dmd/pull/2895
Mar 11 2014
On Tue, 11 Mar 2014 17:35:20 -0400, Brad Anderson <eco gnuk.net> wrote:Have a link to where that was decided? I was under the impression that virtual was accepted as a compromise so people could just stick "final:" at the top of their classes have have something acceptably close to final-by-default. I can't remember if I actually managed to keep up with that behemoth of a thread though.BTW, I'm somewhat amused that this was as unknown to everyone else as it was to me. I figured because I was away from D for 6 months, I just missed it and everyone was OK with it :) Didn't mean to start another firestorm! -Steve
Mar 11 2014
On Tuesday, 11 March 2014 at 21:47:19 UTC, Steven Schveighoffer wrote:BTW, I'm somewhat amused that this was as unknown to everyone else as it was to me. I figured because I was away from D for 6 months, I just missed it and everyone was OK with it :) Didn't mean to start another firestorm! -SteveI only know it because I am subscribed to all activity in dmd repo :)
Mar 11 2014
Brad Anderson:Have a link to where that was decided? I was under the impression that virtual was accepted as a compromise so people could just stick "final:" at the top of their classes have have something acceptably close to final-by-default.I have seen D code in the wild where all member functions are virtual, impure and most variables are mutable. Programmers often stick to defaults, even when they are not the best choice. Virtual functions are functions with some extra functionality. When the programmer needs it, he/she/shi asks for it. When it's not needed, the programmer often sticks with what defaults the language designers have chosen. Bye, bearophile
Mar 11 2014
Steven Schveighoffer píše v Út 11. 03. 2014 v 14:14 -0400:Consider how long Walter resisted the call to make functions final by default, until he suddenly switched sides. I think of it like a dictatorship with 1000 advisors. And no death squads :)What is the current status of this?
Mar 11 2014
On 3/11/14, 11:24 AM, Daniel Kozák wrote:Steven Schveighoffer píše v Út 11. 03. 2014 v 14:14 -0400:I am opposed to making functions final by default. AndreiConsider how long Walter resisted the call to make functions final by default, until he suddenly switched sides. I think of it like a dictatorship with 1000 advisors. And no death squads :)What is the current status of this?
Mar 11 2014
On Tuesday, 11 March 2014 at 20:16:50 UTC, Andrei Alexandrescu wrote:On 3/11/14, 11:24 AM, Daniel Kozák wrote:Because of the breakage, or because you think virtual-by-default makes more sense?Steven Schveighoffer píše v Út 11. 03. 2014 v 14:14 -0400:I am opposed to making functions final by default.Consider how long Walter resisted the call to make functions final by default, until he suddenly switched sides. I think of it like a dictatorship with 1000 advisors. And no death squads :)What is the current status of this?
Mar 11 2014
On 3/11/14, 1:18 PM, Vladimir Panteleev wrote:On Tuesday, 11 March 2014 at 20:16:50 UTC, Andrei Alexandrescu wrote:A combination of both. The change would break a lot of code and it seems to me final vs. virtual by default is a judgment call more than an obvious decision in favor of final. That said, if I'd do things over again I'd advocate final by default. But we're not doing things over again. AndreiOn 3/11/14, 11:24 AM, Daniel Kozák wrote:Because of the breakage, or because you think virtual-by-default makes more sense?Steven Schveighoffer píše v Út 11. 03. 2014 v 14:14 -0400:I am opposed to making functions final by default.Consider how long Walter resisted the call to make functions final by default, until he suddenly switched sides. I think of it like a dictatorship with 1000 advisors. And no death squads :)What is the current status of this?
Mar 11 2014
On Tuesday, 11 March 2014 at 20:23:59 UTC, Andrei Alexandrescu wrote:On 3/11/14, 1:18 PM, Vladimir Panteleev wrote:You do support the introduction of the virtual keyword though, yes?On Tuesday, 11 March 2014 at 20:16:50 UTC, Andrei Alexandrescu wrote:A combination of both. The change would break a lot of code and it seems to me final vs. virtual by default is a judgment call more than an obvious decision in favor of final. That said, if I'd do things over again I'd advocate final by default. But we're not doing things over again. AndreiOn 3/11/14, 11:24 AM, Daniel Kozák wrote:Because of the breakage, or because you think virtual-by-default makes more sense?Steven Schveighoffer píše v Út 11. 03. 2014 v 14:14 -0400:I am opposed to making functions final by default.Consider how long Walter resisted the call to make functions final by default, until he suddenly switched sides. I think of it like a dictatorship with 1000 advisors. And no death squads :)What is the current status of this?
Mar 11 2014
On 3/11/14, 1:45 PM, John Colvin wrote:On Tuesday, 11 March 2014 at 20:23:59 UTC, Andrei Alexandrescu wrote:If explained a good use case, I would. AndreiOn 3/11/14, 1:18 PM, Vladimir Panteleev wrote:You do support the introduction of the virtual keyword though, yes?On Tuesday, 11 March 2014 at 20:16:50 UTC, Andrei Alexandrescu wrote:A combination of both. The change would break a lot of code and it seems to me final vs. virtual by default is a judgment call more than an obvious decision in favor of final. That said, if I'd do things over again I'd advocate final by default. But we're not doing things over again. AndreiOn 3/11/14, 11:24 AM, Daniel Kozák wrote:Because of the breakage, or because you think virtual-by-default makes more sense?Steven Schveighoffer píše v Út 11. 03. 2014 v 14:14 -0400:I am opposed to making functions final by default.Consider how long Walter resisted the call to make functions final by default, until he suddenly switched sides. I think of it like a dictatorship with 1000 advisors. And no death squads :)What is the current status of this?
Mar 11 2014
On 2014-03-11 21:16:28 +0000, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> said:On 3/11/14, 1:45 PM, John Colvin wrote:class Foo { final: void bar(); void baz(); virtual: void crack(); void crunch(); final: void dodge(); void damp(); virtual void divert(); void doh(); } -- Michel Fortin michel.fortin michelf.ca http://michelf.caYou do support the introduction of the virtual keyword though, yes?If explained a good use case, I would.
Mar 11 2014
On 3/11/14, 2:28 PM, Michel Fortin wrote:On 2014-03-11 21:16:28 +0000, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> said:Got it, thanks. If we don't move forward with final by default, this is too little utility to justify adding a keyword. (We could look into making it a contextual keyword.) AndreiOn 3/11/14, 1:45 PM, John Colvin wrote:class Foo { final: void bar(); void baz(); virtual: void crack(); void crunch(); final: void dodge(); void damp(); virtual void divert(); void doh(); }You do support the introduction of the virtual keyword though, yes?If explained a good use case, I would.
Mar 11 2014
On 3/11/2014 2:28 PM, Michel Fortin wrote:class Foo { final: void bar(); void baz(); virtual: void crack(); void crunch(); final: void dodge(); void damp(); virtual void divert(); void doh(); }class Foo { final { void bar(); void baz(); } void crack(); void crunch(); final { void dodge(); void damp(); void divert(); void doh(); } } That said, there's still a case for !final.
Mar 12 2014
On Wednesday, 12 March 2014 at 21:38:03 UTC, Walter Bright wrote:On 3/11/2014 2:28 PM, Michel Fortin wrote:Dat indentation/scoping! It works, but it makes my eyes bleed.class Foo { final: void bar(); void baz(); virtual: void crack(); void crunch(); final: void dodge(); void damp(); virtual void divert(); void doh(); }class Foo { final { void bar(); void baz(); } void crack(); void crunch(); final { void dodge(); void damp(); void divert(); void doh(); } }
Mar 12 2014
Walter Bright:That said, there's still a case for !final.It looks bad :-( int foo() nothrow { return 0; } int bar() !throw { return 0; } Bye, bearophile
Mar 12 2014
13-Mar-2014 02:02, bearophile пишет:Walter Bright:~nothrow -- Dmitry OlshanskyThat said, there's still a case for !final.It looks bad :-( int foo() nothrow { return 0; } int bar() !throw { return 0; } Bye, bearophile
Mar 12 2014
On Wednesday, 12 March 2014 at 21:38:03 UTC, Walter Bright wrote:On 3/11/2014 2:28 PM, Michel Fortin wrote:With that in mind you can also claim that system <-> safe and public <-> private are redundant. Let us make public default and remove the public keyword: ---- class Foo { private { } //public stuff private { } } ---- Same with safe/ system ;) Long story short: It should always exist the opposite of a keyword meaning, to interrupt it.class Foo { final: void bar(); void baz(); virtual: void crack(); void crunch(); final: void dodge(); void damp(); virtual void divert(); void doh(); }class Foo { final { void bar(); void baz(); } void crack(); void crunch(); final { void dodge(); void damp(); void divert(); void doh(); } }
Mar 12 2014
On Wednesday, 12 March 2014 at 21:38:03 UTC, Walter Bright wrote:On 3/11/2014 2:28 PM, Michel Fortin wrote:I was thinking about ~final, but yes, we need some way to get out of qualifiers like final, override, pure, nothrow, ...class Foo { final: void bar(); void baz(); virtual: void crack(); void crunch(); final: void dodge(); void damp(); virtual void divert(); void doh(); }class Foo { final { void bar(); void baz(); } void crack(); void crunch(); final { void dodge(); void damp(); void divert(); void doh(); } } That said, there's still a case for !final.
Mar 12 2014
On Wed, 12 Mar 2014 17:38:10 -0400, Walter Bright <newshound2 digitalmars.com> wrote:On 3/11/2014 2:28 PM, Michel Fortin wrote:Fixed it for you. class Foo { final { void bar(); void baz(); } void crack(); void crunch(); final { void dodge(); void damp(); } void divert(); final void doh(); } -Steveclass Foo { final: void bar(); void baz(); virtual: void crack(); void crunch(); final: void dodge(); void damp(); virtual void divert(); void doh(); }class Foo { final { void bar(); void baz(); } void crack(); void crunch(); final { void dodge(); void damp(); void divert(); void doh(); } } That said, there's still a case for !final.
Mar 13 2014
"Walter Bright" wrote in message news:lfqk3r$1rq$1 digitalmars.com...class Foo { final { void bar(); void baz(); } void crack(); void crunch(); final { void dodge(); void damp(); void divert(); void doh(); } } That said, there's still a case for !final.This looks much worse with all the method bodies still in there.
Mar 13 2014
"Andrei Alexandrescu" wrote in message news:531F70ED.3040304 erdani.org... On 3/11/14, 1:18 PM, Vladimir Panteleev wrote:A combination of both. The change would break a lot of code and it seems to me final vs. virtual by default is a judgment call more than an obvious decision in favor of final. That said, if I'd do things over again I'd advocate final by default. But we're not doing things over again. AndreiFWIW this is exactly where I was back before dconf13. I was convinced when I realized that: - It is impossible for the optimizer to achieve the same performance in all cases thanks to dynamic linking - Linking with C++ usually requires marking _almost_ every method with 'final' - Only the introducing virtual methods need to be changed, so the breakage is actually very small and trivially handled So after 5 minutes of adding 'virtual' where the compiler tells me to, I can delete a whole bunch of cruft from my code and keep the same performance. (Note that those 5 minutes can be done at your leisure over the years it takes for this to progress through the deprecation stages)
Mar 12 2014
On 3/12/14, 5:20 AM, Daniel Murphy wrote:- Only the introducing virtual methods need to be changed, so the breakage is actually very small and trivially handledMost breakages are very small and trivially handled. That's not the point. Andrei
Mar 12 2014
Andrei Alexandrescu:Most breakages are very small and trivially handled. That's not the point.Unexpected regressions, silent dangerous breakage, safe but hard to fix breakage, and carefully planned breakage that can be trivially handled three are very different cases. Bye, bearophile
Mar 12 2014
On 3/12/14, 10:04 AM, bearophile wrote:Andrei Alexandrescu:That's why I said "most" and not "all". I think we must take final-by-default off the table. Doing so would also make the addition of "virtual" too much a price to pay for the negation of "final". AndreiMost breakages are very small and trivially handled. That's not the point.Unexpected regressions, silent dangerous breakage, safe but hard to fix breakage, and carefully planned breakage that can be trivially handled three are very different cases.
Mar 12 2014
On 2014-03-12 18:07, Andrei Alexandrescu wrote:That's why I said "most" and not "all". I think we must take final-by-default off the table. Doing so would also make the addition of "virtual" too much a price to pay for the negation of "final".There has previously been suggestions of adding syntax turn off/negating attributes. Something like: class Foo { final: !final void foo () {} } -- /Jacob Carlborg
Mar 12 2014
Andrei Alexandrescu:I am opposed to making functions final by default.Walter has agreed to make functions final by default. And this now compiles: class Foo { virtual void bar() {} } void main() {} I think it's a change for the better. Are we changing direction again? Do you want to remove the virtual keyword again? I am confused. Bye, bearophile
Mar 11 2014
On Tuesday, 11 March 2014 at 18:33:16 UTC, Daniel Kozák wrote:Steven Schveighoffer píše v Út 11. 03. 2014 v 14:14 -0400:If he resisted for a long time, it makes little sense to say "he suddenly switched sides". Reviewing the old thread, it looks like Manu's arguments amongst others were convincing that this change is worth it. I have mixed feelings on this topic. I think methods should be final by default, but it is late in the day for these kind of changes, especially given D's unpleasant history with respect to changes. -- BrianConsider how long Walter resisted the call to make functions final by default, until he suddenly switched sides. I think of it like a dictatorship with 1000 advisors. And no death squads :)
Mar 11 2014
On Tuesday, 11 March 2014 at 17:47:56 UTC, Steve Teale wrote:What D needs at this point is a dictator. There are about 30 pages of discussion about Walter's std.array.front post, and Steve S's counter post. It reminds me of the way it was maybe 4 years ago, when there was so much bickering that I just gave up for some time, and went away. Who is going to go through all that stuff, and winnow a compromise out of it. Everyone has a job, or some vital preoccupation with their own project. The buck has to stop somewhere - is it Walter, or Andrei, or can any proposal or comment be stalled by sheer weight of contrary views? This is probably a management issue, not a technical one. Trouble is there's no manager, and even if their was, he'd have no minions. What to do? SteveI like it. :) It's Walter's project and he solicited opinions. Maybe they change his mind, maybe they don't. In this case, it appears they did: he seems to have decided that the breakage wouldn't be worth the speedup. What would you prefer, that Walter The Dictator did it anyway? That's not how communities work. There is no doubt that the buck stops with the core team. If people don't like their decisions, they can and will leave or who knows, fork. If you want someone willing to go against the grain, I have seen others here accuse Walter of being stubborn in the past. I don't think you can say he simply goes with the crowd. ;) I will agree with you on one point though. It's not particularly clear to an outsider what the decision-making process is with D, ie what the deliberative process is and who ultimately decides. If you've been around long enough and check the github pull requests and commits, you can get a sense of it, but the roles are not really defined. I understand most open-source projects work this way, but D is probably big enough now that some exposition is helpful. I think it'd be nice to have a page on dlang.org, whether on the main site or the wiki, that laid out who the core team is, sort of like a masthead in a magazine, with a paragraph or two about each person. This would give newcomers some bearings on who the core team is, what their roles are, and what they do for the project. I'm sure anyone could figure all this out on their own eventually, with enough time spent on the newsgroup and looking at source commits, but the idea is to save them some time. Just my suggestion.
Mar 11 2014
11-Mar-2014 21:47, Steve Teale пишет:This is probably a management issue, not a technical one. Trouble is there's no manager, and even if their was, he'd have no minions.Good management hardly ever won a contest in design. -- Dmitry Olshansky
Mar 11 2014
On Tuesday, 11 March 2014 at 17:47:56 UTC, Steve Teale wrote:What D needs at this point is a dictator. There are about 30 pages of discussion about Walter's std.array.front post, and Steve S's counter post. It reminds me of the way it was maybe 4 years ago, when there was so much bickering that I just gave up for some time, and went away. Who is going to go through all that stuff, and winnow a compromise out of it. Everyone has a job, or some vital preoccupation with their own project. The buck has to stop somewhere - is it Walter, or Andrei, or can any proposal or comment be stalled by sheer weight of contrary views? This is probably a management issue, not a technical one. Trouble is there's no manager, and even if their was, he'd have no minions. What to do? SteveIt already works that way. Only thing is not obvious is actual decision point as it is rarely announced. And as any such topic is inherently controversial, making decision that satisfies everyone is rarely possible and debates often continue even after decision point. To be honest I think real problem is directly the opposite - decision process is too vague and limited by the bottleneck of Andrei & Walter participation. Making it more distributed and formalized can help - and this is more of a technical/tooling issue.
Mar 11 2014
On Tuesday, 11 March 2014 at 19:27:40 UTC, Dicebot wrote:It already works that way. Only thing is not obvious is actual decision point as it is rarely announced. And as any such topic is inherently controversial, making decision that satisfies everyone is rarely possible and debates often continue even after decision point. To be honest I think real problem is directly the opposite - decision process is too vague and limited by the bottleneck of Andrei & Walter participation. Making it more distributed and formalized can help - and this is more of a technical/tooling issue.I tend to agree with you. Someone once pointed out that we should set goals for release. Hence, Walter said we should emphasize on ICE for 2.064, and from what I know it turned out to be a good idea. AFAIK no such thing was done for 2.065, neither for DMD or Phobos (or I missed it). For example, you can see that the stream API is quite old and needs replacement: http://dlang.org/library/index.html However, I didn't see anything related to the deprecation, the why and what's needed, neither in the bugzilla (searched both 'stream' and 'std.stream') nor in the DIPs.
Mar 11 2014
Mathias LANG:However, I didn't see anything related to the deprecation, the why and what's needed, neither in the bugzilla (searched both 'stream' and 'std.stream') nor in the DIPs.Please add it to bugzilla. Bye, bearophile
Mar 11 2014
On 3/11/2014 10:47 AM, Steve Teale wrote:What D needs at this point is a dictator.http://www.youtube.com/watch?v=poDaTeyqIm4
Mar 11 2014
On Tuesday, 11 March 2014 at 20:43:07 UTC, Walter Bright wrote:On 3/11/2014 10:47 AM, Steve Teale wrote:Ace Walter - how do you find the time? I believe that you are becoming truly benevolent as you grow older ;=)What D needs at this point is a dictator.http://www.youtube.com/watch?v=poDaTeyqIm4
Mar 12 2014
On 3/12/2014 12:03 AM, Steve Teale wrote:Ace Walter - how do you find the time? I believe that you are becoming truly benevolent as you grow older ;=)I rely on the fresh blood of unborn kittens.
Mar 12 2014
On Wednesday, 12 March 2014 at 23:53:52 UTC, Walter Bright wrote:I rely on the fresh blood of unborn kittens.I must try it. Sadly our youngest cat has disappeared over about 4 days now, and we're feeling worried.
Mar 13 2014
On Tuesday, 11 March 2014 at 17:47:56 UTC, Steve Teale wrote:What D needs at this point is a dictator. There are about 30 pages of discussion about Walter's std.array.front post, and Steve S's counter post. It reminds me of the way it was maybe 4 years ago, when there was so much bickering that I just gave up for some time, and went away. Who is going to go through all that stuff, and winnow a compromise out of it. Everyone has a job, or some vital preoccupation with their own project. The buck has to stop somewhere - is it Walter, or Andrei, or can any proposal or comment be stalled by sheer weight of contrary views? This is probably a management issue, not a technical one. Trouble is there's no manager, and even if their was, he'd have no minions. What to do? SteveI think the only thing lacking—and some people already alluded to this—is a formalized DIP process that results in acceptance or rejection. The DIPs are kind of becoming an idea graveyard. The long community discussions are just a sign of a health community trying to address hard problems with no clear right or wrong answer. I'm happy with the leadership roles D has. They tend to only step in on serious matters, not little disagreements over design decisions that don't affect the big picture. A much more heavy handed approach would probably alienate the community. http://wiki.dlang.org/DIPs
Mar 11 2014
On Tuesday, 11 March 2014 at 17:47:56 UTC, Steve Teale wrote:What D needs at this point is a dictator. There are about 30 pages of discussion about Walter's std.array.front post, and Steve S's counter post. It reminds me of the way it was maybe 4 years ago, when there was so much bickering that I just gave up for some time, and went away. Who is going to go through all that stuff, and winnow a compromise out of it. Everyone has a job, or some vital preoccupation with their own project. The buck has to stop somewhere - is it Walter, or Andrei, or can any proposal or comment be stalled by sheer weight of contrary views? This is probably a management issue, not a technical one. Trouble is there's no manager, and even if their was, he'd have no minions. What to do? SteveI started trying to use D a few years ago and also had to take a long hiatus due to frustration with its quality of implementation. But having come back to it a little over a year ago I think it is now generally useable and ready for the final polishing effort needed to make it into a professional product. A lot of that success I feel is due to the good leadership of Walter and Andrei. Even though they are the "dictators" so to speak of the language, they are very open to discussion and have good taste when it comes to what to include in the language. I learn a lot from the forums and appreciate being able to discuss things with those involved in developing the language. Still something needs to happen to get D to the next million people. The current grassroots structure has served D well. And I think its legacy should continue forward no matter what form D's development takes. But along with its current set of developers I think that D really needs some solid financial support. In particular, I think that there needs to be a good group of full-time developers on the payroll to kick its development into high gear. I have no ability to organize such an effort, pay for it, or even join as a developer. But whatever could be done to get funded development into action would be well worth it in my opinion. I fear that without such an organized effort the promise that D currently holds may fade into niche irrelevance as time passes on. When I saw the talks scheduled for Dconf 2014 "Opening Keynote: State of the struct address" by Andrei and "Keynote: The Last Thing D Needs" by Scott Meyers I was hoping that perhaps this will be announced as something already in the works. Not sure what that conference will bring. But would be pretty cool if so. Joseph
Mar 11 2014
On 3/11/14, Steve Teale <steve.teale britseyeview.com> wrote:What D needs at this point is a dictator.You see these massive protests and overthrows of people who hold absolute power around the world, and you think D needs a dictator. I'm really baffled at some people.
Mar 13 2014