[Issue 18943] core.internal.hash remove outdated special case for DMD unaligned reads
https://issues.dlang.org/show_bug.cgi?id=18943 --- Comment #1 from Nathan S. --- Pull request: https://github.com/dlang/druntime/pull/2210 --
[Issue 18943] New: core.internal.hash remove outdated special case for DMD unaligned reads
https://issues.dlang.org/show_bug.cgi?id=18943 Issue ID: 18943 Summary: core.internal.hash remove outdated special case for DMD unaligned reads Product: D Version: D2 Hardware: x86 OS: All Status: NEW Severity: enhancement Priority: P1 Component: druntime Assignee: nob...@puremagic.com Reporter: n8sh.second...@hotmail.com core.internal.hash has lines dating back to its initial commit on November 16, 2013 that disable unaligned reads when using DMD comment that a DMD bug would prevent inlining. That is not true in the present day so the comment and alternative code branch have no purpose except to confuse. With optimization enabled DMD produces the same code for `return *cast(uint*)x;` and `return ((cast(uint) x[3]) << 24) | ((cast(uint) x[2]) << 16) | ((cast(uint) x[1]) << 8) | (cast(uint) x[0]);` when `x` is `ubyte*`, so this patch is not expected to improve performance except for non-optimized builds. --
Re: stride in slices
On Tuesday, 5 June 2018 at 03:13:05 UTC, Meta wrote: 14 ms, 520 μs, and 4 hnsecs 13 ms, 87 μs, and 2 hnsecs 12 ms, 938 μs, and 8 hnsecs When using `dmd -inline -O -release` with an extra simd benchmark I get: for loop:21 ms, 291 μs, and 6 hnsecs stride/fill: 64 ms, 927 μs, and 9 hnsecs stride/each: 52 ms, 740 μs, and 8 hnsecs simd &=: 6 ms, 900 μs, and 8 hnsecs https://run.dlang.io/gist/5fe73cbf9943aa57be1101e597bb25e4?args=-inline%20-O%20-release Though the simd version does not work in ldc...
Re: GitHub could be acquired by Microsoft
On 6/3/18 20:51, Anton Fediushin wrote: This is still just a rumour, we'll know the truth on Monday (which is today). Some articles about the topic: https://fossbytes.com/microsoft-github-aquisition-report/ https://www.theverge.com/2018/6/3/17422752/microsoft-github-acquisition-rumors What's your opinion about that? Will you continue using GitHub? Both GitLab and Bitbucket can be used instead to host your D projects - dub registry supported them for a while now. IMHO Microsoft isn't the type of company I want to see behind the GitHub. Maybe I am wrong since Microsoft has both money and programmers to improve it further, I just don't trust them too much which is the right thing to do when dealing with companies. This means that I will move my repositories elsewhere and use GitHub just to contribute to other projects. I've been thinking how to best respond to this and here is where I am. First, let me state up-front that I work for Microsoft (Office 365 Workplace Analytics). Second, my employer (Volometrix) prior to working for Microsoft was acquired by Microsoft almost three years ago. What that means is that while my division had no fore-warning of this acquisition I have first-hand experience with what will be happening at GitHub over the next months and years. As an employee of Microsoft I am required to follow Microsoft's policy on Social Media, which can be reduced to "If you have nothing nice to say, then say nothing at all." Or stated plainly, what follows may or may not represent the entirety of my thoughts on the matter as I am effectively barred from revealing any negative thoughts. So what I can say about this acquisition is that it is the best possible outcome of GitHub's possible futures for both the company and the employees. GitHub has not been profitable for years and is thought to have had cash reserves for only one or two more months of operations. Losing GitHub entirely overnight would have been an unmitigated disaster for the entire Open-Source community. And there are fates worse than death. Imagine for a second GitHub at Google or ... *shudder* Oracle. Whatever your opinions about Microsoft, you cannot possible imagine that either of those outcomes would have been qualitatively better. In that sense Microsoft was the best of the bad options GitHub. As to any other concerns/opinions, all I will say is ... think laterally. -- Adam Wilson IRC: LightBender import quiet.dlang.dev;
Re: stride in slices
On Monday, 4 June 2018 at 23:08:17 UTC, Ethan wrote: On Monday, 4 June 2018 at 18:11:47 UTC, Steven Schveighoffer wrote: BTW, do you have cross-module inlining on? Just to drive this point home. https://run.dlang.io/is/nrdzb0 Manually implemented stride and fill with everything forced inline. Otherwise, the original code is unchanged. 17 ms, 891 μs, and 6 hnsecs 15 ms, 694 μs, and 1 hnsec 15 ms, 570 μs, and 9 hnsecs My new stride outperformed std.range stride, and the manual for-loop. And, because the third test uses the new stride, it also benefited. But interestingly runs every so slightly faster... Just as an aside: ... pragma( inline ) @property length() const { return range.length / strideCount; } pragma( inline ) @property empty() const { return currFront > range.length; } pragma( inline ) @property ref Elem front() { return range[ currFront ]; } pragma( inline ) void popFront() { currFront += strideCount; } ... pragma( inline ) auto stride( Range )( Range r, int a ) ... pragma( inline ) auto fill( Range, Value )( Range r, Value v ) ... pragma(inline), without any argument, does not force inlining. It actually does nothing; it just specifies that the "implementation's default behaviour" should be used. You have to annotate with pragma(inline, true) to force inlining (https://dlang.org/spec/pragma.html#inline). When I change all the pragma(inline) to pragma(inline, true), there is a non-trivial speedup: 14 ms, 517 μs, and 9 hnsecs 13 ms, 110 μs, and 1 hnsec 13 ms, 199 μs, and 9 hnsecs There's further reductions using ldc-beta: 14 ms, 520 μs, and 4 hnsecs 13 ms, 87 μs, and 2 hnsecs 12 ms, 938 μs, and 8 hnsecs
[Issue 18942] core.internal.hash can take advantage of alignment info on non-x86
https://issues.dlang.org/show_bug.cgi?id=18942 --- Comment #1 from Nathan S. --- Pull request: https://github.com/dlang/druntime/pull/2209 --
[Issue 18942] core.internal.hash can take advantage of alignment info on non-x86
https://issues.dlang.org/show_bug.cgi?id=18942 Nathan S. changed: What|Removed |Added Summary|core.internal.hash should |core.internal.hash can take |take advantage of alignment |advantage of alignment info |info on non-x86 |on non-x86 --
[Issue 18942] core.internal.hash should take advantage of alignment info on non-x86
https://issues.dlang.org/show_bug.cgi?id=18942 Nathan S. changed: What|Removed |Added Summary|core.internal.hash take |core.internal.hash should |advantage of alignment info |take advantage of alignment |on non-x86 |info on non-x86 --
[Issue 18942] New: core.internal.hash take advantage of alignment info on non-x86
https://issues.dlang.org/show_bug.cgi?id=18942 Issue ID: 18942 Summary: core.internal.hash take advantage of alignment info on non-x86 Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: druntime Assignee: nob...@puremagic.com Reporter: n8sh.second...@hotmail.com On machines that do not support unaligned memory access, core.internal.hash should use statically available alignment information to determine when `uint` reads can be used. --
Re: GitHub could be acquired by Microsoft
On Monday, 4 June 2018 at 19:26:23 UTC, Joakim wrote: On Monday, 4 June 2018 at 19:06:52 UTC, Maksim Fomin wrote: [...] Unlikely, you don't spend $7.5 billion on a company because you want to send a message that you're a good dev tools company, then neglect it. I suggest you look at their online slides linked from the Nadella blog post to see their stated plan, such as integrating github into VS Code more: http://aka.ms/ms06042018 Of course, this is Microsoft: they probably won't execute that plan well, and likely vastly overpaid for an unprofitable company in the first place, but they emphasize that they intend to keep github open and independent. Yeah, like they did codeplex!
Re: stride in slices
On Monday, 4 June 2018 at 18:11:47 UTC, Steven Schveighoffer wrote: BTW, do you have cross-module inlining on? Just to drive this point home. https://run.dlang.io/is/nrdzb0 Manually implemented stride and fill with everything forced inline. Otherwise, the original code is unchanged. 17 ms, 891 μs, and 6 hnsecs 15 ms, 694 μs, and 1 hnsec 15 ms, 570 μs, and 9 hnsecs My new stride outperformed std.range stride, and the manual for-loop. And, because the third test uses the new stride, it also benefited. But interestingly runs every so slightly faster...
Re: stride in slices
On Monday, 4 June 2018 at 17:40:57 UTC, Dennis wrote: On Monday, 4 June 2018 at 15:43:20 UTC, Steven Schveighoffer wrote: Note, it's not going to necessarily be as efficient, but it's likely to be close. -Steve I've compared the range versions with a for-loop. For integers and longs or high stride amounts the time is roughly equal, but for bytes with low stride amounts it can be up to twice as slow. https://run.dlang.io/is/BoTflQ 50 Mb array, type = byte, stride = 3, compiler = LDC -O4 -release For-loop 18 ms Fill(0) 33 ms each! 33 ms With stride = 13: For-loop 7.3 ms Fill(0) 7.5 ms each! 7.8 ms This is why I wanted to make sure! I would be using it for a stride of 2 and it seems it might have doubled the cost for no other reason than using ranged. Ranges are great but one can't reason about what is happening in then as easy as a direct loop so I wanted to be sure. Thanks for running the test!
[Issue 18934] std.concurrency receive throws assertion failure if message is a struct containing const data
https://issues.dlang.org/show_bug.cgi?id=18934 Steven Schveighoffer changed: What|Removed |Added Summary|std.concurrency receive |std.concurrency receive |throws assertion failure if |throws assertion failure if |message is a struct of |message is a struct |struct |containing const data --
Re: GitHub could be acquired by Microsoft
On Monday, 4 June 2018 at 19:26:23 UTC, Joakim wrote: On Monday, 4 June 2018 at 19:06:52 UTC, Maksim Fomin wrote: Unlikely, you don't spend $7.5 billion on a company because you want to send a message that you're a good dev tools company, then neglect it. You have no idea about how big corporations' management spends money. As with Nokia and Skype - I don't know whether it was initially a plan to destroy products or management was just silly. I suggest you look at their online slides linked from the Nadella blog post to see their stated plan, such as integrating github into VS Code more: http://aka.ms/ms06042018 and likely vastly overpaid for an unprofitable company in the first place :) this is exactly how such deals are done - paying $7.5 bl. for nonprofitable company. Unfortunately, their books are unavailable because they are private company, but scarce information in the web suggests that in most of their years they have losses. Just as rough estimate: to support $7.5 bl valuation Microsoft must turn -$30 ml. net loss company into business generating around $750 ml. for many years. There is no way to get these money from the market. Alternatively, the project can have payoff if something is broken and Microsoft cash flows increase by $750 ml. This is more likely... but they emphasize that they intend to keep github open and independent. They can claim anything which suits best their interests right now. Or, as alternative, github can be broken in a such way, that their promises on surface are kept. Business is badly compatible with opensource by design.
Re: GitHub could be acquired by Microsoft
On 6/4/18 2:46 PM, Anton Fediushin wrote: Of course MS does, since they spent $5 billion on it. They will try their best to make profit out of it, just like they did with LinkedIn. $7.5 billion. -Steve
Re: GitHub could be acquired by Microsoft
On 6/3/18 11:51 PM, Anton Fediushin wrote: This is still just a rumour, we'll know the truth on Monday (which is today). Some articles about the topic: https://fossbytes.com/microsoft-github-aquisition-report/ https://www.theverge.com/2018/6/3/17422752/microsoft-github-acquisition-rumors What's your opinion about that? Will you continue using GitHub? Of course. Both GitLab and Bitbucket can be used instead to host your D projects - dub registry supported them for a while now. I use both bitbucket and github. I think I will simply continue to use what makes sense at the time (as Jonathan pointed out, hosting a private repository is free on bitbucket). IMHO Microsoft isn't the type of company I want to see behind the GitHub. Maybe I am wrong since Microsoft has both money and programmers to improve it further, I just don't trust them too much which is the right thing to do when dealing with companies. This means that I will move my repositories elsewhere and use GitHub just to contribute to other projects. I don't know if it makes any difference to me. Sure, they have infrastructure and market share, but all that changes if they do something really annoying. There are good competing sites, and people will just move their stuff. I'm sure it wouldn't take long for someone to make software that ports your entire github project to gitlab or whatever, maybe it already exists. Microsoft just isn't the same big bad company that once paid for Linux licenses from SCO group to fund their lawsuit against Linux. This past year, they actually incorporated part of Linux into their OS! I don't think this is necessarily going to be bad for github. One thing I have read that is intriguing: if you are a Microsoft competitor and you have private-source repos at github, how do you feel about that? -Steve
Re: D on top of Hacker News!
On Monday, 4 June 2018 at 19:21:22 UTC, Ethan wrote: On Monday, 4 June 2018 at 19:17:47 UTC, I love Ice Cream wrote: It seems you guys are undercutting the results because you don't like them: Never mind that it is a commonly accepted criticism of the Tiobe index. Someone on the internet wants to strawman, so it must be valid! (The only source you listed there that would give unbiased search results is Wikipedia. Every other aggregate engine weighs results per user. Can you name something without valid criticisms? Things could always be done better. But that doesn't mean they aren't useful. In this case it isn't meant to be an all encompassing answer, just a viewpoint that suggests a particular answer.
Re: D on top of Hacker News!
On Monday, 4 June 2018 at 19:17:47 UTC, I love Ice Cream wrote: On Monday, 4 June 2018 at 16:05:24 UTC, rikki cattermole wrote: On 05/06/2018 3:56 AM, I love Ice Cream wrote: On Monday, 4 June 2018 at 11:14:42 UTC, bauss wrote: On Sunday, 3 June 2018 at 17:40:46 UTC, I love Ice Cream wrote: Is D really a top 20 language? I don't remember seeing it anywhere close to the top 20. https://www.tiobe.com/tiobe-index/ has them in 31 Top comment is kind of depressing. Tiobe is based on Google searches, so it's not relevant anymore. Since when is Google not relevant? Google modifies search results per person/client and can hide results out right if it chooses to (unconfirmed, but its a good guess). When it comes to analysis it does not qualify as a research source anymore. It is merely a starting point for your research and does not play a major role. It seems you guys are undercutting the results because you don't like them: The index covers searches in Google, Google Blogs, MSN, Yahoo!, Baidu, Wikipedia and YouTube. http://githut.info/ http://pypl.github.io/PYPL.html http://sogrady-media.redmonk.com/sogrady/files/2018/03/lang.rank_.118.png https://spectrum.ieee.org/computing/software/the-2017-top-programming-languages https://insights.stackoverflow.com/survey/2016 Looks consistent with other results.
Re: GitHub could be acquired by Microsoft
On Monday, 4 June 2018 at 19:06:52 UTC, Maksim Fomin wrote: On Monday, 4 June 2018 at 08:42:08 UTC, Walter Bright wrote: On 6/3/2018 8:51 PM, Anton Fediushin wrote: This is still just a rumour, we'll know the truth on Monday (which is today). We'll stay on Github as long as it continues to serve our interests, which it has done very well, and I have no reason to believe will change. We have a number of ties to Microsoft: 1. It's just down the street. 2. Many D users work at Microsoft. 3. Microsoft has always been helpful and supportive of Digital Mars, note the files licensed from Microsoft in the distribution. 4. Microsoft has invited myself and Andrei to speak at Microsoft from time to time. 5. Microsoft hosts the nwcpp.org meetings, which provide a venue for me to try out D presentations to a friendly crowd. 6. Microsoft has been generous with helping me solve some vexing compatibility problems from time to time. OK, so Digital Mars is in good relationship with Microsoft (I am surprised because have never heard about it). However, judging by Microsoft acqusition experience my prediction is that github will slowly but surely degradate (as suggested on some forums, everything will be firstly switched to Microsoft account - to track data, then everything will be mangled by ads, then some features deemed unnecessary by Microsoft will be removed, then linux will be badly supoorted, then some features incompatible with Microsoft services will stop working, then servers will start work poorly like skype...). P.S. My second reaction after reading news (after shock) was to visit D forum. Unlikely, you don't spend $7.5 billion on a company because you want to send a message that you're a good dev tools company, then neglect it. I suggest you look at their online slides linked from the Nadella blog post to see their stated plan, such as integrating github into VS Code more: http://aka.ms/ms06042018 Of course, this is Microsoft: they probably won't execute that plan well, and likely vastly overpaid for an unprofitable company in the first place, but they emphasize that they intend to keep github open and independent.
Re: D on top of Hacker News!
On Monday, 4 June 2018 at 19:17:47 UTC, I love Ice Cream wrote: It seems you guys are undercutting the results because you don't like them: Never mind that it is a commonly accepted criticism of the Tiobe index. Someone on the internet wants to strawman, so it must be valid! (The only source you listed there that would give unbiased search results is Wikipedia. Every other aggregate engine weighs results per user.
Re: D on top of Hacker News!
On Monday, 4 June 2018 at 16:05:24 UTC, rikki cattermole wrote: On 05/06/2018 3:56 AM, I love Ice Cream wrote: On Monday, 4 June 2018 at 11:14:42 UTC, bauss wrote: On Sunday, 3 June 2018 at 17:40:46 UTC, I love Ice Cream wrote: Is D really a top 20 language? I don't remember seeing it anywhere close to the top 20. https://www.tiobe.com/tiobe-index/ has them in 31 Top comment is kind of depressing. Tiobe is based on Google searches, so it's not relevant anymore. Since when is Google not relevant? Google modifies search results per person/client and can hide results out right if it chooses to (unconfirmed, but its a good guess). When it comes to analysis it does not qualify as a research source anymore. It is merely a starting point for your research and does not play a major role. It seems you guys are undercutting the results because you don't like them: The index covers searches in Google, Google Blogs, MSN, Yahoo!, Baidu, Wikipedia and YouTube.
Re: GitHub could be acquired by Microsoft
On Monday, 4 June 2018 at 08:42:08 UTC, Walter Bright wrote: On 6/3/2018 8:51 PM, Anton Fediushin wrote: This is still just a rumour, we'll know the truth on Monday (which is today). We'll stay on Github as long as it continues to serve our interests, which it has done very well, and I have no reason to believe will change. We have a number of ties to Microsoft: 1. It's just down the street. 2. Many D users work at Microsoft. 3. Microsoft has always been helpful and supportive of Digital Mars, note the files licensed from Microsoft in the distribution. 4. Microsoft has invited myself and Andrei to speak at Microsoft from time to time. 5. Microsoft hosts the nwcpp.org meetings, which provide a venue for me to try out D presentations to a friendly crowd. 6. Microsoft has been generous with helping me solve some vexing compatibility problems from time to time. OK, so Digital Mars is in good relationship with Microsoft (I am surprised because have never heard about it). However, judging by Microsoft acqusition experience my prediction is that github will slowly but surely degradate (as suggested on some forums, everything will be firstly switched to Microsoft account - to track data, then everything will be mangled by ads, then some features deemed unnecessary by Microsoft will be removed, then linux will be badly supoorted, then some features incompatible with Microsoft services will stop working, then servers will start work poorly like skype...). P.S. My second reaction after reading news (after shock) was to visit D forum.
Re: GitHub could be acquired by Microsoft
On Monday, 4 June 2018 at 18:17:24 UTC, Joakim wrote: On Monday, 4 June 2018 at 09:47:58 UTC, Anton Fediushin wrote: Oh look, rumours are confirmed: https://itsfoss.com/microsoft-github/ MS bought GitHub for $5 billion. It's official, Nat Friedman, formerly of Xamarin, is the new CEO: https://blog.github.com/2018-06-04-github-microsoft/ Also, there's an article from Satya Nadella, current CEO of Microsoft: https://blogs.microsoft.com/blog/2018/06/04/microsoft-github-empowering-developers/ MS is basically selling a story to Wall Street, "Everything new we tried since Windows and Office has failed abysmally, so we've learned our lesson and will be the business software company from now on," hence buying LinkedIn, pushing Azure, and now buying Github. I don't expect this new management direction to go any better. Of course MS does, since they spent $5 billion on it. They will try their best to make profit out of it, just like they did with LinkedIn.
Re: stride in slices
On Monday, 4 June 2018 at 18:11:47 UTC, Steven Schveighoffer wrote: BTW, do you have cross-module inlining on? I wonder if that makes a difference if you didn't have it on before. (I'm somewhat speaking from ignorance, as I've heard people talk about this limitation, but am not sure exactly when it's enabled) I don't know much about this either. Clang has link-time optimization with -O4, but looking at the --help of LDC it turns out -O4 is equivalent to -O3 for D. Maybe someone else knows?
Re: GitHub could be acquired by Microsoft
On Monday, 4 June 2018 at 09:47:58 UTC, Anton Fediushin wrote: Oh look, rumours are confirmed: https://itsfoss.com/microsoft-github/ MS bought GitHub for $5 billion. It's official, Nat Friedman, formerly of Xamarin, is the new CEO: https://blog.github.com/2018-06-04-github-microsoft/ MS is basically selling a story to Wall Street, "Everything new we tried since Windows and Office has failed abysmally, so we've learned our lesson and will be the business software company from now on," hence buying LinkedIn, pushing Azure, and now buying Github. I don't expect this new management direction to go any better.
Re: stride in slices
On 6/4/18 1:40 PM, Dennis wrote: On Monday, 4 June 2018 at 15:43:20 UTC, Steven Schveighoffer wrote: Note, it's not going to necessarily be as efficient, but it's likely to be close. I've compared the range versions with a for-loop. For integers and longs or high stride amounts the time is roughly equal, but for bytes with low stride amounts it can be up to twice as slow. https://run.dlang.io/is/BoTflQ 50 Mb array, type = byte, stride = 3, compiler = LDC -O4 -release For-loop 18 ms Fill(0) 33 ms each! 33 ms With stride = 13: For-loop 7.3 ms Fill(0) 7.5 ms each! 7.8 ms Interesting! BTW, do you have cross-module inlining on? I wonder if that makes a difference if you didn't have it on before. (I'm somewhat speaking from ignorance, as I've heard people talk about this limitation, but am not sure exactly when it's enabled) -Steve
Re: Driving Continuous Improvement in D
On 6/4/18 1:51 PM, Joakim wrote: On Monday, 4 June 2018 at 15:52:24 UTC, Steven Schveighoffer wrote: On 6/2/18 3:23 AM, Mike Parker wrote: [...] I like the article, but was taken aback a bit by this quote: "for example, a PR to fix a bug in a specific piece of code mustn’t also edit the documentation of that function." [...] I think he was talking about _unrelated_ doc changes. Well, how unrelated? If, for instance, you are changing the docs to accommodate the new code, and notice a typo, I would be fine with fixing that, and have even ASKED for that. I guess I need a bigger clarification, as the way it reads is that we require people split their doc changes from their code changes, and that simply hasn't been the case. -Steve
Re: Driving Continuous Improvement in D
On Monday, 4 June 2018 at 15:52:24 UTC, Steven Schveighoffer wrote: On 6/2/18 3:23 AM, Mike Parker wrote: [...] I like the article, but was taken aback a bit by this quote: "for example, a PR to fix a bug in a specific piece of code mustn’t also edit the documentation of that function." [...] I think he was talking about _unrelated_ doc changes.
Re: stride in slices
On Monday, 4 June 2018 at 15:43:20 UTC, Steven Schveighoffer wrote: Note, it's not going to necessarily be as efficient, but it's likely to be close. -Steve I've compared the range versions with a for-loop. For integers and longs or high stride amounts the time is roughly equal, but for bytes with low stride amounts it can be up to twice as slow. https://run.dlang.io/is/BoTflQ 50 Mb array, type = byte, stride = 3, compiler = LDC -O4 -release For-loop 18 ms Fill(0) 33 ms each! 33 ms With stride = 13: For-loop 7.3 ms Fill(0) 7.5 ms each! 7.8 ms
Re: gRPC in D
On Monday, 4 June 2018 at 11:40:54 UTC, Nicholas Wilson wrote: On Monday, 4 June 2018 at 11:21:57 UTC, aberba wrote: At DConf 2018,there was a talk by ?? about blockchain and gRPC library for D came up. That was Kai Nacke. Thanks :)
Re: Pyd updates
On Monday, 4 June 2018 at 01:17:31 UTC, Norm wrote: On Monday, 4 June 2018 at 00:53:26 UTC, ROB wrote: On Wednesday, 12 July 2006 at 23:35:55 UTC, Kirk McDonald wrote: [...] has there been any updates since July 2006 there does not seem to be any new msg's since unless you have forked this forum to a new location. if you have please provide I am new to D I have been learning python for some time and thought Python and D would work well together. Also are there any Projects using it yet I would like to get involved and contribute if possible. Try this repo: https://github.com/ariovistus/pyd https://github.com/ariovistus/pyd/wiki https://github.com/kaleidicassociates/autowrap makes using PyD a little simpler.
[Issue 18809] Improve error message on nonexistent property
https://issues.dlang.org/show_bug.cgi?id=18809 Nick Treleaven changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |WORKSFORME --
Re: Beta 2.080.1
On Mon, 2018-06-04 at 11:14 -0400, Steven Schveighoffer via […] > I just submitted a PR to fix > https://issues.dlang.org/show_bug.cgi?id=18934 > > I used stable. I'm hoping it could get in for this release. > > https://github.com/dlang/phobos/pull/6544 > > -Steve So am I. -- Russel. === Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Roadm: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk signature.asc Description: This is a digitally signed message part
Re: D on top of Hacker News!
On 05/06/2018 3:56 AM, I love Ice Cream wrote: On Monday, 4 June 2018 at 11:14:42 UTC, bauss wrote: On Sunday, 3 June 2018 at 17:40:46 UTC, I love Ice Cream wrote: Is D really a top 20 language? I don't remember seeing it anywhere close to the top 20. https://www.tiobe.com/tiobe-index/ has them in 31 Top comment is kind of depressing. Tiobe is based on Google searches, so it's not relevant anymore. Since when is Google not relevant? Google modifies search results per person/client and can hide results out right if it chooses to (unconfirmed, but its a good guess). When it comes to analysis it does not qualify as a research source anymore. It is merely a starting point for your research and does not play a major role.
Re: DIP Draft Review News
On 05/06/2018 3:45 AM, Yuxuan Shui wrote: On Monday, 4 June 2018 at 11:28:26 UTC, rikki cattermole wrote: Thought: Couldn't we have alternative names in the parameter instead? E.g. ```D void foo(int x/x0/width, int y/y0/height){} ``` This intuitively means that any combination of the parameter names would work (e.g. (x, y0), (width, y)), which is not what we want. You will need to amend the DIP to confirm that a primary use case (alternative names) is not usable with templated functions if you do not want to do an alternative method.
Re: D on top of Hacker News!
On Monday, 4 June 2018 at 11:14:42 UTC, bauss wrote: On Sunday, 3 June 2018 at 17:40:46 UTC, I love Ice Cream wrote: Is D really a top 20 language? I don't remember seeing it anywhere close to the top 20. https://www.tiobe.com/tiobe-index/ has them in 31 Top comment is kind of depressing. Tiobe is based on Google searches, so it's not relevant anymore. Since when is Google not relevant?
Re: Driving Continuous Improvement in D
On 6/2/18 3:23 AM, Mike Parker wrote: In this post for the D Blog, Jack Stouffer details how dscanner is used in the Phobos development process to help improve code quality and fight entropy. The blog: https://dlang.org/blog/2018/06/02/driving-continuous-improvement-in-d/ reddit: https://www.reddit.com/r/programming/comments/8nyzmk/driving_continuous_improvement_in_d/ I like the article, but was taken aback a bit by this quote: "for example, a PR to fix a bug in a specific piece of code mustn’t also edit the documentation of that function." Really? I both was not aware of this policy, and don't understand why you wouldn't fix the docs at the same time. Can you elaborate? I'll give you an example of what I was thinking of. Let's say you have a function foo: /** * foo takes a parameter and returns true if ... */ bool foo(T)(T t) { ... } And you realize foo really should only take integer parameters: /** * foo takes integer parameters and returns true if ... */ bool foo(T)(T t) if (isIntegral!T) { ... } Why not both edit the function and fix the docs in the same PR? In fact, why would we *accept* the change without updating the docs? -Steve
Re: GitHub could be acquired by Microsoft
On Monday, 4 June 2018 at 15:08:01 UTC, Jonathan M Davis wrote: In many respects, they're better behaved than they used to be. They're biggest problems seem to have to do with what they're doing with Windows (e.g. tracking what you're doing and not letting you turn it off). It's certainly not desriable that they bought github, but it probably won't have any obvious effects for a while. The biggest concerns probably have to do with collecting data on users, and github was doutblessly doing that already. - Jonathan M Davis At least in the EU we had a big GDPR Windows Update that let you disable every tracking. All in all an amazing law (for the user) that would make sense for regulators to import.
Software validation
Does D have any methods of validating code in a natural manner besides unit tests and contracts? I'm specifically thinking of validating mathematical calculations and boolean operations that could depend on very improbable scenarios but are technically invalid logic. These issues tend to creep up in calculations that involve floating points due to various reasons or comparisons that mistakenly use > for >= or vice versa. If I have a variable such as a buffer which has a length and an offset in to that buffer is calculated using double precision then rounding errors could cause the offset to except the length and create an access violation. To be able to theoretically test all the possibilities all valid inputs would need to be checked. One can setup unit tests to test these possibilities but it can be difficult to cover all cases in even a semi-complex program. Just curious if something exists that allows for mathematical validation such code in an relatively canonical way. This isn't too hard for pure functions but dealing with non-pure functions can be a pain.
Re: DIP Draft Review News
On Monday, 4 June 2018 at 11:28:26 UTC, rikki cattermole wrote: Thought: Couldn't we have alternative names in the parameter instead? E.g. ```D void foo(int x/x0/width, int y/y0/height){} ``` This intuitively means that any combination of the parameter names would work (e.g. (x, y0), (width, y)), which is not what we want.
Re: stride in slices
On 6/3/18 7:13 AM, DigitalDesigns wrote: On Sunday, 3 June 2018 at 07:30:56 UTC, Meta wrote: On Saturday, 2 June 2018 at 18:49:51 UTC, DigitalDesigns wrote: Proposal: [a..b;m] m is the stride, if ; is not a good char then |, :, !, or # could be good chars. This is exactly what std.range.stride does. The syntax [a..b;m] directly translates to [a..b].stride(m). So, can I do X[a..b].stride(m) = 0; X[a..b].stride(m).fill(0); ? Just curious because if it is exactly the same notion then I should be able to do it, right? You are confusing range and array syntax. All of what you want exists, but isn't necessarily using the same syntax. Of course, I'm sure another hoop could be created to jump through and it will work, will it still be exactly the same though? If there is an efficient and optimal setting so one could get the same effect, then I guess it might be a direct translation. If not then it isn't. What I am looking for is a sort of zeromemory or memset with stride. It should not allocate a new array or be significantly slower. I'd like some proof that they are "equivalent" such as a disassembly or a profiling... just to satisfy my own skepticism. fill is what you are looking for. Note, it's not going to necessarily be as efficient, but it's likely to be close. -Steve
Re: stride in slices
On Sunday, 3 June 2018 at 11:13:52 UTC, DigitalDesigns wrote: On Sunday, 3 June 2018 at 07:30:56 UTC, Meta wrote: On Saturday, 2 June 2018 at 18:49:51 UTC, DigitalDesigns wrote: Proposal: [a..b;m] m is the stride, if ; is not a good char then |, :, !, or # could be good chars. This is exactly what std.range.stride does. The syntax [a..b;m] directly translates to [a..b].stride(m). So, can I do X[a..b].stride(m) = 0; You can use std.algorithm.iteration.each to modify a range in-place: https://run.dlang.io/is/2jjZHh
Re: Line endings when redirecting output to file on windows.
On 6/3/18 12:24 PM, Bastiaan Veelo wrote: On Sunday, 3 June 2018 at 15:42:48 UTC, rikki cattermole wrote: On 04/06/2018 3:24 AM, Bastiaan Veelo wrote: I need some help understanding where extra '\r' come from when output is redirected to file on Windows. First, this works correctly: rdmd --eval="(\"hello\" ~ newline).toFile(\"out.txt\");" As expected, out.txt contains "hello\r\n". I would expect the following to do the same, but it doesn't: rdmd --eval="write(\"hello\" ~ newline);" > out.txt Now out.txt contains "hello\r\r\n". Who is doing the extra conversion here, and how do I stop it? Thanks! Bastiaan. That would be cmd. Not sure you can stop it without piping it after rdmd to remove the \r. No, it's not cmd. It's File, or more specifically, FILE * from C. Thanks. It is starting to dawn on me that I shouldn't use `newline` and `toFile` to write text files, but rather always use "\n" as line ending and use `write` for both writing to stdout and file. rdmd --eval="File(\"out.txt\", \"w\").write(\"hello\n\");" and rdmd --eval="write(\"hello\n\");" > out.txt both produce "hello\r\n" on Windows. Am I correct, or is there a more idiomatic way of writing strings to text files? Windows C library has this bizarro mode for FILE * called "text" mode, which is the default. In this mode, it scans all output, and anywhere it sees a '\n', it replaces it with "\r\n". the `newline` variable contains "\r\n". So what you have done is, output "hello\r\n", and File helpfully replaces that "\n" to "\r\n", giving you "\r\r\n". The correct answer, as you have guessed, is don't use newline :) Just use \n. It's portable, and line endings on Windows are less important these days. If you want to turn off text mode, set the mode to binary, as this should work (note the "wb" mode): rdmd --eval="File(\"out.txt\", \"wb\").write(\"hello\" ~ newline);" Note there is also a rawWrite method, which temporarily turns it into binary mode, and will work as well: rdmd --eval="File(\"out.txt\", \"w\").rawWrite(\"hello\" ~ newline);" -Steve
Re: Convert a huge SQL file to CSV
On 6/3/18 2:04 AM, biocyberman wrote: On Friday, 1 June 2018 at 10:15:11 UTC, Martin Tschierschke wrote: On Friday, 1 June 2018 at 09:49:23 UTC, biocyberman wrote: I need to convert a compressed 17GB SQL dump to CSV. A workable solution is to create a temporary mysql database, import the dump, query by python, and export. But i wonder if there is something someway in D to parse the SQL file directly and query and export the data. I imagine this will envolve both parsing and querying because the data is stored in several tables. I am in the process of downloading the dump now so I can’t give excerpt of the data. You don't need python: https://michaelrigart.be/export-directly-mysql-csv/ SELECT field1, field2 FROM table1 INTO OUTFILE '/path/to/file.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' FIELDS ESCAPED BY '\' LINES TERMINATED BY '\n'; Most important: INTO OUTFILE : here you state the path where you want MySQL to store the CSV file. Keep in mind that the path needs to be writeable for the MySQL user You can write a parser for SQL in D, but even if the import into mysql would take some time, it's only compute time and not yours. Regards mt. Ah yes, thank you Martin. I forgot that we can do a "batch" SQL query where mysql server can parse and run query commands. So no need for Python. But I am still currently waiting for the import to finish the importing of mysql dump. It took 18 hours and is still counting! The whole mysql database is 68GB at the moment. Can we avoid the import and query the database dump directly? Well, it could be done quick-and-dirty by simply ignoring most of SQL syntax, and focusing on the actual things used in the dump. mysqldump is pretty consistent with how it outputs data. You might even be able to do it with an awk script :) -Steve
Re: Beta 2.080.1
On 6/4/18 7:44 AM, Martin Nowak wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 First beta for the 2.080.1 patch release. Comes with a handful of fixes. http://dlang.org/download.html#dmd_beta http://dlang.org/changelog/2.080.1.html Please report any bugs at https://issues.dlang.org - -Martin -BEGIN PGP SIGNATURE- iQIzBAEBCgAdFiEEpzRNrTw0HqEtE8TmsnOBFhK7GTkFAlsVJfgACgkQsnOBFhK7 GTkr5Q//Se1gg7PfPoywWLdBkiO7sSqaZf0BFsCXFbaB8tnXaS0IZ7xyHej2Lun8 VNnWi1kPBXKBt6JLpcBU63u1Gl6IuBDVjPG4wJArb6QrzL73bL2DgBfASm+ZnzWb VzxUJTmlaCIw6FsXAMEMy4L7p+VDHRN4zWBLgh24r2aEuJ5jacUyWRZG3L5MStAT 3QkOCjYpVsGg6QPklfJHbRI0zFv8qZKGP+ab1vOegfObkrcqF1g5y2e+Bigla8MJ llhvJWBtmDJYklhDXZN3oOL66c2JykScHa9qArKb45Xk6wtSdCJGDhbpY2wrLHcc 4SnOd6ZxPQ0M0ON/bL5Fm7BNebT2QQZWTdasHVXMsokV9uW9FKX/BA1VOsuJvvb9 /mmaY1MUAb1S4y1+RoY6nfN9G8RH9S5vujV9F4kWjnH0J3rc66lPMfOnOU1Wckup APaXg2L10sZaQ4Z+a4Gh5a5synWkUJB09q4jBKb90gTUsiN6Erp4GCAZ6PKRbkJ1 Z6jK8yAgrstCi7ctg0QYrH6EGBqigAP13itbBKfOmB0DH010oNY1i9GB9vc1zvSM jpdoCYX1pe4ljeMZXZDiTyGTM5g4TklBsdvwC5PTuvvFKNvU4K8RKg6Zy4FqHq0R bEl63PWSmE3hrMBjrk41qxw/NEs5UgtkPYBl1aWv49+EfIhXMyA= =W/Qn -END PGP SIGNATURE- I just submitted a PR to fix https://issues.dlang.org/show_bug.cgi?id=18934 I used stable. I'm hoping it could get in for this release. https://github.com/dlang/phobos/pull/6544 -Steve
[Issue 18934] std.concurrency receive throws assertion failure if message is a struct of struct
https://issues.dlang.org/show_bug.cgi?id=18934 Steven Schveighoffer changed: What|Removed |Added Keywords||pull, rejects-valid Hardware|x86_64 |All OS|Linux |All --- Comment #3 from Steven Schveighoffer --- PR: https://github.com/dlang/phobos/pull/6544 --
Re: GitHub could be acquired by Microsoft
On Monday, June 04, 2018 14:51:24 Kagamin via Digitalmars-d-announce wrote: > On Monday, 4 June 2018 at 05:50:26 UTC, Anton Fediushin wrote: > > I can think of hundreds of things what can go wrong including: > > forcing users to use Microsoft accounts > > That didn't happen to skype yet. > MS recently tries to mend its reputation, though the past will > linger for a while. In many respects, they're better behaved than they used to be. They're biggest problems seem to have to do with what they're doing with Windows (e.g. tracking what you're doing and not letting you turn it off). It's certainly not desriable that they bought github, but it probably won't have any obvious effects for a while. The biggest concerns probably have to do with collecting data on users, and github was doutblessly doing that already. - Jonathan M Davis
Re: GitHub could be acquired by Microsoft
On Monday, 4 June 2018 at 05:50:26 UTC, Anton Fediushin wrote: I can think of hundreds of things what can go wrong including: forcing users to use Microsoft accounts That didn't happen to skype yet. MS recently tries to mend its reputation, though the past will linger for a while.
Re: Confusion/trying to understand CTFE keywords
On Monday, June 04, 2018 14:05:28 gdelazzari via Digitalmars-d-learn wrote: > On Monday, 4 June 2018 at 03:18:05 UTC, Jonathan M Davis wrote: > > So, while static _seems_ somewhat inconsistent at first, the > > way it's used is pretty consistent overall. The main > > inconsistency is the places where static is essentially > > implicit rather than explicit (such as module-level variables > > or structs nested in other structs or classes). > > I'm not getting this however. I mean, sure, it's totally > consistent if you consider the cases you described, but what I > meant is that in a piece of code like > > static if (a == 3) > { >// stuff... > } > static else if (a == 2) > { >// other stuff... > } > else > { >// etc... > } > > the "static" keyword has a different meaning, in this case it > means that the if gets evaluated at compile time. This is the > kind of inconsistency I was talking about. Yeah, that would be inconsistent with the others. I'd forgotten about those when I wrote my reply. Basically, in the case of static if, static foreach, and static assert, it just means that it's the compile-time variant of the construct in question. The keyword reuse works well, but it is inconsistent with the other uses. I guess that it could be argued that they don't have a context, because they're done at compile-time, whereas the runtime variants are run within a specific context, but I think that that's stretching things. However, static used with static if, static foreach, and static assert seems to be very easy for people to understand, whereas some of the other ways it's used often cause confusion at first. Certainly, it seems to be far less confusing for folks than using enum for manifest constants has been. > Of course "static if" doesn't sound bad at all, it somehow > conveys the idea of what it actually does. My confusion was > regarding the fact that "static" is also used for other things > (the ones you described) and then I would also expect that, to > define a compile-time value, I would use the same keyword again, > like > > static myCompileTimeValue = 5 * 2; > > instead of > > enum myCompileTimeValue = 5 * 2; > > of course this wouldn't be possible with the keyword "static", > since `static val = 4;` would have a totally different meaning in > the language, and that's why "enum" is used I guess. But then why > not `enum if (...) { ... }`? Again, forget about the keywords > themselves, I'm just talking about using the same one which is > different from keywords that also do other different (or > completely different, or slightly different, but still different) > things. I get that "enum" has somewhat of a sense, when doing > `enum val = 4;`, after reading the related book chapter, but > yeah... that's not the problem, as I hope you now understood what > I mean. Using enum instead of static in contexts such as static if would be using enum in a drastically different context from where enum is normally used (the issue of manifest constants already causes a fair bit of confusion), whereas static seems fairly natural there, and folks are used to static meaning multiple things. In both C/C++ and D, static gets used in multiple contexts where most folks would think that they were completely different when in fact it's possible to come up with a definition that covers most or all of the contexts in which it's used. So, regardless of whether static is actually used consistently, it doesn't feel consistent. So, reusing it for static if is likely to seem much more reasonable to many folks, whereas I think that relatively few would think that reusing enum for that would have made sense. But language design is a bit of an art. It's an interesting combination of doing what makes sense from the standpoint of the compiler writer and what makes sense from the standpoint of the programmer using the language. > This argument I started was kind of a first-impression as a > newcomer to the language, with the hope of getting to better > understand it. Also I thought it's beneficial for the community > to have feedback from new users. Constructive feedback is always welcome. And even if nothing in the language gets changed because of feedback, it does help us understand where people need help learning the language. - Jonathan M Davis
Re: Confusion/trying to understand CTFE keywords
On Monday, 4 June 2018 at 03:18:05 UTC, Jonathan M Davis wrote: I think that part of your problem here comes from the fact that you think of enum or static are "CTFE keywords." That's not what they are at all. Yes, they can trigger CTFE, but they're not the only way. ... Thank you very much for the extensive explanation, I really appreciate it. I'm slowly getting the point here, also by reading the relevant parts of the book you linked. I was aware of the meaning of the static keyword (coming from other languages where it has similar meaning), but your re-cap was great anyway since I now have a clear view of how exactly works in D with the various features of the language. So, while static _seems_ somewhat inconsistent at first, the way it's used is pretty consistent overall. The main inconsistency is the places where static is essentially implicit rather than explicit (such as module-level variables or structs nested in other structs or classes). I'm not getting this however. I mean, sure, it's totally consistent if you consider the cases you described, but what I meant is that in a piece of code like static if (a == 3) { // stuff... } static else if (a == 2) { // other stuff... } else { // etc... } the "static" keyword has a different meaning, in this case it means that the if gets evaluated at compile time. This is the kind of inconsistency I was talking about. Of course "static if" doesn't sound bad at all, it somehow conveys the idea of what it actually does. My confusion was regarding the fact that "static" is also used for other things (the ones you described) and then I would also expect that, to define a compile-time value, I would use the same keyword again, like static myCompileTimeValue = 5 * 2; instead of enum myCompileTimeValue = 5 * 2; of course this wouldn't be possible with the keyword "static", since `static val = 4;` would have a totally different meaning in the language, and that's why "enum" is used I guess. But then why not `enum if (...) { ... }`? Again, forget about the keywords themselves, I'm just talking about using the same one which is different from keywords that also do other different (or completely different, or slightly different, but still different) things. I get that "enum" has somewhat of a sense, when doing `enum val = 4;`, after reading the related book chapter, but yeah... that's not the problem, as I hope you now understood what I mean. If you haven't yet, I'd suggest reading http://ddili.org/ders/d.en/index.html Even if you understand most of the content already, it will probably help fill in some of the holes you have in your understanding, and depending on how much you've done with D, it may contain quite a bit of new content that will help you out. - Jonathan M Davis Again, thank you very much for the time you took to answer with that amount of quality information, I really appreciate it. And I also appreciate the suggestion about the book, which I'll read as soon as I can. Maybe I'm missing somewhat of a broader view of the language that, once acquired, will make me understand the real meanings/reasons behind those keywords. This argument I started was kind of a first-impression as a newcomer to the language, with the hope of getting to better understand it. Also I thought it's beneficial for the community to have feedback from new users. Thank you very much again, Giacomo
Re: ost to pst convertes
On Monday, 26 March 2018 at 08:36:42 UTC, Blackwellwalker wrote: Hi, My user used exchange in the past and now uses pop3 client... exchange doesn't exist anymore. her new pop client only has one pst data file... one can't import the ost files. How convert ost to pst? Need OST to PST Converter recommendations Due to hard drive fails, i lost my data. But i need to recover mail data from office 365 outlook 2013. So, i need a some OST to PST converter recommendation, if you have used a good one. Thanks in advance for your time and recommendations! --- Quick software for exchange OST recovery, use this free OST to PST Converter Software that removes Synchronizing error, File size error, Virus attacks and Trojan errors and repair damaged and corrupted OST File and convert OST File data into several kinds of formats such as- PST, EML, MSG, H TML, EMLX, MBOX, vCard and office 365 format along with emails, contacts, calendars, task, notes, inbox items, outbox items and appointments. OST to PST Software provides demo facility to restore 20 emails per folders into every format and supports all MS Outlook versions upto 2016. http://www.regzasoftware.com/ost-recovery.html OST Recovery Software with no trouble recover selective single and multiple OST File and convert OST File with emails and attachments. MS Outlook installation not required. It supports free demo version that allows users view all software functionality and let users 25 emails per folders into every format. Free to Download Software:- http://www.regzasoftware.com/ost-to-pst-converter/
SysInspire Free Exchange Recovery Software
Free Exchange Recovery Software helps users fluently recover the exchange mailboxes data and convert exchange to PST Outlook file with overall data present in it and also export mailbox from EDB to PST with maintains emails formatting and attachments. It will extract EDB emails, contacts, task, notes, calendars and etc. Recover EDB to PST File by using this EDB to PST Recovery Software that successfully works to recover complete items of EDB file & Export exchange mailboxes to PST, MSG, EML, EMLX and MBOX format. Software never lose any information from EDB file during conversion and never create problem during EDB to PST Conversion. Through this brilliant EDB Recovery application the entire users can solve their problem and also recover the deleted folders mailboxes items and save them into PST and other format. After converting all database they can open them in suite mail application like- MS Outlook application, Windows, Windows live mail, Thunderbird and Outlook express. Exchange Email Recovery Software successfully convert the emails from priv1.edb file and pub1.ebd file into PST Outlook file. It is compatible to MS Office MS Office (both 32 bit and 64 bit) 2016, 2013, 2010 and below versions. Even when EDB Files are formatted by Unicode characters, this software repair and recover all of them and also compatible to Exchange Server 2016, 2013, 2010 to 97. Free 2016 Exchange EDB Recovery is possible with this software and also preview all database of EDB file. It is compatible to Windows 10, 8.1, 8, Windows Server 2012, Windows Server 2008 R2, Windows 7, Vista, XP, 2008, 2003, 2002, 2000. Read more:- http://www.sysinspire.com/edb-to-pst-converter/
[Issue 18868] Separate compilation generates two static this functions, runs it twice
https://issues.dlang.org/show_bug.cgi?id=18868 FeepingCreature changed: What|Removed |Added CC||default_357-l...@yahoo.de --- Comment #4 from FeepingCreature --- This also fixes this issue: static foreach (entry; ["foo", "bar", "baz"]) { unittest { writeln(entry); } } foo foo foo which happened because all three unittest blocks had the same identifier, based on line number. --
Re: Beta 2.080.1
On 06/04/2018 02:25 PM, MrSmith wrote: > Is [1] included in that release? > [1] https://issues.dlang.org/show_bug.cgi?id=18821 Thanks for the reminder :), the fix was merged into master instead of stable. Just picked it over. We usually avoid cherry-picking as it leads to unnecessary merge conflicts.
Re: Beta 2.080.1
On Monday, 4 June 2018 at 11:44:31 UTC, Martin Nowak wrote: First beta for the 2.080.1 patch release. Comes with a handful of fixes. http://dlang.org/download.html#dmd_beta http://dlang.org/changelog/2.080.1.html Please report any bugs at https://issues.dlang.org - -Martin Is [1] included in that release? [1] https://issues.dlang.org/show_bug.cgi?id=18821
Re: D on top of Hacker News!
On Sunday, 3 June 2018 at 20:12:03 UTC, JakubJ wrote: On Sunday, 3 June 2018 at 16:58:23 UTC, Sameer Pradhan wrote: It was nice to read Walter's article from 2014... Wonder who posted it, and how long it will stay in the visibility range, but it was a nice feeling to see it at the top. -- Sameer Hi Sameer, I just discovered it today and posted it afterwards. Then, looked into this forum and surprise ;) . :-) However, I don't plan on jumping into D right now because I'm starting to use Elixir/OTP seriously at GSoC and between that and the finals at uni there's little time left. In case you missed it, Walter did an AMA and answered some of the issues raised in the HN comments.
Beta 2.080.1
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 First beta for the 2.080.1 patch release. Comes with a handful of fixes. http://dlang.org/download.html#dmd_beta http://dlang.org/changelog/2.080.1.html Please report any bugs at https://issues.dlang.org - -Martin -BEGIN PGP SIGNATURE- iQIzBAEBCgAdFiEEpzRNrTw0HqEtE8TmsnOBFhK7GTkFAlsVJfgACgkQsnOBFhK7 GTkr5Q//Se1gg7PfPoywWLdBkiO7sSqaZf0BFsCXFbaB8tnXaS0IZ7xyHej2Lun8 VNnWi1kPBXKBt6JLpcBU63u1Gl6IuBDVjPG4wJArb6QrzL73bL2DgBfASm+ZnzWb VzxUJTmlaCIw6FsXAMEMy4L7p+VDHRN4zWBLgh24r2aEuJ5jacUyWRZG3L5MStAT 3QkOCjYpVsGg6QPklfJHbRI0zFv8qZKGP+ab1vOegfObkrcqF1g5y2e+Bigla8MJ llhvJWBtmDJYklhDXZN3oOL66c2JykScHa9qArKb45Xk6wtSdCJGDhbpY2wrLHcc 4SnOd6ZxPQ0M0ON/bL5Fm7BNebT2QQZWTdasHVXMsokV9uW9FKX/BA1VOsuJvvb9 /mmaY1MUAb1S4y1+RoY6nfN9G8RH9S5vujV9F4kWjnH0J3rc66lPMfOnOU1Wckup APaXg2L10sZaQ4Z+a4Gh5a5synWkUJB09q4jBKb90gTUsiN6Erp4GCAZ6PKRbkJ1 Z6jK8yAgrstCi7ctg0QYrH6EGBqigAP13itbBKfOmB0DH010oNY1i9GB9vc1zvSM jpdoCYX1pe4ljeMZXZDiTyGTM5g4TklBsdvwC5PTuvvFKNvU4K8RKg6Zy4FqHq0R bEl63PWSmE3hrMBjrk41qxw/NEs5UgtkPYBl1aWv49+EfIhXMyA= =W/Qn -END PGP SIGNATURE-
[Issue 18934] std.concurrency receive throws assertion failure if message is a struct of struct
https://issues.dlang.org/show_bug.cgi?id=18934 Steven Schveighoffer changed: What|Removed |Added CC||schvei...@yahoo.com Assignee|nob...@puremagic.com|schvei...@yahoo.com --- Comment #2 from Steven Schveighoffer --- The issue comes from std.variant.Variant checking the wrong thing when it comes to constancy. A smaller test case: import std.variant; import std.stdio; struct S { const int x; } void main() { Variant v = S(1); writeln(v.get!S); // error } The issue is with the check inside std.variant to see if you can copy the given type to the requested type. The type matches, but the copy would normally fail because you can't overwrite const data. However, in the case of v.get!S, it's a move and not a copy. The check should be on moving the data, not copying. I have tested a fix, will submit a PR. --
[Issue 17580] Marking methods as synchronized is allowed despite spec
https://issues.dlang.org/show_bug.cgi?id=17580 RazvanN changed: What|Removed |Added CC||razvan.nitu1...@gmail.com --- Comment #1 from RazvanN --- PR: https://github.com/dlang/dmd/pull/8331 --
Re: gRPC in D
On Monday, 4 June 2018 at 11:21:57 UTC, aberba wrote: At DConf 2018,there was a talk by ?? about blockchain and gRPC library for D came up. That was Kai Nacke.
Re: DIP Draft Review News
On 04/06/2018 10:39 PM, Yuxuan Shui wrote: I've dwelt on this for a couple of months now, and keeping thinking on it myself is not going to help. That's why I'm asking for feedback. Hum Changes possible usage syntax, given that the only attribute that does this currently is @property which people want to remove (as it mostly does nothing), a pragma might be a better option. ```D pragma(namedParameters, true): ``` By making it a pragma, it also makes it an override for a future possible extension (e.g. my DIP with better syntax). So that it becomes a compiler extension not a language feature. If no future DIP to extend it happens, a dedicated attribute can be added instead (like you have). Changes summarized: 1. Overload resolution does not change 2. Arguments (named names gets erased as far as overload resolution is concerned) 3. When multiple definitions of a function prototype are found with types of parameters matching and is not templated then the names will go into a single definition in the AST for a given scope. These alternative names can be used for verification with named arguments, but all arguments names must match a single set of parameter names and cannot be mixed. Thought: Couldn't we have alternative names in the parameter instead? E.g. ```D void foo(int x/x0/width, int y/y0/height){} ``` This simplifies having to keep whole prototypes around (which can be a real pain especially with templates that it would otherwise not work for). 4. New calling syntax ``Identifier : ConditionalExpression`` FIXME: fix your DIP to that FYI, ``foo(width:x=7)`` probably isn't what you want to have supported. I'll copy this into the PR comments if I haven't misunderstood something big.
gRPC in D
At DConf 2018,there was a talk by ?? about blockchain and gRPC library for D came up. In summary, grpc a universal rpc framework by Google and can be implemented in any language. It enables you to call methods on a remote server from a client as if they're both on the same host. Its use http/http2 as its protocol and protobuffer as the schema for api definition. Its quite an interesting subject in large scale enterprise development and microservices. gRPC is now a good reason to use Go or Java for development...at least for distributed services...including blockchain. Its actually very powerful. There's a protobuffer implementation at code.dlang.org What remains is a D grpc implementation or bindings using the c++ or c version. You may read more about it at https://grpc.io. Huge potential.
Re: D on top of Hacker News!
On Sunday, 3 June 2018 at 17:40:46 UTC, I love Ice Cream wrote: Is D really a top 20 language? I don't remember seeing it anywhere close to the top 20. https://www.tiobe.com/tiobe-index/ has them in 31 Top comment is kind of depressing. Tiobe is based on Google searches, so it's not relevant anymore.
[Issue 18940] [std.net.curl]Can't run examples on page. cannot implicitly convert expression ... `char[]` to `string`
https://issues.dlang.org/show_bug.cgi?id=18940 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/14fe47491b0ad48a53609019e9454936cd6a3c56 Fix Issue 18940 - [std.net.curl]Can't run examples on page. cannot implicitly convert expression https://github.com/dlang/phobos/commit/0eff855c7c3cf7ac7bfbb27fbfb68f7e32deb32f Merge pull request #6540 from wilzbach/fix-18940 Fix Issue 18940 - [std.net.curl]Can't run examples on page. cannot implicitly convert expression merged-on-behalf-of: Vladimir Panteleev --
Re: DIP Draft Review News
On Monday, 4 June 2018 at 10:30:18 UTC, rikki cattermole wrote: On 04/06/2018 10:05 PM, Yuxuan Shui wrote: On Monday, 4 June 2018 at 05:46:04 UTC, rikki cattermole wrote: [...] Not sure what you meant? This definitely does not error out: https://godbolt.org/g/PAiFPw ```D @named: int add(int a, int b); int add(int b, int a) { assert(a > 0); return a + b; } void main() { add(2, 0); } ``` This shouldn't fail to compile. I think it's made clear in the DIP, parameter names play no role in overload resolution. [...] Care to elaborate why? In this DIP, name prefix on caller side is optional, caller is allowed to leave out any number of argument names if they want. Not all parameters should be used as named arguments. Two syntax's one purpose isn't desired, which the DIP currently encourages. Why is this two syntaxes one purpose? Personally I want to keep named and unnamed completely separate and focus more upon public API. While I'm not keen on 2 and definitely would love for 3, my first point is what will determine if I vote yes or not (assuming it gets there). My instincts are saying that it simply hasn't been thought through enough just yet and that there will be some real trouble with it. I've dwelt on this for a couple of months now, and keeping thinking on it myself is not going to help. That's why I'm asking for feedback. Ambiguity is nobody's friend when it comes to programming language proposals. You have time to think it over, and I could be very wrong (of course); but other wise as a lite version of named arguments its not a bad DIP, just maybe we can do better for D ;)
Re: DIP Draft Review News
On 04/06/2018 10:05 PM, Yuxuan Shui wrote: On Monday, 4 June 2018 at 05:46:04 UTC, rikki cattermole wrote: On 04/06/2018 5:01 PM, Mike Parker wrote: Named arguments lite I'm concerned about this DIP (keep in mind I wrote a referenced WIP DIP). 1. Reordering of parameters that match (with overloads) ```D int add(int a, int b); int add(int b, int a) { ... } ``` This part of the DIP needs quite a bit of filling out and I expect to have a lot of corner cases. Are you saying that you have an add that is extern'd or do you mean a named argument function overload? By conventional wisdom it definitely should error out. Not sure what you meant? This definitely does not error out: https://godbolt.org/g/PAiFPw ```D @named: int add(int a, int b); int add(int b, int a) { assert(a > 0); return a + b; } void main() { add(2, 0); } ``` 2. All or nothing. ```D int add(int x, int y); @named: int add(int b, int a) { ... } ``` This is one of the reasons some people /don't/ want named arguments and have said that they out right would not use a language with it. Care to elaborate why? In this DIP, name prefix on caller side is optional, caller is allowed to leave out any number of argument names if they want. Not all parameters should be used as named arguments. Two syntax's one purpose isn't desired, which the DIP currently encourages. Personally I want to keep named and unnamed completely separate and focus more upon public API. While I'm not keen on 2 and definitely would love for 3, my first point is what will determine if I vote yes or not (assuming it gets there). My instincts are saying that it simply hasn't been thought through enough just yet and that there will be some real trouble with it. Ambiguity is nobody's friend when it comes to programming language proposals. You have time to think it over, and I could be very wrong (of course); but other wise as a lite version of named arguments its not a bad DIP, just maybe we can do better for D ;)
Re: DIP Draft Review News
On Monday, 4 June 2018 at 05:46:04 UTC, rikki cattermole wrote: On 04/06/2018 5:01 PM, Mike Parker wrote: Named arguments lite I'm concerned about this DIP (keep in mind I wrote a referenced WIP DIP). 1. Reordering of parameters that match (with overloads) ```D int add(int a, int b); int add(int b, int a) { ... } ``` This part of the DIP needs quite a bit of filling out and I expect to have a lot of corner cases. Are you saying that you have an add that is extern'd or do you mean a named argument function overload? By conventional wisdom it definitely should error out. Not sure what you meant? This definitely does not error out: https://godbolt.org/g/PAiFPw 2. All or nothing. ```D int add(int x, int y); @named: int add(int b, int a) { ... } ``` This is one of the reasons some people /don't/ want named arguments and have said that they out right would not use a language with it. Care to elaborate why? In this DIP, name prefix on caller side is optional, caller is allowed to leave out any number of argument names if they want.
Re: GitHub could be acquired by Microsoft
On Monday, 4 June 2018 at 09:38:57 UTC, Vladimir Panteleev wrote: On Monday, 4 June 2018 at 05:50:26 UTC, Anton Fediushin wrote: I can think of hundreds of things what can go wrong including: forcing users to use Microsoft accounts, advertising own products, changing search to Bing (that's pretty bad one, no idea how I came up with it) and more and more. Something that might be worth being concerned about is that Microsoft might be more strict in policing its online properties than GitHub, so watch out for them shutting down projects/repositories of politically charged subjects, or those e.g. based on reverse-engineered MS code. GitHub removed repositories before when contents were illegal. That's an interesting question though: now there's nothing stopping MS from changing user agreement and removing repositories without any kind of legal lawsuit. Also, nothing stops MS from making it harder for other big companies like Google and Apple to support and host their projects on the GitHub.
Re: how to define infix function
On Saturday, 2 June 2018 at 23:17:48 UTC, Simen Kjærås wrote: unittest { import std.algorithm.comparison; alias min = Operator!(std.algorithm.comparison.min); assert(1 /min/ 3 == 1); } Why not: alias Δ = Operator!(std.algorithm.comparison.min); assert(1 /Δ/ 3 == 1); To improve readibility :)
Re: GitHub could be acquired by Microsoft
On Monday, 4 June 2018 at 08:42:08 UTC, Walter Bright wrote: On 6/3/2018 8:51 PM, Anton Fediushin wrote: This is still just a rumour, we'll know the truth on Monday (which is today). We'll stay on Github as long as it continues to serve our interests, which it has done very well, and I have no reason to believe will change. It's understandable, moving organization this big around is not easy and it shouldn't be done unless it is absolutely needed. We have a number of ties to Microsoft: It's great to know that MS is so nice to D. I guess that's because D isn't something over-hyped and MS might be interested in technologies, not in money or popularity.
Re: GitHub could be acquired by Microsoft
Oh look, rumours are confirmed: https://itsfoss.com/microsoft-github/ MS bought GitHub for $5 billion.
Re: GitHub could be acquired by Microsoft
On Monday, 4 June 2018 at 05:50:26 UTC, Anton Fediushin wrote: I can think of hundreds of things what can go wrong including: forcing users to use Microsoft accounts, advertising own products, changing search to Bing (that's pretty bad one, no idea how I came up with it) and more and more. Something that might be worth being concerned about is that Microsoft might be more strict in policing its online properties than GitHub, so watch out for them shutting down projects/repositories of politically charged subjects, or those e.g. based on reverse-engineered MS code.
[Issue 18941] Memory corruption when using a mixin template
https://issues.dlang.org/show_bug.cgi?id=18941 greenify changed: What|Removed |Added CC||greeen...@gmail.com --
Re: GitHub could be acquired by Microsoft
On 6/3/2018 8:51 PM, Anton Fediushin wrote: This is still just a rumour, we'll know the truth on Monday (which is today). We'll stay on Github as long as it continues to serve our interests, which it has done very well, and I have no reason to believe will change. We have a number of ties to Microsoft: 1. It's just down the street. 2. Many D users work at Microsoft. 3. Microsoft has always been helpful and supportive of Digital Mars, note the files licensed from Microsoft in the distribution. 4. Microsoft has invited myself and Andrei to speak at Microsoft from time to time. 5. Microsoft hosts the nwcpp.org meetings, which provide a venue for me to try out D presentations to a friendly crowd. 6. Microsoft has been generous with helping me solve some vexing compatibility problems from time to time.
Re: DIP Draft Review News
On Monday, 4 June 2018 at 05:46:04 UTC, rikki cattermole wrote: On 04/06/2018 5:01 PM, Mike Parker wrote: Named arguments lite I'm concerned about this DIP (keep in mind I wrote a referenced WIP DIP). The place for this sort of feedback is in the PR comments, not here :-)
[Issue 7925] extern(C++) delegates?
https://issues.dlang.org/show_bug.cgi?id=7925 Manu changed: What|Removed |Added Keywords||C++, industry --- Comment #1 from Manu --- As in https://issues.dlang.org/show_bug.cgi?id=18928, we have observed that C++ and D method calling convention is different (RVO expectations don't match). This means delegates need to know their calling convention, otherwise they will call incorrectly for the function that's assigned to them. I suggest `extern(C++) delegate` which would guarantee the delegate uses the appropriate C++ calling convention. --
Re: GitHub could be acquired by Microsoft
04.06.2018 09:02, Anton Fediushin пишет: On Monday, 4 June 2018 at 04:40:44 UTC, Jonathan M Davis wrote: On the bright side, maybe this will encourage online repo hosting to become less of a monopoly as folks move elsewhere due to their concerns about Microsoft. - Jonathan M Davis Can't agree more: GitLab and Bitbucket deserve more attention. Speaking of which, there's huge spike [1] in project imports on GitLab. These are some great news for it, I hope it doesn't crash. [1] https://monitor.gitlab.net/dashboard/db/github-importer?orgId=1 Gitlab has a big (for me) advantage being self hosted standalone system I can use privately. Its free version has restrictions comparing to enterprise version but very usable. What about sexy modern design it's annoying (for me again) that this design changes frequently, it forces me almost every update to find where menus and buttons I used before placed now.
[Issue 18928] extern(C++) bad codegen, wrong calling convention
https://issues.dlang.org/show_bug.cgi?id=18928 Rainer Schuetze changed: What|Removed |Added CC||r.sagita...@gmx.de --- Comment #11 from Rainer Schuetze --- Try this https://github.com/dlang/dmd/pull/8330 --
[Issue 18928] extern(C++) bad codegen, wrong calling convention
https://issues.dlang.org/show_bug.cgi?id=18928 --- Comment #10 from Manu --- Awesome sauce... sadly, for the immediate moment, I really need a fix in DMD >_< --
Re: GitHub could be acquired by Microsoft
On Monday, 4 June 2018 at 04:40:44 UTC, Jonathan M Davis wrote: On the bright side, maybe this will encourage online repo hosting to become less of a monopoly as folks move elsewhere due to their concerns about Microsoft. - Jonathan M Davis Can't agree more: GitLab and Bitbucket deserve more attention. Speaking of which, there's huge spike [1] in project imports on GitLab. These are some great news for it, I hope it doesn't crash. [1] https://monitor.gitlab.net/dashboard/db/github-importer?orgId=1