Re: "Programming in D" on Educative.io
On Thursday, 14 May 2020 at 08:42:43 UTC, ShadoLight wrote: On Wednesday, 13 May 2020 at 19:25:43 UTC, welkam wrote: [...] This opinion seems quite common in the D community, but I frankly don't see it. If you are referring to the D subset defined by the BetterC switch, well, maybe then I would agree. But not for D in general. [...] but D has GC enabled, then it's not re-engineering of C++.
Re: GCC 10.1 Released
On Thursday, 14 May 2020 at 19:39:27 UTC, M.M. wrote: On Thursday, 14 May 2020 at 16:57:20 UTC, Iain Buclaw wrote: As of last week (7th May), GCC 10.1 has now been released. For the D language front-end, only a small number of incremental, but substantial changes have gone in. Most notable of the lot has been the addition of `static foreach`, which makes the front-end (the C++ port of DMD) feature complete with DMD version 2.076.1. There is also now a configurable separation between building Druntime and Phobos, which has allowed many targets to have gained library support for building a D runtime library by disabling the build of Phobos. [...] Great work! Great plans! I wish you good luck with your goals, and hope you can attract people to help you. Did you ever consider to mentor a student for Google-summer-of-code? We (Amaury and I) did interview a couple of potential students a number of years back, possibly the only time GSOC accepted the Dlang submission. Nothing came out of it, which was just as well really as all ideas I had were really vague. Besides, I didn't feel like there was much that could be done while D was still not integrated into GCC. Haven't thought much about it since though.
Re: GCC 10.1 Released
On Thursday, 14 May 2020 at 18:18:02 UTC, matheus wrote: On Thursday, 14 May 2020 at 18:10:10 UTC, Iain Buclaw wrote: Thanks for you kind reply. Do you mean I should venture out the cave more often? :-) I'm not the OP, but yes you should! :) Anyway thanks for your work and by the way do you have Patreon? That I do not, nor other tools such as Github sponsors either. I'd first feel more inclined to suggest that people should donate to the D language foundation. Something could be set-up if pushed however.
Re: GCC 10.1 Released
On Thursday, 14 May 2020 at 16:57:20 UTC, Iain Buclaw wrote: As of last week (7th May), GCC 10.1 has now been released. For the D language front-end, only a small number of incremental, but substantial changes have gone in. Most notable of the lot has been the addition of `static foreach`, which makes the front-end (the C++ port of DMD) feature complete with DMD version 2.076.1. There is also now a configurable separation between building Druntime and Phobos, which has allowed many targets to have gained library support for building a D runtime library by disabling the build of Phobos. [...] Great work! Great plans! I wish you good luck with your goals, and hope you can attract people to help you. Did you ever consider to mentor a student for Google-summer-of-code?
Re: GCC 10.1 Released
On Thursday, 14 May 2020 at 18:10:10 UTC, Iain Buclaw wrote: Thanks for you kind reply. Do you mean I should venture out the cave more often? :-) I'm not the OP, but yes you should! :) Anyway thanks for your work and by the way do you have Patreon? Matheus.
Re: GCC 10.1 Released
On Thursday, 14 May 2020 at 17:27:33 UTC, Matthias Klumpp wrote: On Thursday, 14 May 2020 at 16:57:20 UTC, Iain Buclaw wrote: As of last week (7th May), GCC 10.1 has now been released. For the D language front-end, only a small number of incremental, but substantial changes have gone in. Most notable of the lot has been the addition of `static foreach`, which makes the front-end (the C++ port of DMD) feature complete with DMD version 2.076.1. There is also now a configurable separation between building Druntime and Phobos, which has allowed many targets to have gained library support for building a D runtime library by disabling the build of Phobos. [...] Hey Iain! I love your summary and plans (can you do this more often? ^^), Thanks for you kind reply. Do you mean I should venture out the cave more often? :-) P.S: As a distribution developer, I would love LDC and GDC to be ABI-compatible, so we wouldn't have to choose a global default... But that's probably an unlikely thing to change anytime soon. Unfortunately there are a few things stacked against us. 1. For best compatibility, GDC and LDC should be based off the same DMD version. New releases in both language and library can incur many differences, both in what symbols end up in the library, and what signature they have. 2. The compiler<->library interface should be aligned up. You can't have GDC and LDC emitting moduleinfo symbols into differently named sections. Otherwise module constructors/destructors won't be picked up and ran if you link against a library built by the other compiler. 3. Maybe skipping a few... assuming that we get all things in sync, and both GDC and LDC are working together more tightly. The last remaining hurdle is the function calling convention. As I understand it, LLVM leaves it up to the front-end maintainers to write their own for each target, whereas GCC takes care of such matters for you. So LDC will have to be modified to strictly only support the system C ABI, ignoring any D-specific differences/extensions (see spec/abi.html in the D language reference). The only case where it would be the other way round (GDC needs to be fixed to match LDC) is for targets that GCC doesn't support yet, such as aarch64-darwin. Iain
Re: GCC 10.1 Released
On Thursday, 14 May 2020 at 16:57:20 UTC, Iain Buclaw wrote: As of last week (7th May), GCC 10.1 has now been released. For the D language front-end, only a small number of incremental, but substantial changes have gone in. Most notable of the lot has been the addition of `static foreach`, which makes the front-end (the C++ port of DMD) feature complete with DMD version 2.076.1. There is also now a configurable separation between building Druntime and Phobos, which has allowed many targets to have gained library support for building a D runtime library by disabling the build of Phobos. [...] Hey Iain! I love your summary and plans (can you do this more often? ^^), and just wanted to say kudos for the work you do on this! As far as the Linux world is concerned, getting GDC into GCC and keeping it well-integrated and up-to-date it is a major thing to get D established as first-class supported language. Having that D binding generator will be even more useful for integrating D with existing, bigger codebases written in C or C++. Keep up the great work! (And I'll get that dub package rebuilt against GDC 10.1 in Debian ASAP ^^) Cheers, Matthias P.S: As a distribution developer, I would love LDC and GDC to be ABI-compatible, so we wouldn't have to choose a global default... But that's probably an unlikely thing to change anytime soon.
GCC 10.1 Released
As of last week (7th May), GCC 10.1 has now been released. For the D language front-end, only a small number of incremental, but substantial changes have gone in. Most notable of the lot has been the addition of `static foreach`, which makes the front-end (the C++ port of DMD) feature complete with DMD version 2.076.1. There is also now a configurable separation between building Druntime and Phobos, which has allowed many targets to have gained library support for building a D runtime library by disabling the build of Phobos. See [1] for more information about changes in GDC 10.1. Sources are available from any of the GCC mirrors [2], or you can clone the git repository [3]. [[GCC 11 Development]] Now the development cycle has started again, I have ambitions for a number disruptive changes to land during the next release cycle. 1. Switch implementation of the compiler from C++ to D. Rebase front-end with DMD master. Taking into account the alignment of release cycles, the aim is for GCC 11.1 to have DMD 2.098.0-beta.1 or 2.098.0-rc.1. The GCC 11.2 release will then have DMD 2.098.1, plus any other fixes that have gone into stable before the master/stable merge. 2. Update the D demangling library to be in sync with current spec, down-streaming this to GDB/Binutils. This'll include the ability to decode recent(-ish) ABI changes such as back references, as well as decoding @live and variadic parameter attributes. 3. Dynamically generate C bindings from headers, possibly using a new command-line switch -fdump-d-spec where one can use gcc (or g++, gfortran, gccgo...) to read in sources/headers of one language, and write out bindings in D. The primary use case of this would be to drop the manual maintenance of core.sys.*; core.stdc.* (and core.stdcxx.*?); and instead generate these modules during the build of libphobos. 4. Turn on library support for the platforms FreeBSD, NetBSD, DragonflyBSD, OpenBSD, MinGW, Darwin, HP-UX/PA, and AIX/PowerPC. Though given that there'll be a need to bootstrap, expect these ports to also get pushed to a GCC 10.x release too. I'm not going to tire you with anything more on my TODO list (there are over 50 items), but if any thing sounds interesting, or you feel you could help in any way, please don't hesitate to jump on the #gdc channel in either the Dlang Slack or Freenode IRC. [[Nota Bene]] No sooner had the RC for GCC 10 branched, that a bug in std.net.curl was raised relating to the handling of HTTP/2 requests (it can't, as it turns out). This patch [4] is being backported for the 10.2 release, which is highly important for tools such as dub to be able to function correctly. The patch has already been applied to Debian and Ubuntu, it would be kind if other package maintainers do the same for their distributions. Having a look at my own personal site, it is clearly in need of some tender loving care. A minor styling improvement will be done soon, along with a refresh of all documentation hosted on the site to better reflect the situation now, as opposed to 8 years ago. I'll also be triggering a rebuild of D compilers for all supported GCC targets, and pushing them to the compiler explorer site [5] maybe sometime next week (there's 198 of them, so please excuse the slowness of the process). Until next year... Regards Iain. [1] https://gcc.gnu.org/gcc-10/changes.html#d [2] https://gcc.gnu.org/mirrors.html [3] git://gcc.gnu.org/git/gcc.git [4] https://patch-diff.githubusercontent.com/raw/dlang/phobos/pull/6752.diff [5] https://explore.dgnu.org
Re: On the D Blog: Lomuto's Comeback
On Thursday, 14 May 2020 at 13:40:24 UTC, Andrei Alexandrescu wrote: [snip] Really interesting. Thanks for sharing. I have recently been spending some spare time learning more about D's topN and pivotPartition implementation, which led me to your paper on fast deterministic selection. Would you consider changing the pivotPartition implementation based on this? Would the insights gleamed from this paper mean that a branchless version of topN could be faster?
Re: Command line calculator in D
On Wednesday, 6 May 2020 at 11:47:55 UTC, Alireza SN wrote: I was learning about an algorithm called 'Pratt Parser' and decided to write a cli calculator with it. Here is the link if you want to check it out: https://github.com/TheWeirdDev/Calcool Feel free to point out any mistakes i have made. Nice! It reminded me of my old similar project. Today I published it on GitHub and registered in the DUB package registry. GitHub: https://github.com/japplegame/expression DUB: https://code.dlang.org/packages/expression
Re: On the D Blog: Lomuto's Comeback
On Thursday, 14 May 2020 at 13:40:24 UTC, Andrei Alexandrescu wrote: On 5/14/20 9:26 AM, Mike Parker wrote: The right way to share something on hackernews is to send people to https://news.ycombinator.com/newest and mention the time of sharing. Okay everyone, please use this link or search for "Lomuto's Comeback" in the search field. I've been hearing conflicting accounts of this for a while, with more people telling me it doesn't happen anymore. However, it seems posts were never flagged as spam for this. Instead, any upvotes from people coming through direct links *do not count*. Coupled with the fact that the FAQ still says posts are penalized for "asking for votes", I'm no longer going to share direct links to HN articles. Found multiple sources about it, but this 2015 post lays it all out and I assume it's still mostly relevant: https://wiredcraft.com/blog/how-to-post-on-hacker-news/ https://news.ycombinator.com/newsfaq.html
Re: On the D Blog: Lomuto's Comeback
On Thursday, 14 May 2020 at 13:26:23 UTC, Mike Parker wrote: ... Reddit: https://www.reddit.com/r/programming/comments/gjm6yp/lomutos_comeback_quicksort_partitioning/ ... If possible could you please next time share link with "old" instead of "www"? Like: https://old.reddit.com/r/programming/comments/gjm6yp/lomutos_comeback_quicksort_partitioning/ Thanks, SG.
Re: On the D Blog: Lomuto's Comeback
On 5/14/20 9:26 AM, Mike Parker wrote: After reading a paper that grabbed his curiosity and wouldn't let go, Andrei set out to determine if Lomuto partitioning should still be considered inferior to Hoare for quicksort on modern hardware. This blog post details his results. Blog: https://dlang.org/blog/2020/05/14/lomutos-comeback/ Reddit: https://www.reddit.com/r/programming/comments/gjm6yp/lomutos_comeback_quicksort_partitioning/ HN: https://news.ycombinator.com/item?id=23179160 Thanks, Mike. HN has possibly categorized it as spam already. One thing they do is they detect (by using the "Referrer" header) whether the post has been shared via a direct link. They do so to prevent manipulation. The right way to share something on hackernews is to send people to https://news.ycombinator.com/newest and mention the time of sharing.
On the D Blog: Lomuto's Comeback
After reading a paper that grabbed his curiosity and wouldn't let go, Andrei set out to determine if Lomuto partitioning should still be considered inferior to Hoare for quicksort on modern hardware. This blog post details his results. Blog: https://dlang.org/blog/2020/05/14/lomutos-comeback/ Reddit: https://www.reddit.com/r/programming/comments/gjm6yp/lomutos_comeback_quicksort_partitioning/ HN: https://news.ycombinator.com/item?id=23179160
Re: BindBC Updates: new loader function, SDL_net, streamlined SDL_* version indentifiers
On Wednesday, 13 May 2020 at 14:39:13 UTC, Mike Parker wrote: I've recently implemented some improvements centered on bindbc-sdl. As a user of BindBC (and former Derelict), I really enjoy using those binding libraries. It's some great work, thanks.
Re: "Programming in D" on Educative.io
On Wednesday, 13 May 2020 at 19:25:43 UTC, welkam wrote: On Thursday, 7 May 2020 at 09:18:04 UTC, Ali Çehreli wrote: Because D is a re-engineering of C++ I thought it was re-engineering of C This opinion seems quite common in the D community, but I frankly don't see it. If you are referring to the D subset defined by the BetterC switch, well, maybe then I would agree. But not for D in general. FFI to C by itself does not make it a "re-engineering of C". IIRC, Walter wrote somewhere (in the early days of D), that part of what inspired D was "wondering what C++ would have looked like if it wasn't constrained by backwards compatibility with C". Or something to that effect. Let's see what the Wayback machine has to say: "D was conceived in December 1999 by myself as a successor to C and C++..." [1] "Many new concepts were added to the language with C++, but backwards compatibility with C was maintained, including compatibility with nearly all the weaknesses of the original design. There have been many attempts to fix those weaknesses, but the compatibility issue frustrates it. ..etc.." [2] It is actually quite interesting to look at the original goals... and see where we are now. [1] https://web.archive.org/web/20021205114505/http://digitalmars.com/d/index.html [2] https://web.archive.org/web/20021205114505/http://digitalmars.com/d/index.html