digitalmars.D - Phobos - breaking existing code
- Walter Bright (11/11) Nov 28 2014 Just for fun, I've decided to try and get MicroEmacs in D added to the d...
- ketmar via Digitalmars-d (13/27) Nov 28 2014 b=20
- Brad Roberts via Digitalmars-d (3/6) Nov 28 2014 I don't understand this attitude. Don't wait for any sort of gold star ...
- Daniel Murphy (2/13) Nov 28 2014 Two years is too old, you skipped all the deprecation stages.
- Walter Bright (5/6) Nov 28 2014 My favorite unhelpful message:
- Daniel Murphy (5/12) Nov 28 2014 I don't know the history on that one, but why did you go straight to the...
- Walter Bright (2/16) Nov 28 2014 Can't tell users to do that. It's not reasonable.
- Daniel Murphy (2/3) Nov 28 2014 I don't see why not.
- ketmar via Digitalmars-d (4/9) Nov 28 2014 they will lose all the fun figuring out what that code was meant to do
- bearophile (7/8) Nov 28 2014 A possible solution: in the standard D distribution you put two
- Daniel Murphy (3/7) Nov 28 2014 Why not just tell people to use dvm? No reason to make the release zip ...
- H. S. Teoh via Digitalmars-d (12/20) Nov 28 2014 [...]
- bearophile (7/19) Nov 28 2014 The point of my answer is that I think the problem raised by
- Walter Bright (2/4) Nov 28 2014 Yes, it can be.
- Walter Bright (7/11) Nov 28 2014 1. renaming things to the latest fashion is an illusion of progress, not...
- bearophile (12/19) Nov 28 2014 A solution is to leave @deprected stuff for 2-5 years in Phobos
- Walter Bright (8/14) Nov 28 2014 That's largely speculation. I doubt there's an objective case that "glob...
- Mike (16/21) Nov 28 2014 Ensuring 2 year old code compiles is easily managed by keeping a
- Walter Bright (3/9) Nov 28 2014 Changing names makes the situation worse by consuming scarce resources.
- Mike (8/9) Nov 28 2014 I was referring to (breaking) changes in general.
- bearophile (52/59) Nov 29 2014 Changing names make the language/library better, and this can
- Vic (3/8) Nov 29 2014 ouch.
- ketmar via Digitalmars-d (20/24) Nov 28 2014 same for me. i was gently pushing our development team towards D (heh,
- Walter Bright (2/8) Nov 28 2014 Please list your top two or three.
- ketmar via Digitalmars-d (23/32) Nov 28 2014 top one, after which i vetoed D: issue #13670
- Mike (8/15) Nov 28 2014 Walter, I want you to know, that I love D. It is an awesome
- Walter Bright (8/13) Nov 28 2014 Actually, we've (myself and 3 others) been hard at work preparing a scop...
- ketmar via Digitalmars-d (17/19) Nov 28 2014 less=20
- ketmar via Digitalmars-d (2/2) Nov 28 2014 dammit, my English sux even worse when i trying to say something
- Walter Bright (2/4) Nov 28 2014 No prob, I understand you just fine!
- Paolo Invernizzi (5/11) Nov 29 2014 That's a very good news.
- Vic (3/8) Nov 29 2014 Agree.
- H. S. Teoh via Digitalmars-d (34/54) Nov 28 2014 mean, I have C/C++ projects dating from 20 years ago, and you wouldn't
- Daniel Murphy (10/28) Nov 28 2014 I don't think it's reasonable to support those expectations in phobos. ...
- Jonathan M Davis via Digitalmars-d (48/49) Nov 30 2014 That's pretty much the long and short of it. The deprecation cycle for s...
- "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= (10/10) Nov 30 2014 You probably have realized that the obvious solution to breakage
- H. S. Teoh via Digitalmars-d (6/19) Nov 30 2014 This wouldn't help Walter's original problem. He was taking code written
- "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= (7/10) Nov 30 2014 I assumed he meant to make a forward looking statement, i.e. how
- H. S. Teoh via Digitalmars-d (23/41) Nov 30 2014 FWIW, I have C++ code dating from 10 years ago that still compiles with
- Walter Bright (21/28) Nov 30 2014 Yup. Consider the fnmatch => globMatch change. Just edit the name, right...
- H. S. Teoh via Digitalmars-d (11/18) Nov 30 2014 [...]
- Walter Bright (8/23) Nov 30 2014 Why not?
- bearophile (12/19) Dec 01 2014 The existing feature to be used is @deprecated, it's more
- Jonathan M Davis via Digitalmars-d (10/18) Dec 01 2014 The primary difference is that deprecated symbols are still usable, wher...
- bearophile (6/8) Dec 01 2014 Right, sorry, I meant disabled.
- Jonathan M Davis via Digitalmars-d (6/12) Dec 01 2014 I agree. I do think that we should strive for stability and backwards
- Wyatt (15/25) Dec 01 2014 Thinking along these lines, would it be possible to have
- Walter Bright (4/9) Dec 01 2014 Not exactly what you suggest, but:
- H. S. Teoh via Digitalmars-d (11/25) Dec 01 2014 [...]
- Walter Bright (2/8) Dec 01 2014 That is inventing a new feature.
- Dicebot (5/7) Dec 04 2014 Really laughed here. dstep got broken when going from 2.065 to
- ketmar via Digitalmars-d (5/22) Nov 30 2014 wrote:
- Jacob Carlborg (5/9) Dec 01 2014 $ git log -S 'fnmatch'
- Walter Bright (2/9) Dec 01 2014 I didn't know that. Thanks for the tip!
- Jacob Carlborg (5/11) Dec 01 2014 That doesn't work for virtual methods. Although I think they are quite
- Steven Schveighoffer (27/59) Dec 01 2014 I propose a new feature:
- bearophile (5/6) Nov 28 2014 I agree. D has to come back to the living. It looks like D is
- weaselcat (7/13) Nov 28 2014 As much as I like D, hibernating is a very kind way to put it.
- Vic (3/5) Nov 29 2014 Immutable as default sounds good (in core)
- Walter Bright (2/3) Nov 29 2014 I have no idea what you're talking about.
- bearophile (15/19) Nov 29 2014 In the last several years the development of D/Phobos didn't keep
- "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= (19/24) Nov 29 2014 I got very happy when Walter announced "@nogc" and his intent to
- bearophile (19/34) Nov 29 2014 Those "scripting" needs are real, and rather common. Those high
- "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= (57/74) Nov 29 2014 "scripting" needs depend on the application area, the core
- Vic (7/25) Nov 29 2014 On Saturday, 29 November 2014 at 14:40:47 UTC, Ola Fosheim
- Vic (5/16) Nov 29 2014 On Saturday, 29 November 2014 at 11:56:31 UTC, Ola Fosheim
- H. S. Teoh via Digitalmars-d (24/42) Nov 29 2014 Huh??! I *really* don't know what you're talking about, because in the
- bearophile (5/9) Nov 29 2014 OK, if I was mistaken then I am happy ::) Sometimes it's good to
- Andrei Alexandrescu (10/14) Dec 01 2014 Might be because my participation has been scarce lately (busy with work...
- Sean Kelly (3/5) Dec 01 2014 The User-Agent header would be a good place to start.
- Martin Nowak (4/6) Dec 01 2014 We should probably do something to identify all the downloads
- MattCoder (10/13) Dec 01 2014 One note about this: I'm using D in my projects since last year,
- Rikki Cattermole (5/24) Dec 01 2014 Just a thought but, its pretty close to end of year. Projects
- Walter Bright (2/5) Dec 01 2014 In many organizations, nothing happens from Thanksgiving to the New Year...
- Rikki Cattermole (5/12) Dec 01 2014 I guess things are a little different here in New Zealand, but then
- Matt Soucy (10/22) Dec 02 2014 in different hemisphere.
-
Vic
(25/28)
Nov 29 2014
- H. S. Teoh via Digitalmars-d (50/65) Nov 28 2014 I think we may have been a little trigger-happy in implementing the
- Walter Bright (11/17) Nov 28 2014 And, when they are removed for good, there needs to be section in the ph...
- Daniel Murphy (4/7) Nov 28 2014 I think @disabled with a custom message would be perfect for this. stat...
- Martin Nowak (4/6) Nov 29 2014 We just need someone to implement this.
- Daniel Murphy (4/6) Nov 29 2014 Exactly. I've had a look at it a couple of times but never made it past...
- ketmar via Digitalmars-d (3/10) Nov 29 2014 and then it will rot in bugzilla forever.
- bearophile (5/6) Nov 29 2014 Not necessarily. Some things rot there, but I've seen hundreds of
- ketmar via Digitalmars-d (3/9) Nov 29 2014 this one is not pre-approved, so it will not get any attention.
- ketmar via Digitalmars-d (27/34) Nov 28 2014 ubber stamp ticker tape=20
- Mike (24/36) Nov 28 2014 Only 12? That's pretty damn good.
- Walter Bright (2/9) Nov 28 2014 It's a pretty small program, 5000 lines.
- bearophile (5/6) Nov 28 2014 There's a pull in need of some love, I'd like to see this in D:
- ketmar via Digitalmars-d (4/10) Nov 28 2014 it needs just some cosmetix changes (afair) and that's all. i'm using
- H. S. Teoh via Digitalmars-d (7/18) Nov 28 2014 I'd like to see this in D too. AFAICT, everybody else has approved it,
- ketmar via Digitalmars-d (9/28) Nov 28 2014 i honestly can't remember. can't diff my version with original patch
- Walter Bright (6/6) Nov 28 2014 This is more of an Ubuntu-y issue, but I'm having trouble getting it to ...
- H. S. Teoh via Digitalmars-d (7/17) Nov 28 2014 Hmm. Did you install libncurses5-dev (or libncursesw5-dev)? If not, try
- Walter Bright (3/6) Nov 29 2014 Yeah, that didn't work, either.
- ketmar via Digitalmars-d (4/12) Nov 29 2014 hm. it took me ~30 minutes to fix all the warnings and build it
- ketmar via Digitalmars-d (4/12) Nov 29 2014 ah, yes, i'm lazy, so i ripped off ^Z and one scrolling optimisation.
- H. S. Teoh via Digitalmars-d (12/20) Nov 29 2014 Haha... obviously you haven't seen Adam Ruppe's excellent terminal.d
- ketmar via Digitalmars-d (11/20) Nov 28 2014 ink=20
- ketmar via Digitalmars-d (3/6) Nov 28 2014 no need to do that, D doesn't use C ncurses headers.
- Brad Anderson (17/23) Nov 29 2014 With every new release of Visual Studio I expect things to break.
- Paolo Invernizzi (5/7) Nov 29 2014 I've lost my faith in expecting to see the D core team grasp what
- Vic (3/12) Nov 29 2014 Yup.
- Andrej Mitrovic via Digitalmars-d (11/13) Nov 29 2014 You seem to create this kind of thread every other month. People
- Walter Bright (2/14) Nov 29 2014 Since I participate in that process, I am hardly unaware of it :-)
- David Soria Parra (7/19) Nov 29 2014 To be fair, this is already a minor annoyance between every DMD
- Kapps (7/19) Nov 29 2014 Why are deprecated aliases even removed in the first place? Is
- H. S. Teoh via Digitalmars-d (17/39) Nov 29 2014 Yeah we should keep deprecated aliases around for much longer than we
- Walter Bright (3/8) Nov 29 2014 Aliases that resolve to the same symbol was a bug fixed long ago. If thi...
- H. S. Teoh via Digitalmars-d (5/14) Nov 29 2014 Ah, so I'm outdated. That's good to know. :-)
- Tobias Pankrath (11/23) Nov 30 2014 I've just made xmlp (http://www.dsource.org/projects/xmlp)
- H. S. Teoh via Digitalmars-d (15/26) Nov 30 2014 I thought dlang.org already has a page that lists language & library
- Walter Bright (3/7) Nov 30 2014 I decided to try and update DMDScript from D1 to D2. Thousands and thous...
- Dmitry Olshansky (12/19) Nov 30 2014 Even back in 2010 it took about 10 evenings to get it to "runnable"
- Walter Bright (5/23) Nov 30 2014 Wow, I didn't know you'd done this. I'll check it out.
- Walter Bright (3/21) Nov 30 2014 Do you mind if I simply merge your fork into
- Dmitry Olshansky (4/34) Nov 30 2014 Not at all, in fact, that would be awesome.
- bearophile (7/9) Nov 30 2014 It's not just the errors, it's also the new features and
- Walter Bright (3/9) Nov 30 2014 I'm aware that D2 offers many opportunities to improve the code :-)
- bearophile (36/38) Nov 30 2014 One problem I am seeing is that there is a large distance from
- weaselcat (2/4) Nov 30 2014 I suggest everything be made immutable by default ;)
- bearophile (14/18) Nov 30 2014 Currently D doesn't have a keyword as "mut" or "mutable" so if
- Jonathan M Davis via Digitalmars-d (6/7) Nov 30 2014 That probably would have been too much of a divergence from D's C/C++ ro...
- H. S. Teoh via Digitalmars-d (7/15) Nov 30 2014 [...]
- H. S. Teoh via Digitalmars-d (11/19) Nov 30 2014 Well... upgrading from C to C++ involves... close to zero error
- Jacob Carlborg (10/16) Dec 01 2014 We have only had that for a couple of releases and not the latest
- Joseph Rushton Wakeling via Digitalmars-d (14/19) Nov 30 2014 It's fair to say that 2 years is a long time in recent Phobos developmen...
- Jonathan M Davis via Digitalmars-d (25/44) Dec 01 2014 Yeah, and AFAIK, no one ever managed to convince Walter that that needed...
- Jacob Carlborg (5/16) Dec 01 2014 Every single release since at least DMD 2.050 has broken DWT. Most of
- Walter Bright (5/7) Dec 01 2014 My experience with upgrading old D code, even D1 code, is that language ...
- Jacob Carlborg (5/8) Dec 02 2014 When we're talking about breaking code, I just found this regression:
- Dicebot (13/25) Dec 04 2014 We have deprecation cycle of one year. Expecting unmaintained
Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago. I wound up with at least a dozen references to Phobos names that have disappeared. No corrective action was indicated, just "undefined symbol". I have to go refigure out what the code was trying to do, and go poking through the Phobos documentation to see what will work today. I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old. I fully understand how unfriendly this is to users and how discouraging it can be to have their recently working code shattered and scattered. We need to do a lot better.
Nov 28 2014
On Fri, 28 Nov 2014 15:33:51 -0800 Walter Bright via Digitalmars-d <digitalmars-d puremagic.com> wrote:Just for fun, I've decided to try and get MicroEmacs in D added to the du=b=20registry. The last time it compiled was 2 years ago. =20 I wound up with at least a dozen references to Phobos names that have=20 disappeared. No corrective action was indicated, just "undefined symbol".=I have=20to go refigure out what the code was trying to do, and go poking through =the=20Phobos documentation to see what will work today. =20 I know there's been a lot of "break my code" advocacy lately, but this co=de was=20only 2 years old. =20 I fully understand how unfriendly this is to users and how discouraging i=t can=20be to have their recently working code shattered and scattered. We need t=o do a=20lot better.like, for example, having some tool that will analyze the old code and autofix it/suggest replacement. oh, wait... such tool was suggested years ago and has no signs of "official blessing" until this year's summer! and now it can't fix two-year-old code.
Nov 28 2014
On 11/28/14, 5:39 PM, ketmar via Digitalmars-d wrote:oh, wait... such tool was suggested years ago and has no signs of "official blessing" until this year's summer! and now it can't fix two-year-old code.I don't understand this attitude. Don't wait for any sort of gold star rubber stamp ticker tape parade. If you think something is worth doing, do it.
Nov 28 2014
"Walter Bright" wrote in message news:m5b0p2$1bv4$1 digitalmars.com...Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago. I wound up with at least a dozen references to Phobos names that have disappeared. No corrective action was indicated, just "undefined symbol". I have to go refigure out what the code was trying to do, and go poking through the Phobos documentation to see what will work today. I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old. I fully understand how unfriendly this is to users and how discouraging it can be to have their recently working code shattered and scattered. We need to do a lot better.Two years is too old, you skipped all the deprecation stages.
Nov 28 2014
On 11/28/2014 3:46 PM, Daniel Murphy wrote:Two years is too old, you skipped all the deprecation stages.My favorite unhelpful message: src/med/spawn.d(62): Error: undefined identifier sleep, did you mean template slurp(Types...)(string filename, in char[] format)? Grepping around revealed that sleep() had migrated to core.sys.posix.unistd
Nov 28 2014
"Walter Bright" wrote in message news:m5b2dc$1f4j$1 digitalmars.com...On 11/28/2014 3:46 PM, Daniel Murphy wrote:I don't know the history on that one, but why did you go straight to the latest compiler? Stepping through (some of) the last two years' releases would quite likely have been the same experience, but with better errors from the deprecation stages.Two years is too old, you skipped all the deprecation stages.My favorite unhelpful message: src/med/spawn.d(62): Error: undefined identifier sleep, did you mean template slurp(Types...)(string filename, in char[] format)? Grepping around revealed that sleep() had migrated to core.sys.posix.unistd
Nov 28 2014
On 11/28/2014 4:19 PM, Daniel Murphy wrote:"Walter Bright" wrote in message news:m5b2dc$1f4j$1 digitalmars.com...Can't tell users to do that. It's not reasonable.On 11/28/2014 3:46 PM, Daniel Murphy wrote:I don't know the history on that one, but why did you go straight to the latest compiler? Stepping through (some of) the last two years' releases would quite likely have been the same experience, but with better errors from the deprecation stages.Two years is too old, you skipped all the deprecation stages.My favorite unhelpful message: src/med/spawn.d(62): Error: undefined identifier sleep, did you mean template slurp(Types...)(string filename, in char[] format)? Grepping around revealed that sleep() had migrated to core.sys.posix.unistd
Nov 28 2014
"Walter Bright" wrote in message news:m5b5ma$1hfj$1 digitalmars.com...Can't tell users to do that. It's not reasonable.I don't see why not.
Nov 28 2014
On Sat, 29 Nov 2014 12:04:26 +1100 Daniel Murphy via Digitalmars-d <digitalmars-d puremagic.com> wrote:"Walter Bright" wrote in message news:m5b5ma$1hfj$1 digitalmars.com...=20 =20they will lose all the fun figuring out what that code was meant to do and why they must slurp now.Can't tell users to do that. It's not reasonable.=20 I don't see why not.
Nov 28 2014
Walter Bright:Can't tell users to do that. It's not reasonable.A possible solution: in the standard D distribution you put two or more versions (duplicated) of Phobos (switchable with a compiler switch), so people that don't bother to follow the deprecation cycles can compile even 15 years old D code. Bye, bearophile
Nov 28 2014
"bearophile" wrote in message news:rgoeylyaqzlvtgyafsqj forum.dlang.org...A possible solution: in the standard D distribution you put two or more versions (duplicated) of Phobos (switchable with a compiler switch), so people that don't bother to follow the deprecation cycles can compile even 15 years old D code.Why not just tell people to use dvm? No reason to make the release zip more gigantic.
Nov 28 2014
On Sat, Nov 29, 2014 at 01:11:54AM +0000, bearophile via Digitalmars-d wrote:Walter Bright:[...] The problem with that, is that Phobos often doesn't even compile with the previous release of DMD (or, for that matter, a commit prior to a PR that spans both dmd and Phobos), so it's anyone's guess what an older version of Phobos would do when compiled with a newer compiler. Unless, of course, you maintain the old version enough to keep it compilable with the current compiler. But that's a lot of additional maintenance work. T -- Three out of two people have difficulties with fractions. -- Dirk EddelbuettelCan't tell users to do that. It's not reasonable.A possible solution: in the standard D distribution you put two or more versions (duplicated) of Phobos (switchable with a compiler switch), so people that don't bother to follow the deprecation cycles can compile even 15 years old D code.
Nov 28 2014
H. S. Teoh:The problem with that, is that Phobos often doesn't even compile with the previous release of DMD (or, for that matter, a commit prior to a PR that spans both dmd and Phobos), so it's anyone's guess what an older version of Phobos would do when compiled with a newer compiler. Unless, of course, you maintain the old version enough to keep it compilable with the current compiler. But that's a lot of additional maintenance work.The point of my answer is that I think the problem raised by Walter can't be solved by Phobos/dmd developers. And at the current state of D development trying to solve it will cause more problems (and more wasted efforts) than it can solve. Bye, bearophile
Nov 28 2014
On 11/28/2014 5:29 PM, bearophile wrote:The point of my answer is that I think the problem raised by Walter can't be solved by Phobos/dmd developers.Yes, it can be.
Nov 28 2014
On 11/28/2014 5:42 PM, Walter Bright wrote:On 11/28/2014 5:29 PM, bearophile wrote:1. renaming things to the latest fashion is an illusion of progress, not actual progress, such as fnmatch => globMatch 2. deprecated aliases to the old names can be kept for a long time without causing problems 3. when removed entirely, the documentation for them should be kept along with instructions on corrective actionThe point of my answer is that I think the problem raised by Walter can't be solved by Phobos/dmd developers.Yes, it can be.
Nov 28 2014
Walter Bright:A solution is to leave deprected stuff for 2-5 years in Phobos (but in few cases this is not enough, because some names have changed purpose and signature).Yes, it can be.1. renaming things to the latest fashion is an illusion of progress, not actual progress, such as fnmatch => globMatchYou are wrong. Having good function names is extremely important. Renaming badly named things with more clear and more meaningful names reduces pain for both old and new users, reduces coding time, and in some cases even avoids some troubles.2. deprecated aliases to the old names can be kept for a long time without causing problemsThis is usually true, but not always (see above).3. when removed entirely, the documentation for them should be kept along with instructions on corrective actionI agree. Bye, bearophile
Nov 28 2014
On 11/28/2014 5:57 PM, bearophile wrote:Walter Bright:That's largely speculation. I doubt there's an objective case that "globMatch" is superior to "fnmatch". Not only that, "fnmatch" is a familiar and widely used name across diverse languages. Nobody else uses "globMatch". And all these speculative benefits need to be set against the real costs of nothing compiles that is 2+ years old, the annoyed users, the people who got tired of constant code breakage and left, and the lack of a rich set of libraries because of bit rot.1. renaming things to the latest fashion is an illusion of progress, not actual progress, such as fnmatch => globMatchYou are wrong. Having good function names is extremely important. Renaming badly named things with more clear and more meaningful names reduces pain for both old and new users, reduces coding time, and in some cases even avoids some troubles.
Nov 28 2014
On Saturday, 29 November 2014 at 02:35:16 UTC, Walter Bright wrote:And all these speculative benefits need to be set against the real costs of nothing compiles that is 2+ years old,Ensuring 2 year old code compiles is easily managed by keeping a copy of the tools used to build the code. Upgrade when you have the resources to manage the migration.the annoyed users,Have them see the above comment.the people who got tired of constant code breakage and left,Speculation without measurement. But I'll have you know my usage of D has declined significantly because it is missing features I want/need. It is also for this reason that I have not advocated its usage to my employer. How many users have been lost because they tried it and found it lacking or inefficient, not because of code breakage? I know of 2.and the lack of a rich set of libraries because of bit rot.Yes, D's current business model is not sustainable. It is lacking capable contributors and funds to keep the code maintained. Mike
Nov 28 2014
On 11/28/2014 6:59 PM, Mike wrote:But I'll have you know my usage of D has declined significantly because it is missing features I want/need. It is also for this reason that I have not advocated its usage to my employer. How many users have been lost because they tried it and found it lacking or inefficient, not because of code breakage? I know of 2.I doubt any of that situation is improved by changing names.It is lacking capable contributors and funds to keep the code maintainedChanging names makes the situation worse by consuming scarce resources.
Nov 28 2014
On Saturday, 29 November 2014 at 03:13:37 UTC, Walter Bright wrote:I doubt any of that situation is improved by changing names.I was referring to (breaking) changes in general. But with regard to names, yes names are important, which is why they should be chosen carefully up front, and why I intervened on this pull request https://github.com/D-Programming-Language/druntime/pull/999. Mike
Nov 28 2014
Walter Bright:Changing names makes the situation worse by consuming scarce resources.Changing names make the language/library better, and this can increase the retention rate of new D programmers.That's largely speculation. I doubt there's an objective case that "globMatch" is superior to "fnmatch". Not only that, "fnmatch" is a familiar and widely used name across diverse languages. Nobody else uses "globMatch".Some examples of classes of situations/problems: - In Phobos there are good functions like std.math.feqrel that people aren't using (I have again and again suggested its usage in D.learn) probably because of their bad names. - In Phobos there are names like schwartzSort that while descriptive (if you know what a Schwartz transform is), are awfully hard/bad to type and remember (I suggested a "sortKey" or something equally simple, that is less descriptive, but this is not a big problem because schwartzSort is meant to be used quite frequently in D code). - In Phobos there are also redundant names like std.random.randomShuffle, where in both Python and now C++ "shuffle" suffices. - Regarding the name "familiarity" point you often raise, this has done not so good to D. We have names like "wchar", "dchar" that have no useful meaning, and you need memory to remember their sizes. We have exceptionally badly type names as "byte" and "ubyte" that are bug-prone, etc. Not all future D programmers have 20 years of C/C++ experience of programming. Sometimes a more "algorithmic" naming scheme for types as in Rust is better (it uses a number to denote the length in bytes of number types). Good function names are useful because: - It's simpler to find them when you don't know if Phobos contains something you need; - Once they are found, a well chosen name allows the programmer to understand faster if that's the right function to pick; - Once they are used in the code, a good name makes the code more easy to understand; - Bad names can even cause bugs; - Sometimes when you can't find a good name for a function is a code smell, it means your function is badly designed or should be split in two or more parts. Good naming is essential in programming. Improving some D/Phobos names is very important. I understand the need for API stability, but this doesn't kill the importance of good naming. Adding deprecated to Phobos for years is often acceptable.and the lack of a rich set of libraries because of bit rot.This is not a valid argument. The lack of D libraries has various causes, probably the main one is the lack of D developers and the lack of their interest in keeping the code updated (perhaps because they have left D community?). If you take a look at the Julia language community, the libraries (http://pkg.julialang.org/ ) are being refactored and some names change, but there are lot of people that work furiously improving those libs, so they don't rot, they blossom. Julia is a young language but it already has most numerical libraries for all kinds of scientific work (also because writing average-quality Julia library code requires little time). Bye, bearophile
Nov 29 2014
On Saturday, 29 November 2014 at 11:59:36 UTC, bearophile wrote: <snip>ouch.and the lack of a rich set of libraries because of bit rot.This is not a valid argument. The lack of D libraries has various causes, probably the main one is the lack of D developers and the lack of their interest in keeping the code updated (perhaps because they have left D community?). <snip>
Nov 29 2014
On Sat, 29 Nov 2014 02:59:05 +0000 Mike via Digitalmars-d <digitalmars-d puremagic.com> wrote:Speculation without measurement. But I'll have you know my usage=20 of D has declined significantly because it is missing features I=20 want/need. It is also for this reason that I have not advocated=20 its usage to my employer.same for me. i was gently pushing our development team towards D (heh, and i'm in position to do that) but now i put a veto on D (yet i'm still using heavily patched D for my own pet projects and have no plans to change that). contrary to what one may think i did that not for code breakage, but due to the developers that continuously rejecting to break our code. we already has the language which is riddled by legacy crap, there is no need to introduce another one. as for now i see that "don't break the code" policy is: a. not working, as the code still breaks. b. turning off developers that want a language without legacy crap. c. not attracting new users to D: new users has no code, so there is nothing to break yet. as for libraries: having native D libraries is good, but not really necessary, 'cause it's not that hard to create imports for C libraries, and we have ALOT of C libraries out here. what is *really* matters is having consistent and solid language to build our code base upon. and a language that progressively dropping legacy leftovers in favor of new and/or better designed features.
Nov 28 2014
On 11/28/2014 7:22 PM, ketmar via Digitalmars-d wrote:same for me. i was gently pushing our development team towards D (heh, and i'm in position to do that) but now i put a veto on D (yet i'm still using heavily patched D for my own pet projects and have no plans to change that). contrary to what one may think i did that not for code breakage, but due to the developers that continuously rejecting to break our code. we already has the language which is riddled by legacy crap,Please list your top two or three.
Nov 28 2014
On Fri, 28 Nov 2014 19:35:29 -0800 Walter Bright via Digitalmars-d <digitalmars-d puremagic.com> wrote:On 11/28/2014 7:22 PM, ketmar via Digitalmars-d wrote:as for others -- i was ranting here many times. `foreach (auto n; ...)`? yes, this is *not* a pure cosmetic issue: i'm still not able to logically explain why `foreach (n; ...)` doesn't reuse the existing variable but declaring new local. `foreach (; ...)`? `new char[256]`, but not `new char[256][256]` (yes, i know; just make `new char[256]` invalid too and that's all). ' ' in some attribute but not in another. warnings about prefix function attributes. and so on. sure, those aren't very big things per se, but they making language inconsistent. and if i have to teach people inconsistent language, i'll choose C++: it's very bad, i don't even want to thing about it, especially after what D promises and gives to me, but... but C++ at least has alot of reusable code. and D is in position where it can try to not accumulate legacy crap -- that's what i expecting from the modern language. it's ok for us to fix the broken code if that breakage makes language better. ah, i wrote that many times already. i'm still hoping that something will change (that's why i'm still writing this shit), but i backed to the position "nope, we'll not go D yet". for now i'll wait for either D that rapidly changes removing crap and fixing legacy things, or for D that is 20+ years old and has alot of code written in it.same for me. i was gently pushing our development team towards D (heh, and i'm in position to do that) but now i put a veto on D (yet i'm still using heavily patched D for my own pet projects and have no plans to change that). contrary to what one may think i did that not for code breakage, but due to the developers that continuously rejecting to break our code. we already has the language which is riddled by legacy crap,=20 Please list your top two or three.
Nov 28 2014
On Saturday, 29 November 2014 at 02:59:07 UTC, Mike wrote:Walter, I want you to know, that I love D. It is an awesome language with enormous potential. But it needs to break with a few of the decisions from the past (very few, but significant), and follow through on a few things (like the scope ref proposals). IMO, it's *almost* there. If I(we) can ever get it there, it will likely be the last language I ever use. Mikethe people who got tired of constant code breakage and left,Speculation without measurement. But I'll have you know my usage of D has declined significantly because it is missing features I want/need. It is also for this reason that I have not advocated its usage to my employer. How many users have been lost because they tried it and found it lacking or inefficient, not because of code breakage? I know of 2.
Nov 28 2014
On 11/28/2014 7:42 PM, Mike wrote:Walter, I want you to know, that I love D. It is an awesome language with enormous potential. But it needs to break with a few of the decisions from the past (very few, but significant), and follow through on a few things (like the scope ref proposals). IMO, it's *almost* there. If I(we) can ever get it there, it will likely be the last language I ever use.Actually, we've (myself and 3 others) been hard at work preparing a scope ref proposal. It isn't quite ready to present yet. I agree it is of major importance. It will also slightly break some code, but we have a plan for dealing with that to make it as painless as possible. I believe that scope ref is a big enough win to justify it. What I don't agree with are changing names of things that just cause needless frustration, and are, as I tactlessly put it, an illusion of progress.
Nov 28 2014
On Fri, 28 Nov 2014 20:03:44 -0800 Walter Bright via Digitalmars-d <digitalmars-d puremagic.com> wrote:What I don't agree with are changing names of things that just cause need=less=20frustration, and are, as I tactlessly put it, an illusion of progress.it seems to me that you are very pragmatic person (in a good sense) and with all your expiriense in software development you are underestimating the influense of "cosmetic changes", such as better naming. you are used to "fnmatch" and you don't care if it stays as is or not, so why bother to change? but for heterogeneous teams where we have both expirienced developers and juniors naming matters. it's much easier to read and to remember what 'globMatch' do than what 'fnmatch' do. i, for myself, knowing that function for years still confused a little trying to understand what it has with "function matching". and only after some pause i remembers that it's "filename matching". the same for the things i'm constantly ranting about: "just remember it" for such things is not good. people keep asking me "why?" and all i can answer is "this is the way of the things. just remember it and don't question."
Nov 28 2014
dammit, my English sux even worse when i trying to say something important...
Nov 28 2014
On 11/28/2014 8:25 PM, ketmar via Digitalmars-d wrote:dammit, my English sux even worse when i trying to say something important...No prob, I understand you just fine!
Nov 28 2014
On Saturday, 29 November 2014 at 04:03:47 UTC, Walter Bright wrote:Actually, we've (myself and 3 others) been hard at work preparing a scope ref proposal. It isn't quite ready to present yet. I agree it is of major importance. It will also slightly break some code, but we have a plan for dealing with that to make it as painless as possible. I believe that scope ref is a big enough win to justify it.That's a very good news. --- Paolo
Nov 29 2014
On Saturday, 29 November 2014 at 02:59:07 UTC, Mike wrote: <snip>Agree.and the lack of a rich set of libraries because of bit rot.Yes, D's current business model is not sustainable. It is lacking capable contributors and funds to keep the code maintained. Mike
Nov 29 2014
On Sat, Nov 29, 2014 at 10:46:14AM +1100, Daniel Murphy via Digitalmars-d wrote:"Walter Bright" wrote in message news:m5b0p2$1bv4$1 digitalmars.com...Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago. I wound up with at least a dozen references to Phobos names that have disappeared. No corrective action was indicated, just "undefined symbol". I have to go refigure out what the code was trying to do, and go poking through the Phobos documentation to see what will work today. I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old. I fully understand how unfriendly this is to users and how discouraging it can be to have their recently working code shattered and scattered. We need to do a lot better.Two years is too old, you skipped all the deprecation stages.From an end user's POV, though, two years does seem like a short time. Imean, I have C/C++ projects dating from 20 years ago, and you wouldn't believe it, but almost all of them compile with no change on a modern compiler. Granted, the comparison isn't altogether fair, since D is changing a lot faster than C/C++, but still, 2 years is quite short from that POV. Not everybody is constantly trying to compile code with git HEAD and fixing compiling errors on every personal pet project they have, that, on the off-chance, might stop compiling after 2 years. Perhaps it's time to reconsider the length of the deprecation cycle, from an end user's POV, rather than from the POV of the D devs who can't wait to junk the old stuff and move on to the new. Alternatively, we should have a "compatibility mode" for the compiler / Phobos, where certain parts of the code are version'd out as they get deprecated, but you can get them back by using an appropriate version declaration: // Some phobos module version(PhobosCompat_2066) { // Old version - compile with version=PhobosCompat_2066 // to get this symbol back auto oldSymbol(...) { ... } } else { // New version deprecated("Please use newSymbol instead.") auto oldSymbol(...) { ... } } This works reasonably well for Phobos, but I don't know how to do this in the compiler without ending up with an ugly plate of unmaintainable spaghetti. T -- In theory, there is no difference between theory and practice.
Nov 28 2014
"H. S. Teoh via Digitalmars-d" wrote in message news:mailman.2437.1417219611.9932.digitalmars-d puremagic.com...From an end user's POV, though, two years does seem like a short time. I mean, I have C/C++ projects dating from 20 years ago, and you wouldn't believe it, but almost all of them compile with no change on a modern compiler. Granted, the comparison isn't altogether fair, since D is changing a lot faster than C/C++, but still, 2 years is quite short from that POV. Not everybody is constantly trying to compile code with git HEAD and fixing compiling errors on every personal pet project they have, that, on the off-chance, might stop compiling after 2 years.I don't think it's reasonable to support those expectations in phobos. You don't need to constantly compile with git HEAD, just upgrade in smaller steps than 2 years.Perhaps it's time to reconsider the length of the deprecation cycle, from an end user's POV, rather than from the POV of the D devs who can't wait to junk the old stuff and move on to the new.Maintaining only junk has a cost, and development is slow enough as it is.Alternatively, we should have a "compatibility mode" for the compiler / Phobos, where certain parts of the code are version'd out as they get deprecated, but you can get them back by using an appropriate version declaration: This works reasonably well for Phobos, but I don't know how to do this in the compiler without ending up with an ugly plate of unmaintainable spaghetti.I don't think it works well for either, but it really doesn't work for the compiler. Everything depends on everything else and often motivation for actually getting around to removing features comes from how much of a pain they are to maintain.
Nov 28 2014
On Saturday, November 29, 2014 10:46:14 Daniel Murphy via Digitalmars-d wrote:Two years is too old, you skipped all the deprecation stages.That's pretty much the long and short of it. The deprecation cycle for stuff in druntime/Phobos is currently about two years long (one year as deprecated and documented, one year as deprecated and undocumented). So, anything that had been in the deprecation cycle when Walter last touched that code would be long out of it by now, and depending on when the releases really fell vs how close to two years it's really been, it wouldn't be that hard for some stuff to have started and completed the deprecation cycle since the last time he updated that code. We haven't even been trying to make it so that code can be unmaintained for two years and then still build with no changes. It's pretty much been the expectation that anything untouched for that long is essentially dead. We don't deprecate anywhere near as much stuff as we used to or do it anywhere near as frequently, but two years is long enough that you're going to skip the entire deprecation cycle for stuff. We can certainly look at increasing the length of time for the deprecation process, but that creates more cruft in the library, increases the risk of symbol conflicts and makes for more code to maintain - code that shouldn't even be used anymore. The primary solution has been simply to raise the bar for what changes we'll accept that will result in deprecations. But they still happen sometimes if the change is deemed worthwhile enough (in particular, it sounds like Walter's big problem is that std.path was redone a while back, which was definitely more than simply renaming stuff). And the only way to outright prevent code breaking due to changes like this, we'd have to keep deprecated stuff around indefinitely, which is a maintenance problem. I'm not completely against increasing the length of the deprecation cycle in order to reduce the risk of code breaking without notice when it's not actively maintained (e.g. from two years to three), but I also don't think that it's completely reasonable to expect that code which is untouched for two years will work with the latest compiler and library. Not even the language itself is that stable, and it's a _lot_ more stable than it used to be. I completely agree that we should be trying to reduce code breakage even over longer periods of time (and I think that we definitely _have_ reduced it, even if it's not by enough to allow Walter to compile his two year old microemacs code without using any compilers in between), but I also think that the expectation that old code should compile several years later with no changes and without using any compilers in between is higher than reasonable. I'm not sure that that even works with C++ compilers, much as it should - especially when you go from C++98 to C++11 or C++14, and since D is continually in flux (even if it's a lot less flux than it used to be), doing something like going from 2.058 to 2.066 is a lot like going from C++98 to C++11. To really have full stability, we'd pretty much have to freeze everything and change nothing beyond bug fixes, and we're definitely not doing that. Heck, simply introducing a new function to Phobos can break existing code, because it can create a symbol conflict. It's an easy fix, but stuff like that makes it nigh on impossible to guarantee that we won't break two-year old code. - Jonathan M Davis
Nov 30 2014
You probably have realized that the obvious solution to breakage is: 1. To have two branches: stable and experimental 2. Backport serious bugfixes to stable, but not "bug is a feature" bugs. 3. Provide an upgrade tool when a new stable branch is created (meaning: a new stable branch is not created until the source-code upgrade tool is ready) 4. Create a planned release scheduled for stable branch (say 18-24 months)
Nov 30 2014
On Sun, Nov 30, 2014 at 12:55:34PM +0000, via Digitalmars-d wrote:You probably have realized that the obvious solution to breakage is: 1. To have two branches: stable and experimental 2. Backport serious bugfixes to stable, but not "bug is a feature" bugs. 3. Provide an upgrade tool when a new stable branch is created (meaning: a new stable branch is not created until the source-code upgrade tool is ready) 4. Create a planned release scheduled for stable branch (say 18-24 months)This wouldn't help Walter's original problem. He was taking code written from >=2 years ago and compiling it with the latest compiler. T -- "A man's wife has more power over him than the state has." -- Ralph Emerson
Nov 30 2014
On Sunday, 30 November 2014 at 15:32:31 UTC, H. S. Teoh via Digitalmars-d wrote:This wouldn't help Walter's original problem. He was taking code written from >=2 years ago and compiling it with the latest compiler.I assumed he meant to make a forward looking statement, i.e. how to deal with this from now on. In two years Walter would run the upgradetool spanning 1-2 releases, and get the automatic fixes and the warnings where manual intervention is needed.
Nov 30 2014
On Sun, Nov 30, 2014 at 03:03:23AM -0800, Jonathan M Davis via Digitalmars-d wrote: [...]be. I completely agree that we should be trying to reduce code breakage even over longer periods of time (and I think that we definitely _have_ reduced it, even if it's not by enough to allow Walter to compile his two year old microemacs code without using any compilers in between), but I also think that the expectation that old code should compile several years later with no changes and without using any compilers in between is higher than reasonable. I'm not sure that that even works with C++ compilers, much as it should - especially when you go from C++98 to C++11 or C++14, and since D is continually in flux (even if it's a lot less flux than it used to be), doing something like going from 2.058 to 2.066 is a lot like going from C++98 to C++11.FWIW, I have C++ code dating from 10 years ago that still compiles with C++11. Granted, I needed to fix a thing or two here and there, but they were pretty straightforward (compiler warnings / errors told you exactly why the code doesn't work anymore). But then again, it's not like C++11 replaced an entire standard library module in the process -- they did introduce new and better modules but old ones were kept around.To really have full stability, we'd pretty much have to freeze everything and change nothing beyond bug fixes, and we're definitely not doing that. Heck, simply introducing a new function to Phobos can break existing code, because it can create a symbol conflict.Speaking of which, this problem is made a lot worse than it could be, because currently private symbols in imported modules are included in the overload set, so introducing a *private* symbol can break unrelated user code downstream. Ugh.It's an easy fix, but stuff like that makes it nigh on impossible to guarantee that we won't break two-year old code.[...] I think the complaint was not so much the fact that the code broke, but the fact that it broke *without any clue as to how to fix it*. Now, if we had something like disable with an optional message, we could do something like: disabled("Please use globMatch instead") auto fnmatch(...); At least in theory, this would fix the problem. Of course, in practice, things rarely work out so nicely except in retrospect. :-P T -- MAS = Mana Ada Sistem?
Nov 30 2014
On 11/30/2014 7:28 AM, H. S. Teoh via Digitalmars-d wrote:I think the complaint was not so much the fact that the code broke, but the fact that it broke *without any clue as to how to fix it*.Yup. Consider the fnmatch => globMatch change. Just edit the name, right? Easy-peesy, right? But: 1. the guy given the job of updating the software is not the guy who wrote it - he doesn't know what the code is intending to do 2. He gets "fnmatch is undefined" 3. there's no documentation for fnmatch anymore. He has no idea what fnmatch is supposed to do. Now he's got to embark on some sort of forensic search through old versions of the compiler, and not having much clue which ones to look at 4. he figures out what it does, then starts poking through the Phobos documentation looking for something that might work 5. he finds globMatch, it looks like it'll work 6. hopefully he's got a good test suite to verify that it is actually the correct replacement A simple name change has turned into a fair amount of work.Now, if we had something like disable with an optional message, we could do something like: disabled("Please use globMatch instead") auto fnmatch(...); At least in theory, this would fix the problem. Of course, in practice, things rarely work out so nicely except in retrospect. :-PKeeping around a deprecated alias translating the old symbol to the new one is a good approach. For a more detailed message, instead of the disabled enhancement, a simpler way is: void fnmatch()(...) { static assert(0, "use globMatch instead of fnmatch"); }
Nov 30 2014
On Sun, Nov 30, 2014 at 03:03:37PM -0800, Walter Bright via Digitalmars-d wrote: [...]Keeping around a deprecated alias translating the old symbol to the new one is a good approach. For a more detailed message, instead of the disabled enhancement, a simpler way is: void fnmatch()(...) { static assert(0, "use globMatch instead of fnmatch"); }[...] That's a good idea. Keep in mind, though, that in this particular case, std.path was essentially replaced wholesale, so does that mean that every time we replaced a module, we have to keep the entire old set of symbols around basically forever? T -- It said to install Windows 2000 or better, so I installed Linux instead.
Nov 30 2014
On 11/30/2014 6:01 PM, H. S. Teoh via Digitalmars-d wrote:On Sun, Nov 30, 2014 at 03:03:37PM -0800, Walter Bright via Digitalmars-d wrote: [...]Thanks! I like pressing existing features into use over inventing new ones :-)Keeping around a deprecated alias translating the old symbol to the new one is a good approach. For a more detailed message, instead of the disabled enhancement, a simpler way is: void fnmatch()(...) { static assert(0, "use globMatch instead of fnmatch"); }[...] That's a good idea.Keep in mind, though, that in this particular case, std.path was essentially replaced wholesale, so does that mean that every time we replaced a module, we have to keep the entire old set of symbols around basically forever?Why not? D's module system is very good at avoiding name collisions, and dealing with them when they do arise. Not only that, it's probably a good idea for new modules in Phobos to avoid collisions with old names, even when the old names are removed, so that people are not confused when they try to recompile old projects.
Nov 30 2014
Walter Bright:Thanks! I like pressing existing features into use over inventing new ones :-)The existing feature to be used is deprecated, it's more self-documenting and it was designed for that purpose. Using that special assert is just a workaround. No one was suggesting to invent new feature, but to add a string argument to the right feature to use.Why not?Because it's ugly, and ugly things usually later manage to find ways to give you troubles.it's probably a good idea for new modules in Phobos to avoid collisions with old names, even when the old names are removed, so that people are not confused when they try to recompile old projects.In few (not common) cases it's better to re-use an old name for different better purposes. Bye, bearophile
Dec 01 2014
On Monday, December 01, 2014 09:57:33 bearophile via Digitalmars-d wrote:Walter Bright:The primary difference is that deprecated symbols are still usable, whereas a disabled wouldn't be - nor would a function with static assert(0) in it be usable. And if a something in Phobos is usuable, then we need to maintain it, and that's a problem if we're trying to get rid of it. A function that results in a static assertion when used is still a problem, because it does leave cruft in the library, and it creates symbol conflicts with any symbols which happen to use the same name, but it's still better than leaving something as deprecated permanently. - Jonathan M DavisThanks! I like pressing existing features into use over inventing new ones :-)The existing feature to be used is deprecated, it's more self-documenting and it was designed for that purpose. Using that special assert is just a workaround. No one was suggesting to invent new feature, but to add a string argument to the right feature to use.
Dec 01 2014
Jonathan M Davis:but it's still better than leaving something as deprecated permanently.Right, sorry, I meant disabled. But I don't like to keep those things disabled permanently, they eventually should be removed. Bye, bearophile
Dec 01 2014
On Monday, December 01, 2014 11:21:23 bearophile via Digitalmars-d wrote:Jonathan M Davis:I agree. I do think that we should strive for stability and backwards compatibility, but if we're getting rid of something, then I think that we should actually get rid of it at some point. That's part of why we have the deprecation process that we have. - Jonathan M Davisbut it's still better than leaving something as deprecated permanently.Right, sorry, I meant disabled. But I don't like to keep those things disabled permanently, they eventually should be removed.
Dec 01 2014
On Monday, 1 December 2014 at 11:52:04 UTC, Jonathan M Davis via Digitalmars-d wrote:On Monday, December 01, 2014 11:21:23 bearophile via Digitalmars-d wrote:Thinking along these lines, would it be possible to have something like a deprecation module (core.deprecations?) that you can import (temporarily) for updating old code? At the very least, it seems it would be possible to alias and warn with pragma for some changed names, and error at compile time with an informative message otherwise. Maybe feed it a version the project last built with to narrow what changes might be. In a more magical future, the compiler might automatically import it with a switch and obviate the need for manually changing files, or tools could be built to use it finding trouble spots and automated updates (more for dfix, I suppose). -WyattRight, sorry, I meant disabled. But I don't like to keep those things disabled permanently, they eventually should be removed.I agree. I do think that we should strive for stability and backwards compatibility, but if we're getting rid of something, then I think that we should actually get rid of it at some point. That's part of why we have the deprecation process that we have.
Dec 01 2014
On 12/1/2014 8:17 AM, Wyatt wrote:Thinking along these lines, would it be possible to have something like a deprecation module (core.deprecations?) that you can import (temporarily) for updating old code? At the very least, it seems it would be possible to alias and warn with pragma for some changed names, and error at compile time with an informative message otherwise.Not exactly what you suggest, but: http://code.dlang.org/packages/undead https://github.com/DigitalMars/undeaD
Dec 01 2014
On Mon, Dec 01, 2014 at 03:51:48AM -0800, Jonathan M Davis via Digitalmars-d wrote:On Monday, December 01, 2014 11:21:23 bearophile via Digitalmars-d wrote:[...] I agree that if we're gonna remove something, we should actually *remove* it, not just leave an empty husk behind forever cluttering the code. That's why I suggested lengthening the deprecation cycle. But OTOH, how long can you drag out the deprecation process before it essentially becomes needless cruft that we're forced to carry around "almost forever"? T -- The computer is only a tool. Unfortunately, so is the user. -- Armaphine, K5Jonathan M Davis:I agree. I do think that we should strive for stability and backwards compatibility, but if we're getting rid of something, then I think that we should actually get rid of it at some point. That's part of why we have the deprecation process that we have.but it's still better than leaving something as deprecated permanently.Right, sorry, I meant disabled. But I don't like to keep those things disabled permanently, they eventually should be removed.
Dec 01 2014
On 12/1/2014 1:57 AM, bearophile wrote:Walter Bright:That is inventing a new feature.Thanks! I like pressing existing features into use over inventing new ones :-)The existing feature to be used is deprecated, it's more self-documenting and it was designed for that purpose. Using that special assert is just a workaround. No one was suggesting to invent new feature, but to add a string argument to the right feature to use.
Dec 01 2014
On Monday, 1 December 2014 at 02:44:24 UTC, Walter Bright wrote:D's module system is very good at avoiding name collisions, and dealing with them when they do arise.Really laughed here. dstep got broken when going from 2.065 to 2.066 exactly because new symbol was added to object.d and it clashed with one defined in application. Very good in avoiding name collisions, right.
Dec 04 2014
On Sun, 30 Nov 2014 18:01:34 -0800 "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> wrote:On Sun, Nov 30, 2014 at 03:03:37PM -0800, Walter Bright via Digitalmars-d=wrote:[...]this whole thing is a work for dfix, i believe. there's no need to keep alot of junk in libraries where dfix can do much better work.Keeping around a deprecated alias translating the old symbol to the new one is a good approach. For a more detailed message, instead of the disabled enhancement, a simpler way is: =20 void fnmatch()(...) { static assert(0, "use globMatch instead of fnmatch"); }[...] =20 That's a good idea. =20 Keep in mind, though, that in this particular case, std.path was essentially replaced wholesale, so does that mean that every time we replaced a module, we have to keep the entire old set of symbols around basically forever?
Nov 30 2014
On 2014-12-01 00:03, Walter Bright wrote:3. there's no documentation for fnmatch anymore. He has no idea what fnmatch is supposed to do. Now he's got to embark on some sort of forensic search through old versions of the compiler, and not having much clue which ones to look at$ git log -S 'fnmatch' Is a good command for that. -- /Jacob Carlborg
Dec 01 2014
On 12/1/2014 12:22 AM, Jacob Carlborg wrote:On 2014-12-01 00:03, Walter Bright wrote:I didn't know that. Thanks for the tip!3. there's no documentation for fnmatch anymore. He has no idea what fnmatch is supposed to do. Now he's got to embark on some sort of forensic search through old versions of the compiler, and not having much clue which ones to look at$ git log -S 'fnmatch' Is a good command for that.
Dec 01 2014
On 2014-12-01 00:03, Walter Bright wrote:Keeping around a deprecated alias translating the old symbol to the new one is a good approach. For a more detailed message, instead of the disabled enhancement, a simpler way is: void fnmatch()(...) { static assert(0, "use globMatch instead of fnmatch"); }That doesn't work for virtual methods. Although I think they are quite few in Phobos. -- /Jacob Carlborg
Dec 01 2014
On 11/30/14 6:03 PM, Walter Bright wrote:On 11/30/2014 7:28 AM, H. S. Teoh via Digitalmars-d wrote:I propose a new feature: /++ globMatch does blah blah blah Oldname: fnmatch +/ dmd -checkoldnames myoldproject.d Error: fnmatch not defined. Note: globMatch says that it used to be called fnmatch. It isn't often we change names of things just to change the name. And if we do, it's because the name is so bad. I agree with bearophile, the name of things is *very* important, and shouldn't be prevented from changing. Note, we could add ddoc comments for moving symbols to different modules too. /++ Movedname: sleep => core.sys.posix.unistd.sleep +/ I can't help but think that some sort of version(CompiledWith2065) statements wouldn't help, but they would be really messy. I like the idea of including old names in the docs, because that's really where it should be, and it adds a note in the documentation. It can also be amended retroactively when people find those cases, and it's documentation. Documentation changes don't require any unit tests or special explanations, they are just documents. Making it usable by automated tools can only help. -SteveI think the complaint was not so much the fact that the code broke, but the fact that it broke *without any clue as to how to fix it*.Yup. Consider the fnmatch => globMatch change. Just edit the name, right? Easy-peesy, right? But: 1. the guy given the job of updating the software is not the guy who wrote it - he doesn't know what the code is intending to do 2. He gets "fnmatch is undefined" 3. there's no documentation for fnmatch anymore. He has no idea what fnmatch is supposed to do. Now he's got to embark on some sort of forensic search through old versions of the compiler, and not having much clue which ones to look at 4. he figures out what it does, then starts poking through the Phobos documentation looking for something that might work 5. he finds globMatch, it looks like it'll work 6. hopefully he's got a good test suite to verify that it is actually the correct replacement A simple name change has turned into a fair amount of work.Now, if we had something like disable with an optional message, we could do something like: disabled("Please use globMatch instead") auto fnmatch(...); At least in theory, this would fix the problem. Of course, in practice, things rarely work out so nicely except in retrospect. :-PKeeping around a deprecated alias translating the old symbol to the new one is a good approach. For a more detailed message, instead of the disabled enhancement, a simpler way is: void fnmatch()(...) { static assert(0, "use globMatch instead of fnmatch"); }
Dec 01 2014
Walter Bright:We need to do a lot better.I agree. D has to come back to the living. It looks like D is hibernating. Bye, bearophile
Nov 28 2014
On Friday, 28 November 2014 at 23:50:52 UTC, bearophile wrote:Walter Bright:As much as I like D, hibernating is a very kind way to put it. D feels very ugly/kludgy with all the properties and vomit everywhere and that's something that will never get fixed without serious backwards compatibility breakage. IMO rust got it right with immutable by default, but hindsight is grand(To be fair, rust lifetime management is really ugly too)We need to do a lot better.I agree. D has to come back to the living. It looks like D is hibernating. Bye, bearophile
Nov 28 2014
On Saturday, 29 November 2014 at 07:17:48 UTC, weaselcat wrote: <snip> IMO rust got it rightwith immutable by default, but hindsight is grand(To be fair, rust lifetime management is really ugly too)Immutable as default sounds good (in core)
Nov 29 2014
On 11/28/2014 3:50 PM, bearophile wrote:I agree. D has to come back to the living. It looks like D is hibernating.I have no idea what you're talking about.
Nov 29 2014
Walter Bright:On 11/28/2014 3:50 PM, bearophile wrote:In the last several years the development of D/Phobos didn't keep a constant speed (and this is normal), I have seen sprints, slowdowns, etc. In the latest months I'm seeing a reduction of activity both on the language side, on the fixing and merging of important Phobos patches, and even regarding the number of interesting discussions in the main D newsgroup. Some of this "hibernation" could be caused by the latest "revolution" threads by Andrei. But probably there are also other causes. Or perhaps I'm just mis-measuring the kind of D activity, and everything is going on as well as usual :-) Bye, bearophileI agree. D has to come back to the living. It looks like D is hibernating.I have no idea what you're talking about.
Nov 29 2014
On Saturday, 29 November 2014 at 11:37:52 UTC, bearophile wrote:Some of this "hibernation" could be caused by the latest "revolution" threads by Andrei. But probably there are also other causes. Or perhaps I'm just mis-measuring the kind of D activity, and everything is going on as well as usual :-)I got very happy when Walter announced " nogc" and his intent to create a "better C" switch on the compiler. I felt this was a nice change of direction, but I also feel that this direction has stagnated and taken a turn for the worse with the ref-counting focus… Phobos is too much of a scripting-language library to me, too much like Tango, and hacking in ref counting makes it even more so. To me, a "better C" would have a minimal runtime, a tight minimalistic standard library and very simple builtin ownership semantics (uniqe_ptr). Then a set of supporting libraries that are hardware-optimized (with varying degree of portability). However, I think those that are interested in D as a tight system level language have to spec out "better C" themselves as a formal language spec sketch. I'd be happy to contribute to that, maybe we could start a wiki-page. Since a "better C" would break existing code, it would allow a more "idealistic" language design discussion. I think that could cut down on the noise. I think an experiment would be worth it.
Nov 29 2014
Ola Fosheim Grøstad:Phobos is too much of a scripting-language library to me, too much like Tango, and hacking in ref counting makes it even more so.Those "scripting" needs are real, and rather common. Those high level things are worth having in Phobos. On the other hand it's also reasonable to desire something more fit for a lower level kind of coding. One solution is to split Phobos in two groups of functions, for the two usages (and to forbid the lower level functions to call the high level ones), and ship the compiler with both parts. There is already "Phobos core", but I don't know if its meaning is the same as you desire (probably not).To me, a "better C" would have a minimal runtime, a tight minimalistic standard library and very simple builtin ownership semantics (uniqe_ptr). Then a set of supporting libraries that are hardware-optimized (with varying degree of portability).Clearly D is not a "better C", it's a "better C++/Java". You can use D as a "better C" but this needs some adaptation, both for you and the libraries.However, I think those that are interested in D as a tight system level language have to spec out "better C" themselves as a formal language spec sketch. I'd be happy to contribute to that, maybe we could start a wiki-page. Since a "better C" would break existing code, it would allow a more "idealistic" language design discussion. I think that could cut down on the noise. I think an experiment would be worth it.As usual in open source a good way to do things is to start them yourself and look at how many persons are interested. But from what I'm seeing Rust is putting itself at a level lower than D, with all its care for its "no runtime", it even has annotations and standard library sections for this kind of usage. Bye, bearophile
Nov 29 2014
On Saturday, 29 November 2014 at 12:08:08 UTC, bearophile wrote:Those "scripting" needs are real, and rather common. Those high level things are worth having in Phobos. On the other hand it's also reasonable to desire something more fit for a lower level kind of coding. One solution is to split Phobos in two groups of functions, for the two usages (and to forbid the lower level functions to call the high level ones), and ship the compiler"scripting" needs depend on the application area, the core standard library should only contain the most commonly needed functionality that will work for all applications. With a big standard library you get this effect: big monolithic standard library -> other libraries build on it -> many libraries are unsuitable for more restricted applications big monolithic standard library -> hard to keep bug free, performant and makes language changes more difficult What you want is this: tight standard library -> other libraries build on it if they can-> more libraries are suitable for all applications tight standard library -> high degree of stability -> less breakage of other libraries tight standard library -> better results for library-aware optimizations Then you can have a second optional profile for more unstable scripty libraries, a standardized "extras".with both parts. There is already "Phobos core", but I don't know if its meaning is the same as you desire (probably not).No, I think a lot of what is in "core" is really things that should either be in the language or as compiler intrinsics that the optimizer can deal with.Clearly D is not a "better C", it's a "better C++/Java". You can use D as a "better C" but this needs some adaptation, both for you and the libraries.Yes, but if you can look at D1 as being between C/C++ with GC. I think that is a comfortable spot, if you remove the stuff that the implies a mandatory GC. I think D2 is better off by focusing on stability, evolving in radical changes is difficult. So the more rational approach is to look at the possibility for a D3 on paper and spec a core language that is GC-free, but which can have a more "scripty" GCish profile built on top of it. When you have that, it become easier to improve D2 too, because you have something (hopefully) coherent to compare D2 against. If you have something (on paper) that as a whole is a lot more consistent than D2 then maybe it will be more convincing than arguing tiny feature improvements in isolation. Because those tiny improvements might not seem to be worth it alone. But a new holistic design that captures a lot of the current practice in a cleaner way is going to be much harder to pass on.As usual in open source a good way to do things is to start them yourself and look at how many persons are interested.Sure, I have for many years sketched out various on-paper-designs for languages, I am sure many others do to. The problem is finding common ground since people have different programming styles, experiences and different level of theoretical understanding. By starting with D1/D2 as a common ground it might be possible to create a paper spec for a tiny-D3 that could both support a reduced system language profile and later support an extended "scripty" profile.But from what I'm seeing Rust is putting itself at a level lower than D, with all its care for its "no runtime", it even has annotations and standard library sections for this kind of usage.The problem (and advantage) with opinionated languages like Rust and Go is that they restrict their application area. I also feel that the GC'ed D is constraining, but less so than Rust and Go. Ada is also a well rounded language, but it is a bit verbose for smaller projects. So I think there is an open spot for a streamlined D'ish language between C/C++ with some of the qualities of Ada/Go/Rust/etc. I don't think D is easy to streamline by evolution alone. If you want to arrive at something coherent you need to create abstractions over existing idioms in D programming (interpret current practice through theory) and not create abstractions over the language and libraries (the actual code).
Nov 29 2014
On Saturday, 29 November 2014 at 14:40:47 UTC, Ola Fosheim Grøstad wrote: <snip>With a big standard library you get this effect: big monolithic standard library -> other libraries build on it -> many libraries are unsuitable for more restricted applications big monolithic standard library -> hard to keep bug free, performant and makes language changes more difficult What you want is this: tight standard library -> other libraries build on it if they can-> more libraries are suitable for all applications tight standard library -> high degree of stability -> less breakage of other libraries tight standard library -> better results for library-aware optimizations <snip>+1It is a bit of false advertising to on website promote D as better C, when the efforts are that it is a better C++/Java/CLR. (and I think you can do both w/ a split).Clearly D is not a "better C", it's a "better C++/Java". You can use D as a "better C" but this needs some adaptation, both for you and the libraries.<snip>
Nov 29 2014
On Saturday, 29 November 2014 at 11:56:31 UTC, Ola Fosheim Grøstad wrote: <snip>I got very happy when Walter announced " nogc" and his intent to create a "better C" switch on the compiler. I felt this was a nice change of direction, but I also feel that this direction has stagnated and taken a turn for the worse with the ref-counting focus… Phobos is too much of a scripting-language library to me, too much like Tango, and hacking in ref counting makes it even more so. To me, a "better C" would have a minimal runtime, a tight minimalistic standard library and very simple builtin ownership semantics (uniqe_ptr). Then a set of supporting libraries that are hardware-optimized (with varying degree of portability).<snip> agree.
Nov 29 2014
On Sat, Nov 29, 2014 at 11:37:51AM +0000, bearophile via Digitalmars-d wrote:Walter Bright:Huh??! I *really* don't know what you're talking about, because in the last few months, I've seen a dramatic *increase* in Phobos activity. We've seen the PR queue shrink from 95+ to the mid 30's within 1-2 months, and recently there's been a whole bunch of PR's that got merged (Ilya's import cleanups, for example, span almost all of Phobos and got merged within days of each submission), plus a bunch of new features coming in so fast that the queue is growing again since the committers haven't been able to keep up with the pace. There has been Igor's extremely critical work on finally prepping the AA implementation to be implementable in the library, which is almost reaching its final stages now. If anything, I'd say D is waking up, rather than hibernating! Judging language progress by forum discussions is unreliable... if anything, in *my* experience there's a rather low S/N ratio on the forum in terms of what actually gets done. Perhaps more people have clued in to the fact that asking for things on the forums doesn't work so well, and have started to submit PR's instead? ;-) [...]On 11/28/2014 3:50 PM, bearophile wrote:In the last several years the development of D/Phobos didn't keep a constant speed (and this is normal), I have seen sprints, slowdowns, etc. In the latest months I'm seeing a reduction of activity both on the language side, on the fixing and merging of important Phobos patches, and even regarding the number of interesting discussions in the main D newsgroup.I agree. D has to come back to the living. It looks like D is hibernating.I have no idea what you're talking about.Or perhaps I'm just mis-measuring the kind of D activity, and everything is going on as well as usual :-)[...] How are you measuring D activity? Forum activity is unreliable. Did you look at github commit statistics? T -- Too many people have open minds but closed eyes.
Nov 29 2014
H. S. Teoh:Huh??! I *really* don't know what you're talking about, because in the last few months, I've seen a dramatic *increase* in Phobos activity.OK, if I was mistaken then I am happy ::) Sometimes it's good to be wrong. Bye, bearophile
Nov 29 2014
On 11/29/14 8:09 AM, bearophile wrote:H. S. Teoh:Might be because my participation has been scarce lately (busy with work and family). I'll also be out at the YOW conference (http://yowconference.com.au), talking about D. One interesting tidbit is that downloads have been rising sharply through mid-November, to have a bit of a pullback recently: http://erdani.com/d/downloads.daily.png I wonder if there's some way to filter out robots, build machines etc. Ideas? AndreiHuh??! I *really* don't know what you're talking about, because in the last few months, I've seen a dramatic *increase* in Phobos activity.OK, if I was mistaken then I am happy ::) Sometimes it's good to be wrong.
Dec 01 2014
On Tuesday, 2 December 2014 at 00:13:03 UTC, Andrei Alexandrescu wrote:I wonder if there's some way to filter out robots, build machines etc. Ideas?The User-Agent header would be a good place to start.
Dec 01 2014
On Tuesday, 2 December 2014 at 00:13:03 UTC, Andrei Alexandrescu wrote:I wonder if there's some way to filter out robots, build machines etc. Ideas?We should probably do something to identify all the downloads coming from Travis-CI and other CI solutions.
Dec 01 2014
On Tuesday, 2 December 2014 at 00:13:03 UTC, Andrei Alexandrescu wrote:One interesting tidbit is that downloads have been rising sharply through mid-November, to have a bit of a pullback recently: http://erdani.com/d/downloads.daily.pngOne note about this: I'm using D in my projects since last year, but I'm still using DMD version 2.060! So what I think that would be nice is to find a way to measure the user base beyond the downloads. But anyway nice to see the number of downloads are rising, I hope that means new users. PS: Sorry my english! Matheus.
Dec 01 2014
On Tuesday, 2 December 2014 at 00:13:03 UTC, Andrei Alexandrescu wrote:On 11/29/14 8:09 AM, bearophile wrote:Just a thought but, its pretty close to end of year. Projects will be slowing down/stopping ext. People going on holiday. That also could screw the results a lot.H. S. Teoh:Might be because my participation has been scarce lately (busy with work and family). I'll also be out at the YOW conference (http://yowconference.com.au), talking about D. One interesting tidbit is that downloads have been rising sharply through mid-November, to have a bit of a pullback recently: http://erdani.com/d/downloads.daily.png I wonder if there's some way to filter out robots, build machines etc. Ideas? AndreiHuh??! I *really* don't know what you're talking about, because in the last few months, I've seen a dramatic *increase* in Phobos activity.OK, if I was mistaken then I am happy ::) Sometimes it's good to be wrong.
Dec 01 2014
On 12/1/2014 6:19 PM, Rikki Cattermole wrote:Just a thought but, its pretty close to end of year. Projects will be slowing down/stopping ext. People going on holiday. That also could screw the results a lot.In many organizations, nothing happens from Thanksgiving to the New Years.
Dec 01 2014
On 2/12/2014 3:26 p.m., Walter Bright wrote:On 12/1/2014 6:19 PM, Rikki Cattermole wrote:I guess things are a little different here in New Zealand, but then again different hemisphere. E.g. we legally get Christmas day as a public holiday and schools already ended for the year.Just a thought but, its pretty close to end of year. Projects will be slowing down/stopping ext. People going on holiday. That also could screw the results a lot.In many organizations, nothing happens from Thanksgiving to the New Years.
Dec 01 2014
On 12/01/2014 09:31 PM, Rikki Cattermole wrote:On 2/12/2014 3:26 p.m., Walter Bright wrote:On 12/1/2014 6:19 PM, Rikki Cattermole wrote:Just a thought but, its pretty close to end of year. Projects will be=slowing down/stopping ext. People going on holiday. That also could screw the=ars.results a lot.In many organizations, nothing happens from Thanksgiving to the New Ye==20 I guess things are a little different here in New Zealand, but then aga=in different hemisphere.E.g. we legally get Christmas day as a public holiday and schools alrea=dy ended for the year. People might "have work", doesn't mean that they get anything done...unle= ss you're my university and decide to give a week of classes and then fin= als, as the only thing between Thanksgiving and Christmas. --=20 Matt Soucy http://msoucy.me/
Dec 02 2014
On Saturday, 29 November 2014 at 11:37:52 UTC, bearophile wrote: <snip>Some of this "hibernation" could be caused by the latest "revolution" threads by Andrei. But probably there are also other causes.<snip> Yes, Andrei's ref counting and C++ compatibility, etc. There are choices in debate to push: a) Make D small system lang. b) or Keep D large I say there is more choices: c) Both! Split it like linux: kernal and GNU. kernal is of no use w/ out cd and cat, etc. This way people like Andrei can help even people that use D on real projects. In C++ we have active downstream, ex: http://pocoproject.org/features.html. D gets stronger because of Vibe.d. That can be encourage by spliting/reducing D 'core' to be near useless, w/o a lib for key needed features that are in pre-compiler and downstream ecosystem. Win/win. Andrei's of the world could and should be encouraged as the 'GNU' of D. I am saying 90% of 'D' should be in 'Andrei' domain and all the sacred cows. I'd call the non-core 'D' 'frontal lobe', the part that thinks and D 'core' the 'lizard brain' that is just primitive/visceral. Else the endless debate of large vs small. I say both. Cheers, Vic
Nov 29 2014
On Fri, Nov 28, 2014 at 03:33:51PM -0800, Walter Bright via Digitalmars-d wrote:Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago. I wound up with at least a dozen references to Phobos names that have disappeared. No corrective action was indicated, just "undefined symbol". I have to go refigure out what the code was trying to do, and go poking through the Phobos documentation to see what will work today. I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old. I fully understand how unfriendly this is to users and how discouraging it can be to have their recently working code shattered and scattered. We need to do a lot better.I think we may have been a little trigger-happy in implementing the deprecation cycle. While technically the deprecation cycle lasts 2 years (?), I think it's probably a good idea to keep deprecated symbols around for far longer than that. You never know when somebody decides to dust off some 5-y.o. code that references an obscure Phobos symbol that has since been deleted after a full deprecation cycle. Perhaps what we need is, after a symbol has passed the deprecation cycle, replace its original definition with a static assert(0). Something like this: // Original implementation: /** * Original docs */ auto mySymbol(A...)(A args) { /* original implementation */ } // Some time later we decide to deprecate it. Before marking it // deprecated, label it with a big fat warning: /** * Original docs * * Warning: This function is slated for deprecation by May 2015. */ auto mySymbol(A...)(A args) { /* original implementation */ } // Afterwards, the deprecated tag is added (ddocs are removed so // that new users will stop using it). deprecated("Please use myOtherSymbol instead.") auto mySymbol(A...)(A args) { /* original implementation */ } // Full deprecation cycle passes. Using this symbol should now // be an error, even if -d is being used. But don't delete it // just yet: deprecated("Please use myOtherSymbol instead.") auto mySymbol(A...)(A args) { static assert(0, "Please use myOtherSymbol instead."); } // After a REALLY long time, I dunno, maybe 4 years? 5 years? // We can finally remove it. This does mean, though, that once released, symbols will stick around for a LONG time, which means some overloads cannot be used if it conflicts with a deprecated symbol, etc.. So std.experimental becomes even more important, to sort out APIs before they essentially get frozen in stone and need >=5 years of proverbial laser scrubbing before they can be erased again. There's also the issue of symbols being moved into a different module -- existing code will expect to find it in the old place, so any aliases / public imports / etc., will have to stay around for quite a long time before they can be gotten rid of. Ditto for currently monolithic modules that eventually gets split into saner-sized chunks. T -- Acid falls with the rain; with love comes the pain.
Nov 28 2014
On 11/28/2014 3:53 PM, H. S. Teoh via Digitalmars-d wrote:I think we may have been a little trigger-happy in implementing the deprecation cycle. While technically the deprecation cycle lasts 2 years (?), I think it's probably a good idea to keep deprecated symbols around for far longer than that. You never know when somebody decides to dust off some 5-y.o. code that references an obscure Phobos symbol that has since been deleted after a full deprecation cycle.And, when they are removed for good, there needs to be section in the phobos module documentation that gives a list of gone names and corresponding new names. If the hapless coder greps for "fnmatch", there are no hits in Phobos. I don't so much mind the name change as I mind not knowing "how do I fix it?". Even if I find a new name, such as "fnmatch" seems to have been replaced with "globMatch", I'm not so sure it has the same behavior. In not one of the cases of changed Phobos names was corrective action presented. (The spell checker suggested replacement names, but was always wrong.) In most of the cases where the language changed, the compiler produced correct corrective action advice.
Nov 28 2014
"H. S. Teoh via Digitalmars-d" wrote in message news:mailman.2435.1417218926.9932.digitalmars-d puremagic.com...Perhaps what we need is, after a symbol has passed the deprecation cycle, replace its original definition with a static assert(0). Something like this:I think disabled with a custom message would be perfect for this. static assert only works for templates.
Nov 28 2014
On Saturday, 29 November 2014 at 00:20:38 UTC, Daniel Murphy wrote:I think disabled with a custom message would be perfect for this. static assert only works for templates.We just need someone to implement this. https://issues.dlang.org/show_bug.cgi?id=8728
Nov 29 2014
"Martin Nowak" wrote in message news:znsbjqmgwegyrtvxqmhd forum.dlang.org...We just need someone to implement this. https://issues.dlang.org/show_bug.cgi?id=8728Exactly. I've had a look at it a couple of times but never made it past the parser.
Nov 29 2014
On Sat, 29 Nov 2014 14:00:49 +0000 Martin Nowak via Digitalmars-d <digitalmars-d puremagic.com> wrote:On Saturday, 29 November 2014 at 00:20:38 UTC, Daniel Murphy=20 wrote:and then it will rot in bugzilla forever.I think disabled with a custom message would be perfect for=20 this. static assert only works for templates.=20 We just need someone to implement this. https://issues.dlang.org/show_bug.cgi?id=3D8728
Nov 29 2014
ketmar:and then it will rot in bugzilla forever.Not necessarily. Some things rot there, but I've seen hundreds of nice patches being merged. Bye, bearophile
Nov 29 2014
On Sat, 29 Nov 2014 19:28:00 +0000 bearophile via Digitalmars-d <digitalmars-d puremagic.com> wrote:ketmar: =20this one is not pre-approved, so it will not get any attention.and then it will rot in bugzilla forever.=20 Not necessarily. Some things rot there, but I've seen hundreds of=20 nice patches being merged.
Nov 29 2014
On Fri, 28 Nov 2014 17:43:16 -0600 Brad Roberts via Digitalmars-d <digitalmars-d puremagic.com> wrote:On 11/28/14, 5:39 PM, ketmar via Digitalmars-d wrote:ubber stamp ticker tape=20oh, wait... such tool was suggested years ago and has no signs of "official blessing" until this year's summer! and now it can't fix two-year-old code.=20 I don't understand this attitude. Don't wait for any sort of gold star r=parade. If you think something is worth doing, do it.writing and *supporting* such tool (linter, fixer) which is inevitably tied to the compiler and stdlib development process is a hard work. the author of the tool wants to be sure that this tool is "blessed", so he can interop with other teams. users of such tool wants to be sure that this is not the "one man work" which can disappear any time when author becomes bored. actually, such tool is a part of the compiler suite. that's why it's very little motivation to do it without "blessing". someone can write some quickhack tool for himself to fix *his* codebase, but making such tool usable for others, documenting it and so on is a great amount of work. see, i have the tool that fixes my dmd code for gdc. it successfully processes all my code, 'cause i know my coding habits and can do this with simple regexps. can this tool be used by someone else, on very different codebase? i doubt it. can it be fixed to process other codebases? i doubt it, it doesn't even have the proper parser. do i motivated to improve it? not at all. "blessing" is a motivation. like, say, D->C++ translator which i suggested in the thread about bootstraping D compiler which is written in D. the answer was "no, it's unlikely to be accepted". do i want to spend alot of my time on the code that i myself don't need at all, and without any hope that it will be used later? nope. i have alot of things to code that are interesting for me. "blessing" for companion tools is a motivator.
Nov 28 2014
On Friday, 28 November 2014 at 23:33:54 UTC, Walter Bright wrote:Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago. I wound up with at least a dozen references to Phobos names that have disappeared.Only 12? That's pretty damn good. No corrective action was indicated, just"undefined symbol". I have to go refigure out what the code was trying to do, and go poking through the Phobos documentation to see what will work today. I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old.I don't expect any 2 year old software to work with the latest tools. All of my products are tied to the compiler they are built with. I don't upgrade until I'm ready to allocate resources to refactoring and testing. I'm still using Visual Studio 6.0 on some projects.I fully understand how unfriendly this is to users and how discouraging it can be to have their recently working code shattered and scattered. We need to do a lot better.Users' migration to the latest tools is in their hands to handle how they wish. It's their responsibility. * They don't have to upgrade. * There are beta cycles for them to test with to mitigate risk and inform maintainers of problems. * The project is open source, and developed right out in the open, so all changes are documented, the source code is available, and users have the opportunity to influence the outcome. * Each version is segregated into its own branch, and with diff tools, all changes can be seen relatively easily. * I could go on. I'm not buying the argument that D shouldn't evolve because users are carelessly upgrading their tools and expecting everything to just work. Mike
Nov 28 2014
On 11/28/2014 5:27 PM, Mike wrote:On Friday, 28 November 2014 at 23:33:54 UTC, Walter Bright wrote:It's a pretty small program, 5000 lines.Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago. I wound up with at least a dozen references to Phobos names that have disappeared.Only 12? That's pretty damn good.
Nov 28 2014
Walter Bright:Just for fun, I've decided to try and [...]There's a pull in need of some love, I'd like to see this in D: https://github.com/D-Programming-Language/dmd/pull/3615 Bye, bearophile
Nov 28 2014
On Sat, 29 Nov 2014 01:39:44 +0000 bearophile via Digitalmars-d <digitalmars-d puremagic.com> wrote:Walter Bright: =20it needs just some cosmetix changes (afair) and that's all. i'm using this patch from july and still alive. ;-)Just for fun, I've decided to try and [...]=20 There's a pull in need of some love, I'd like to see this in D: https://github.com/D-Programming-Language/dmd/pull/3615
Nov 28 2014
On Sat, Nov 29, 2014 at 04:12:05AM +0200, ketmar via Digitalmars-d wrote:On Sat, 29 Nov 2014 01:39:44 +0000 bearophile via Digitalmars-d <digitalmars-d puremagic.com> wrote:I'd like to see this in D too. AFAICT, everybody else has approved it, it's just Walter who has some reservations about it.Walter Bright:Just for fun, I've decided to try and [...]There's a pull in need of some love, I'd like to see this in D: https://github.com/D-Programming-Language/dmd/pull/3615it needs just some cosmetix changes (afair) and that's all. i'm using this patch from july and still alive. ;-)What kind of cosmetic changes are needed? T -- Why are you blatanly misspelling "blatant"? -- Branden Robinson
Nov 28 2014
On Fri, 28 Nov 2014 18:15:30 -0800 "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> wrote:On Sat, Nov 29, 2014 at 04:12:05AM +0200, ketmar via Digitalmars-d wrote:i honestly can't remember. can't diff my version with original patch from github 'cause my version has alot of code style changes which makes diff spit out almost any line. that was really some cosmetic changes a-la "this line was split to two, so path can't find it anymore" and so on, nothing intrusive. i don't even sure that those cosmetic changes was not caused by my other patches.On Sat, 29 Nov 2014 01:39:44 +0000 bearophile via Digitalmars-d <digitalmars-d puremagic.com> wrote: =20=20 I'd like to see this in D too. AFAICT, everybody else has approved it, it's just Walter who has some reservations about it. =20 =20Walter Bright: =20Just for fun, I've decided to try and [...]=20 There's a pull in need of some love, I'd like to see this in D: https://github.com/D-Programming-Language/dmd/pull/3615it needs just some cosmetix changes (afair) and that's all. i'm using this patch from july and still alive. ;-)=20 What kind of cosmetic changes are needed?
Nov 28 2014
This is more of an Ubuntu-y issue, but I'm having trouble getting it to link with ncurses. This used to work: cc $(LDFLG) -o med $(OBJ) -l :libncurses.so.5 -l phobos2 -l pthread -l m but alas, no longer with the latest Ubuntu. (Linux people keep trying to get rid of termcap, it's a constant issue.) -lncurses fails, everything I try fails. Any ideas?
Nov 28 2014
On Fri, Nov 28, 2014 at 05:55:21PM -0800, Walter Bright via Digitalmars-d wrote:This is more of an Ubuntu-y issue, but I'm having trouble getting it to link with ncurses. This used to work: cc $(LDFLG) -o med $(OBJ) -l :libncurses.so.5 -l phobos2 -l pthread -l m but alas, no longer with the latest Ubuntu. (Linux people keep trying to get rid of termcap, it's a constant issue.) -lncurses fails, everything I try fails. Any ideas?Hmm. Did you install libncurses5-dev (or libncursesw5-dev)? If not, try `apt-get install libncurses5-dev` (or libncursesw5-dev as appropriate). Otherwise, try -lncurses5 or -lncursesw5, perhaps? T -- Don't modify spaghetti code unless you can eat the consequences.
Nov 28 2014
On 11/28/2014 6:08 PM, H. S. Teoh via Digitalmars-d wrote:Hmm. Did you install libncurses5-dev (or libncursesw5-dev)? If not, try `apt-get install libncurses5-dev` (or libncursesw5-dev as appropriate). Otherwise, try -lncurses5 or -lncursesw5, perhaps?Yeah, that didn't work, either. I wound up simply ripping out ncurses and hardcoding it for xterm.
Nov 29 2014
On Sat, 29 Nov 2014 00:41:45 -0800 Walter Bright via Digitalmars-d <digitalmars-d puremagic.com> wrote:On 11/28/2014 6:08 PM, H. S. Teoh via Digitalmars-d wrote:hm. it took me ~30 minutes to fix all the warnings and build it succesfully with ncurses, both with dmd head and gdc...Hmm. Did you install libncurses5-dev (or libncursesw5-dev)? If not, try `apt-get install libncurses5-dev` (or libncursesw5-dev as appropriate). Otherwise, try -lncurses5 or -lncursesw5, perhaps?=20 Yeah, that didn't work, either. =20 I wound up simply ripping out ncurses and hardcoding it for xterm.
Nov 29 2014
On Sat, 29 Nov 2014 00:41:45 -0800 Walter Bright via Digitalmars-d <digitalmars-d puremagic.com> wrote:On 11/28/2014 6:08 PM, H. S. Teoh via Digitalmars-d wrote:ah, yes, i'm lazy, so i ripped off ^Z and one scrolling optimisation. it can be fixed easily, but i don't see any sense in it.Hmm. Did you install libncurses5-dev (or libncursesw5-dev)? If not, try `apt-get install libncurses5-dev` (or libncursesw5-dev as appropriate). Otherwise, try -lncurses5 or -lncursesw5, perhaps?=20 Yeah, that didn't work, either. =20 I wound up simply ripping out ncurses and hardcoding it for xterm.
Nov 29 2014
On Sat, Nov 29, 2014 at 12:41:45AM -0800, Walter Bright via Digitalmars-d wrote:On 11/28/2014 6:08 PM, H. S. Teoh via Digitalmars-d wrote:Haha... obviously you haven't seen Adam Ruppe's excellent terminal.d library: https://github.com/adamdruppe/arsd I used it for a few of my own projects, and it's pretty awesome. Not perfect, mind you, but it does work pretty well for common terminals like xterm (or whatever termcap entries it can parse). I highly recommend it. T -- Elegant or ugly code as well as fine or rude sentences have something in common: they don't depend on the language. -- Luca De VitisHmm. Did you install libncurses5-dev (or libncursesw5-dev)? If not, try `apt-get install libncurses5-dev` (or libncursesw5-dev as appropriate). Otherwise, try -lncurses5 or -lncursesw5, perhaps?Yeah, that didn't work, either. I wound up simply ripping out ncurses and hardcoding it for xterm.
Nov 29 2014
On Fri, 28 Nov 2014 17:55:21 -0800 Walter Bright via Digitalmars-d <digitalmars-d puremagic.com> wrote:This is more of an Ubuntu-y issue, but I'm having trouble getting it to l=ink=20with ncurses. This used to work: =20 cc $(LDFLG) -o med $(OBJ) -l :libncurses.so.5 -l phobos2 -l pthread -l m =20 but alas, no longer with the latest Ubuntu. (Linux people keep trying to =get rid=20of termcap, it's a constant issue.) -lncurses fails, everything I try fai=ls.=20 Any ideas?this is the tcap.d issue. first: move `char PC;` and `short ospeed;` out of `extern(C)` (that is what drives ld mad). second: kill that linker command and replace it with: gcc $(LDFLG) -o med $(OBJ) -lncurses -lphobos2 -lpthread -lm -lrt this should be enough.
Nov 28 2014
On Fri, 28 Nov 2014 18:08:27 -0800 "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> wrote:Hmm. Did you install libncurses5-dev (or libncursesw5-dev)? If not, try `apt-get install libncurses5-dev` (or libncursesw5-dev as appropriate). Otherwise, try -lncurses5 or -lncursesw5, perhaps?no need to do that, D doesn't use C ncurses headers.
Nov 28 2014
On Friday, 28 November 2014 at 23:33:54 UTC, Walter Bright wrote:[snip] I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old. I fully understand how unfriendly this is to users and how discouraging it can be to have their recently working code shattered and scattered. We need to do a lot better.With every new release of Visual Studio I expect things to break. Every release I'm right. Every release I spend a day fixing our build for the new Visual Studio. After that I get to enjoy a much nicer compiler (and IDE). Switching from gcc to clang had some sore points but it was well worth the change. Moving to C++11 involved quite a bit of work but again, totally worth it. There is only 2-3 years (and now annual) between Visual Studio releases yet stuff still breaks. This is with C++ where you expect rigid backward compatibility. I have no expectation of that with D (as much as we'd all like to stamp it "stable" for marketing purposes). If a project is stagnant (no updates in years) I have no delusions that it will work without issue using the latest compilers/interpreters (regardless of language). It's a nice fantasy to think we could have it that way but it just doesn't exist.
Nov 29 2014
On Friday, 28 November 2014 at 23:33:54 UTC, Walter Bright wrote:I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old.I've lost my faith in expecting to see the D core team grasp what the so called "break my code" folks aims to reach. -- Paolo
Nov 29 2014
On Saturday, 29 November 2014 at 11:35:52 UTC, Paolo Invernizzi wrote:On Friday, 28 November 2014 at 23:33:54 UTC, Walter Bright wrote:Yup.I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old.I've lost my faith in expecting to see the D core team grasp what the so called "break my code" folks aims to reach. -- Paolo
Nov 29 2014
On 11/29/14, Walter Bright via Digitalmars-d <digitalmars-d puremagic.com> wrote:Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago.You seem to create this kind of thread every other month. People complaint to you about A and B, you ignore it, and then when it hits you *personally* suddenly it's a shock to you. The fact that you think you're going to get symbol suggestions for 2 year old code just shows how out of touch you are with the development process. We have a deprecation stage, and a removal stage. There's no way you're going to get suggestions for missing symbols for code that references those symbols which existed 2 years ago. /rant-mode activated
Nov 29 2014
On 11/29/2014 7:56 AM, Andrej Mitrovic via Digitalmars-d wrote:On 11/29/14, Walter Bright via Digitalmars-d <digitalmars-d puremagic.com> wrote:Since I participate in that process, I am hardly unaware of it :-)Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago.You seem to create this kind of thread every other month. People complaint to you about A and B, you ignore it, and then when it hits you *personally* suddenly it's a shock to you. The fact that you think you're going to get symbol suggestions for 2 year old code just shows how out of touch you are with the development process. We have a deprecation stage, and a removal stage. There's no way you're going to get suggestions for missing symbols for code that references those symbols which existed 2 years ago.
Nov 29 2014
On Friday, 28 November 2014 at 23:33:54 UTC, Walter Bright wrote:Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago. I wound up with at least a dozen references to Phobos names that have disappeared. No corrective action was indicated, just "undefined symbol". I have to go refigure out what the code was trying to do, and go poking through the Phobos documentation to see what will work today. I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old. I fully understand how unfriendly this is to users and how discouraging it can be to have their recently working code shattered and scattered. We need to do a lot better.To be fair, this is already a minor annoyance between every DMD release, that I have to go through existing D code and fix all the nits, which are mostly phobos backwards compatibility breaks. This is making it hard to advocate to write more code in D. It's been a while since I had to do that the last time with a new gcc or libc release.
Nov 29 2014
On Friday, 28 November 2014 at 23:33:54 UTC, Walter Bright wrote:Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago. I wound up with at least a dozen references to Phobos names that have disappeared. No corrective action was indicated, just "undefined symbol". I have to go refigure out what the code was trying to do, and go poking through the Phobos documentation to see what will work today. I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old. I fully understand how unfriendly this is to users and how discouraging it can be to have their recently working code shattered and scattered. We need to do a lot better.Why are deprecated aliases even removed in the first place? Is there any harm in keeping them for 5+ years (undocumented of course)? There isn't any increased complexity for the user, you can completely ignore them during development, and if needed they could just go to the bottom of the scope/file hidden away from the rest of the code.
Nov 29 2014
On Sat, Nov 29, 2014 at 08:32:37PM +0000, Kapps via Digitalmars-d wrote:On Friday, 28 November 2014 at 23:33:54 UTC, Walter Bright wrote:Yeah we should keep deprecated aliases around for much longer than we currently do. Having said that, though, there *are* some cases where we can't keep an old symbol around, e.g., it causes conflicts with newer overloads. But that shouldn't be a problem in this case, as it'd be clear that that particular function now requires different arguments, whereas Walter was complaining about symbols that vanished into thin air without a clue as to where they went. There's also the issue of symbols that got moved to a different module. Sometimes leaving an alias behind is not workable, because it will cause conflicts when user code imports both modules. Unless, of course, we change overload rules to allow such apparent conflicts when they actually ultimately resolve to the same symbol in the end. T -- For every argument for something, there is always an equal and opposite argument against it. Debates don't give answers, only wounded or inflated egos.Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago. I wound up with at least a dozen references to Phobos names that have disappeared. No corrective action was indicated, just "undefined symbol". I have to go refigure out what the code was trying to do, and go poking through the Phobos documentation to see what will work today. I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old. I fully understand how unfriendly this is to users and how discouraging it can be to have their recently working code shattered and scattered. We need to do a lot better.Why are deprecated aliases even removed in the first place? Is there any harm in keeping them for 5+ years (undocumented of course)? There isn't any increased complexity for the user, you can completely ignore them during development, and if needed they could just go to the bottom of the scope/file hidden away from the rest of the code.
Nov 29 2014
On 11/29/2014 1:56 PM, H. S. Teoh via Digitalmars-d wrote:There's also the issue of symbols that got moved to a different module. Sometimes leaving an alias behind is not workable, because it will cause conflicts when user code imports both modules. Unless, of course, we change overload rules to allow such apparent conflicts when they actually ultimately resolve to the same symbol in the end.Aliases that resolve to the same symbol was a bug fixed long ago. If this has resurfaced, please file a bugzilla.
Nov 29 2014
On Sat, Nov 29, 2014 at 02:24:46PM -0800, Walter Bright via Digitalmars-d wrote:On 11/29/2014 1:56 PM, H. S. Teoh via Digitalmars-d wrote:Ah, so I'm outdated. That's good to know. :-) T -- What doesn't kill me makes me stranger.There's also the issue of symbols that got moved to a different module. Sometimes leaving an alias behind is not workable, because it will cause conflicts when user code imports both modules. Unless, of course, we change overload rules to allow such apparent conflicts when they actually ultimately resolve to the same symbol in the end.Aliases that resolve to the same symbol was a bug fixed long ago. If this has resurfaced, please file a bugzilla.
Nov 29 2014
On Friday, 28 November 2014 at 23:33:54 UTC, Walter Bright wrote:Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago. I wound up with at least a dozen references to Phobos names that have disappeared. No corrective action was indicated, just "undefined symbol". I have to go refigure out what the code was trying to do, and go poking through the Phobos documentation to see what will work today. I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old. I fully understand how unfriendly this is to users and how discouraging it can be to have their recently working code shattered and scattered. We need to do a lot better.I've just made xmlp (http://www.dsource.org/projects/xmlp) compile with the newest version of D. It wasn't that bad, despite xmlp rotting for two years with merge markers left in it. However what would have made this even easier, would be a) a summary for each release called "How this version breaks your code and how to fix it". Don't need that for library changes, language changes are enough. b) easy access to older versions of the documentation. When you have a deprecated and subsequently removed function, you should at least be able to lookup what the code was supposed to do.
Nov 30 2014
On Sun, Nov 30, 2014 at 12:15:48PM +0000, Tobias Pankrath via Digitalmars-d wrote: [...]I've just made xmlp (http://www.dsource.org/projects/xmlp) compile with the newest version of D. It wasn't that bad, despite xmlp rotting for two years with merge markers left in it. However what would have made this even easier, would be a) a summary for each release called "How this version breaks your code and how to fix it". Don't need that for library changes, language changes are enough.I thought dlang.org already has a page that lists language & library changes for each of the recent releases? Those lists tend to be pretty long, though, which means people aren't likely to actually read it all. I wonder if there are other ways of navigating them so that they are actaully useful.b) easy access to older versions of the documentation. When you have a deprecated and subsequently removed function, you should at least be able to lookup what the code was supposed to do.[...] Good idea! We should archive docs from older versions of Phobos and make them accessible on dlang.org. I'm working on revamping some parts of the Phobos docs build; once that's in, it might not be too hard to make it also generate docs for older releases. T -- What do you call optometrist jokes? Vitreous humor.
Nov 30 2014
On 11/30/2014 7:36 AM, H. S. Teoh via Digitalmars-d wrote:Good idea! We should archive docs from older versions of Phobos and make them accessible on dlang.org. I'm working on revamping some parts of the Phobos docs build; once that's in, it might not be too hard to make it also generate docs for older releases.I decided to try and update DMDScript from D1 to D2. Thousands and thousands of error messages :-(
Nov 30 2014
30-Nov-2014 23:22, Walter Bright пишет:On 11/30/2014 7:36 AM, H. S. Teoh via Digitalmars-d wrote:Even back in 2010 it took about 10 evenings to get it to "runnable" state. Then another ~20 evenings to fix most of bugs, including semantic errors and GC collecting live objects. You may want to check my fork that used to compile with dmd 2.058 or smth (whatever was actual in 2012). Might help to assess the amount of work... https://github.com/DmitryOlshansky/DMDScript It at least passed about 90% (most fails in library tests) of 2012 Google's Spuntik JavaScript test. -- Dmitry OlshanskyGood idea! We should archive docs from older versions of Phobos and make them accessible on dlang.org. I'm working on revamping some parts of the Phobos docs build; once that's in, it might not be too hard to make it also generate docs for older releases.I decided to try and update DMDScript from D1 to D2. Thousands and thousands of error messages :-(
Nov 30 2014
On 11/30/2014 12:28 PM, Dmitry Olshansky wrote:30-Nov-2014 23:22, Walter Bright пишет:Wow, I didn't know you'd done this. I'll check it out. I know that the D1 version did pass Sun's Javascript test suite which was vintage 2000 or so. My intent after updating DMDScript is to put it on dub.On 11/30/2014 7:36 AM, H. S. Teoh via Digitalmars-d wrote:Even back in 2010 it took about 10 evenings to get it to "runnable" state. Then another ~20 evenings to fix most of bugs, including semantic errors and GC collecting live objects. You may want to check my fork that used to compile with dmd 2.058 or smth (whatever was actual in 2012). Might help to assess the amount of work... https://github.com/DmitryOlshansky/DMDScript It at least passed about 90% (most fails in library tests) of 2012 Google's Spuntik JavaScript test.Good idea! We should archive docs from older versions of Phobos and make them accessible on dlang.org. I'm working on revamping some parts of the Phobos docs build; once that's in, it might not be too hard to make it also generate docs for older releases.I decided to try and update DMDScript from D1 to D2. Thousands and thousands of error messages :-(
Nov 30 2014
On 11/30/2014 12:28 PM, Dmitry Olshansky wrote:30-Nov-2014 23:22, Walter Bright пишет:Do you mind if I simply merge your fork into https://github.com/DigitalMars/DMDScript ?On 11/30/2014 7:36 AM, H. S. Teoh via Digitalmars-d wrote:Even back in 2010 it took about 10 evenings to get it to "runnable" state. Then another ~20 evenings to fix most of bugs, including semantic errors and GC collecting live objects. You may want to check my fork that used to compile with dmd 2.058 or smth (whatever was actual in 2012). Might help to assess the amount of work... https://github.com/DmitryOlshansky/DMDScript It at least passed about 90% (most fails in library tests) of 2012 Google's Spuntik JavaScript test.Good idea! We should archive docs from older versions of Phobos and make them accessible on dlang.org. I'm working on revamping some parts of the Phobos docs build; once that's in, it might not be too hard to make it also generate docs for older releases.I decided to try and update DMDScript from D1 to D2. Thousands and thousands of error messages :-(
Nov 30 2014
01-Dec-2014 01:44, Walter Bright пишет:On 11/30/2014 12:28 PM, Dmitry Olshansky wrote:Not at all, in fact, that would be awesome. -- Dmitry Olshansky30-Nov-2014 23:22, Walter Bright пишет:Do you mind if I simply merge your fork into https://github.com/DigitalMars/DMDScript ?On 11/30/2014 7:36 AM, H. S. Teoh via Digitalmars-d wrote:Even back in 2010 it took about 10 evenings to get it to "runnable" state. Then another ~20 evenings to fix most of bugs, including semantic errors and GC collecting live objects. You may want to check my fork that used to compile with dmd 2.058 or smth (whatever was actual in 2012). Might help to assess the amount of work... https://github.com/DmitryOlshansky/DMDScript It at least passed about 90% (most fails in library tests) of 2012 Google's Spuntik JavaScript test.Good idea! We should archive docs from older versions of Phobos and make them accessible on dlang.org. I'm working on revamping some parts of the Phobos docs build; once that's in, it might not be too hard to make it also generate docs for older releases.I decided to try and update DMDScript from D1 to D2. Thousands and thousands of error messages :-(
Nov 30 2014
Walter Bright:I decided to try and update DMDScript from D1 to D2. Thousands and thousands of error messages :-(It's not just the errors, it's also the new features and opportunities offered by the newer D/Phobos that you weren't using in the old code... Just removing the errors is usually not enough to produce modern and very good D2 code. Bye, bearophile
Nov 30 2014
On 11/30/2014 12:54 PM, bearophile wrote:Walter Bright:I'm aware that D2 offers many opportunities to improve the code :-) After all, DMDScript is a very early D project.I decided to try and update DMDScript from D1 to D2. Thousands and thousands of error messages :-(It's not just the errors, it's also the new features and opportunities offered by the newer D/Phobos that you weren't using in the old code... Just removing the errors is usually not enough to produce modern and very good D2 code.
Nov 30 2014
Walter Bright:I'm aware that D2 offers many opportunities to improve the code :-)One problem I am seeing is that there is a large distance from the bare-bones code D2 requires you to write, and the code that I now regard as good D2 code. And the D2 compiler doesn't require or pushes you much toward the better code. You can see that even for in the smallest things, like: foreach (i; 0 .. 10) { writeln(i); i++; writeln(i); } I suggested to make that variable i an immutable by default. Currently it's a mutable and nearly no one bothers to write the correct and safer code: foreach (immutable i; 0 .. 10) { writeln(i); writeln(i + 1); } The moral of this story is that a language needs to be designed to have by default the best&safe idioms (but avoiding excessive amounts of typing as Ada). This is a hard balance to find. Here you can see two examples of code that show the difference from the C-style code that compiles with D2, and the code you can write in D2 only if you push yourself a lot to express more invariants and more precise typing: http://rosettacode.org/wiki/Hidato#D (The two programs are similar but they don't do exactly the same things. The second program is longer also because it does a little more). Most of the D code you see in the wild is the C-like code of the first kind. the "basic" style of coding is rather safer than D written in the bare bones C-style, and it's rather crisp. Bye, bearophile
Nov 30 2014
On Sunday, 30 November 2014 at 23:16:14 UTC, bearophile wrote:... I suggested to make that variable i an immutable by default.I suggest everything be made immutable by default ;)
Nov 30 2014
weaselcat:On Sunday, 30 November 2014 at 23:16:14 UTC, bearophile wrote:Currently D doesn't have a keyword as "mut" or "mutable" so if you make the foreach variable immutable by default, you have some troubles when (rarely) you want a mutable foreach index (you need an auxiliary variable, and you have to type it manually, because if you use "auto" you get another immutable again). But for the general case of all the variables, this breaks all the D2 code, so you can't do that (but I don't know why this change wasn't done in the D1->D2 transition), and I think Walter doesn't like things like pragma(strict) to be put beside the module name to denote modules where variables are const/immutable by default. So I didn't even discuss this impossible option. Bye, bearophile... I suggested to make that variable i an immutable by default.I suggest everything be made immutable by default ;)
Nov 30 2014
On Sunday, November 30, 2014 23:19:19 weaselcat via Digitalmars-d wrote:I suggest everything be made immutable by default ;)That probably would have been too much of a divergence from D's C/C++ roots to go over very well, but it's something that we would probably consider if we were starting from scratch - similarly, pure and safe should probably be the default for functions, but it's far too late now. - Jonathan M Davis
Nov 30 2014
On Sun, Nov 30, 2014 at 08:52:33PM -0800, Jonathan M Davis via Digitalmars-d wrote:On Sunday, November 30, 2014 23:19:19 weaselcat via Digitalmars-d wrote:[...] If we were ever to have a D3, I'd propose that one of the first things to do is to make everything pure and safe by default. T -- Leather is waterproof. Ever see a cow with an umbrella?I suggest everything be made immutable by default ;)That probably would have been too much of a divergence from D's C/C++ roots to go over very well, but it's something that we would probably consider if we were starting from scratch - similarly, pure and safe should probably be the default for functions, but it's far too late now.
Nov 30 2014
On Sun, Nov 30, 2014 at 12:22:54PM -0800, Walter Bright via Digitalmars-d wrote:On 11/30/2014 7:36 AM, H. S. Teoh via Digitalmars-d wrote:Well... upgrading from C to C++ involves... close to zero error messages. But that's not necessarily a good thing, as I'm sure you'll agree! I think in many ways, D2 is a far different language than D1, and it'd be unrealistic to expect D1 code to compile with D2 without a fair amount of changes. T -- "I suspect the best way to deal with procrastination is to put off the procrastination itself until later. I've been meaning to try this, but haven't gotten around to it yet. " -- swrGood idea! We should archive docs from older versions of Phobos and make them accessible on dlang.org. I'm working on revamping some parts of the Phobos docs build; once that's in, it might not be too hard to make it also generate docs for older releases.I decided to try and update DMDScript from D1 to D2. Thousands and thousands of error messages :-(
Nov 30 2014
On 2014-11-30 16:36, H. S. Teoh via Digitalmars-d wrote:I thought dlang.org already has a page that lists language & library changes for each of the recent releases?We have only had that for a couple of releases and not the latest release. No one wrote that document for the latest release and it, apparently, was more important to get the new release out. Also, they only list changes. There's no indication if it's a breaking change or not.Good idea! We should archive docs from older versions of Phobos and make them accessible on dlang.org. I'm working on revamping some parts of the Phobos docs build; once that's in, it might not be too hard to make it also generate docs for older releases.Yeah, it needs to be possible to access the documentation for an arbitrary version of D at dlang.org. -- /Jacob Carlborg
Dec 01 2014
On 29/11/14 16:56, Andrej Mitrovic via Digitalmars-d wrote:The fact that you think you're going to get symbol suggestions for 2 year old code just shows how out of touch you are with the development process. We have a deprecation stage, and a removal stage. There's no way you're going to get suggestions for missing symbols for code that references those symbols which existed 2 years ago.It's fair to say that 2 years is a long time in recent Phobos development. However, I don't think Walter's point is about it biting him personally. The question is, what happens if somebody tries to use or resurrect an old D project -- how much trouble are they going to have trying to bring it back to life, and where they need to update code, how helpful are the tools? It doesn't reflect well on the language or its community if older D code is as unusable as Walter describes, and it's particularly problematic where it relates to Phobos, because here we have much more scope to deprecate things without ever actually removing them. That said, I don't think this is an argument for freezing things. I think it's an argument for being very clear about what parts of the Phobos API are stable, and allowing for the (clearly documented) possibility of change where that may be desirable.
Nov 30 2014
On Sunday, November 30, 2014 07:28:57 H. S. Teoh via Digitalmars-d wrote:On Sun, Nov 30, 2014 at 03:03:23AM -0800, Jonathan M Davis via Digitalmars-d wrote:Yeah, and AFAIK, no one ever managed to convince Walter that that needed to be changed. There were DIPs on the matter, but I don't recall if any made it to the PR stage or not. I know that Martin was looking at it at one point, and he wrote one of the DIPs, but AFAIK, he hasn't touched the issue recently.To really have full stability, we'd pretty much have to freeze everything and change nothing beyond bug fixes, and we're definitely not doing that. Heck, simply introducing a new function to Phobos can break existing code, because it can create a symbol conflict.Speaking of which, this problem is made a lot worse than it could be, because currently private symbols in imported modules are included in the overload set, so introducing a *private* symbol can break unrelated user code downstream. Ugh.That would create symbol conflicts as long as the symbol was kept around, which is more of a problem in some cases than others. It also leaves cruft in the library. So, ideally, we wouldn't leave stuff like that around, but as the language and standard library mature, we are going to need to seriously look at having two year old code work with an up-to-date compiler and standard library. Thus far, the approach has been that folks really need to be maintaining their code at least occasionally, and we've supported moving code forward clearly via the deprecation cycle, but code that isn't touched for years wasn't really even considered a legitimate use case by many of us - and yebblie's suggestion of updating to an intermediary compiler does solve the problem rather nicely. So, I don't know. As a maintainer of Phobos, I'd much prefer to not leave cruft around, since it does make the library worse for anyone who is maintaining their code, and I don't know how much sympathy I have when code isn't even built with a newer compiler for over two years. But we do want to be a lot more stable than we are... Maintaining stability while avoiding stagnation and cruft is always a challenge. - Jonathan m DavisIt's an easy fix, but stuff like that makes it nigh on impossible to guarantee that we won't break two-year old code.[...] I think the complaint was not so much the fact that the code broke, but the fact that it broke *without any clue as to how to fix it*. Now, if we had something like disable with an optional message, we could do something like: disabled("Please use globMatch instead") auto fnmatch(...); At least in theory, this would fix the problem. Of course, in practice, things rarely work out so nicely except in retrospect. :-P
Dec 01 2014
On 2014-11-29 00:33, Walter Bright wrote:Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago. I wound up with at least a dozen references to Phobos names that have disappeared. No corrective action was indicated, just "undefined symbol". I have to go refigure out what the code was trying to do, and go poking through the Phobos documentation to see what will work today. I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old. I fully understand how unfriendly this is to users and how discouraging it can be to have their recently working code shattered and scattered. We need to do a lot better.Every single release since at least DMD 2.050 has broken DWT. Most of these issues were language changes and not renamed symbols in Phobos. -- /Jacob Carlborg
Dec 01 2014
On 12/1/2014 5:36 AM, Jacob Carlborg wrote:Every single release since at least DMD 2.050 has broken DWT. Most of these issues were language changes and not renamed symbols in Phobos.My experience with upgrading old D code, even D1 code, is that language changes were easier to deal with than Phobos changes. The reason is because we've done a fairly good job with compiler error messages that not only point out errors, but suggest corrective action.
Dec 01 2014
On 2014-11-29 00:33, Walter Bright wrote:I fully understand how unfriendly this is to users and how discouraging it can be to have their recently working code shattered and scattered. We need to do a lot better.When we're talking about breaking code, I just found this regression: https://issues.dlang.org/show_bug.cgi?id=13811 -- /Jacob Carlborg
Dec 02 2014
On Friday, 28 November 2014 at 23:33:54 UTC, Walter Bright wrote:Just for fun, I've decided to try and get MicroEmacs in D added to the dub registry. The last time it compiled was 2 years ago. I wound up with at least a dozen references to Phobos names that have disappeared. No corrective action was indicated, just "undefined symbol". I have to go refigure out what the code was trying to do, and go poking through the Phobos documentation to see what will work today. I know there's been a lot of "break my code" advocacy lately, but this code was only 2 years old. I fully understand how unfriendly this is to users and how discouraging it can be to have their recently working code shattered and scattered. We need to do a lot better.We have deprecation cycle of one year. Expecting unmaintained application to compile after 2 years has passed is completely unreasonable. Almost every single D program out there breaks with _each_ DMD release, Phobos deprecations are least of all evils there. Try fixing that before complaining about #breakmycode Also it feels like you consider D at stable version. It isn't. There is a huge amount of work to be done before it can be considered even honest 1.0.0 - doing something with scope, finishing nogc / rc attempts, cleaning up qualifier mess etc. Once it is all done, maybe (maybe!) we can talk about stability. Right now it is a fallacy.
Dec 04 2014