Author Archives: Michael Parker

News Update: Swag, Platforms, Documentation Help and More

Here are a few updates on things that have been going on both in front of and behind the scenes of the D Programming Language community.

New D Swag

We’ve got some new items in the DLang Swag Emporium: t-shirts, coffee mugs, and stickers sporting the Royal D logo. (If all Royal D items aren’t showing up for you in the Royal D category, check the D Rocket category. Everything should be in the correct location in a day or two).

You may notice that there are fewer options on the product page than for the other items, i.e. only one mug and sticker, and no dark tee option. They are available, though! When you select one of the existing products, you can change the style of the selection to one of several options. Beware! This may also change the price.

Remember, a small percentage of every item you order from the DLang Swag Emporium goes into the D Language Foundation’s General Fund. Plus, if you click through the link above or on the blog’s sidebar, we’ll get an additional referral fee on top of the item royalty. It’s an easy way to both get some D swag and contribute a few bucks to the Foundation.

Expanded Platform Progress

You maybe aware that some work has been ongoing in getting D onto more platforms. Adam Ruppe was working on contract to get LDC’s Android support to the finish line. He wrapped things up a few weeks back and has been paid out of the Foundation’s HR Fund.

Sebastiaan Koppe has been working on contract to get DRuntime ported to WebAssembly. Progress is ongoing and we currently expect it to be mostly wrapped up by the end of March. Like Adam, he’ll be out of the HR Fund when the contract is complete.

Work is also underway to bring LDC to iOS and iPadOS. We had been hoping to get someone to work on contract for this, but there are few people we know who are familiar enough with the platform to get it done and we were unable to find anyone then with the time to work on it. So we put up a bounty for it and kept our fingers crossed.

Recently, you may have seen forum posts from Jacob Carlborg indicating he’s been working on it in his spare time. Some preliminary support was merged in the LDC 1.20.0 release. Although he isn’t working under contract, he is working toward the bounty. That means anyone who wants to support him can contribute by increasing the bounty. Two contributors have already done so. The base amount of $3000 will be taken from the HR Fund when the work is complete.

And speaking of bounties, there are several others waiting for someone to claim them!

The HR Fund

With one payout from the fund and two coming up, we need to replenish it so we can always have cash earmarked for more contract work and bounties. You can make one-time or recurring donations of any amount directly and receive the same rewards available on our Open Collective page, or you can use a different link to make a $60 donation and get a DConf 2019 t-shirt in return. We’ve still got a few shirts available, so help us get rid of them and boost the HR Fund at the same time!

Documentation Event

Behind-the-scenes discussions about ideas to improve the D ecosystem in one way or another are frequently cycling through the inboxes of the people who can make them happen. Most never see the light of day, but there is one that has great potential. If it all comes together, I’ll be able to announce it in the coming weeks. We need your help to make that happen.

We need some specifics regarding areas where the documentation for D and items in the the D ecosystem is lacking. For example, people often complain about inconsistencies in the D spec, and missing info or examples in the DUB and vibe.d docs.

I’ve started a thread in the D forums where you can post your gripes about incomplete/missing/lackluster documentation. Remember, we need you to be specific. Just saying “the DUB docs are incomplete” doesn’t help. What specifically is missing? Or what specifically is wrong? The more information you can provide the better. And the more examples we can collect the better. The goal is to be able to define specific documentation tasks that anyone with the requisite knowledge can complete.

If we can get enough examples with enough detail, then I should be able to announce a new event sponsored by one of our generous benefactors. And I really want to be able to announce it!

DConf 2020

We really want to see a flood of talk submissions this year. If you’ve never been to DConf, or never presented at any conference, don’t let that stop you! Send us your submission and you may end up with a free trip to the conference.

Also, if you pay for an early-bird registration now (a 15% discount over the regular registration rate) and your talk is selected later, we’ll reimburse your registration fee. So if you’re planning to attend the conference even if your talk isn’t selected, it’s a good idea to register now and avoid the risk of missing the early-bird deadline.

We’re also offering once again the Open Source and Academic Discount; if you are a major open source contributor, a student, or an academic, we’ll give you a 50% discount on the regular registration rate. If you think you qualify, please don’t hesitate to take advantage of it by contacting social@dlang.org (or you can contact me directly at aldacron@gmail.com) for details on how to take advantage.

Finally, we never want to leave anyone out of DConf because they can’t afford to pay. This has been a policy of Walter’s from the beginning. If you are in or around London June 17 – 20 and would like to attend DConf but are unable to afford the registration and/or don’t qualify for the special discount, please email one of the addresses above and we’ll work something out.

DConf 2020: Submission Deadline, Early-Bird Registration, and Invited Keynote

In early January, I announced that Symmetry Investments is bringing DConf back to London for our 2020 edition. At the same time, I said we’d start taking submissions from anyone who wanted to send them in. In the interim, we’ve fixed our deadlines and prepared to start accepting reservations. There was only one thing remaining before I was ready for the formal call for submissions and opening of early-bird registrations: confirming our invited keynote speaker. Now that he has confirmed, it’s all official!

Invited Keynote

We’re excited to welcome Roberto Ierusalimschy to DConf 2020! You may know him from his work as the leading architect of the Lua programming language. He’s the author of Programming in Lua and an Associate Professor of Computer Science at PUC-Rio (the Pontifical Catholic University of Rio de Janeiro).

We don’t know yet what his talk will about, but it can be about any topic he wants. We’ll have more information on that for you when we publish the schedule of all selected talks after April 19.

Call for Submissions

We are accepting submissions for DConf 2020 until April 12. Authors will be notified of their final status by April 19.

We’re eager to see some new faces on the stage this year. If you’ve never presented at a DConf before, please don’t hesitate to send us one or more submissions. One person has already sent in seven!

Unless you’re Roberto Ierusalimschy, we prefer topics that are directly or indirectly related to D. We aren’t intransigent, though, so we’re willing to consider other topics. If someone sends us a proposal that isn’t about D but piques our collective interest, we’ll certainly give it serious consideration.

Having a talk selected is a great way to get to DConf if you’re on a budget. You’ll pay no registration fee, plus we’ll reimburse your transportation and lodging costs (within reason—five-star hotels and business- or first-class plane tickets aren’t on the menu). That’s a pretty good deal.

You can find instructions for writing and submitting your submissions on the DConf 2020 homepage.

Early-Bird Registration

Early-bird registration is available at $340, which is 15% off the regular $400 rate. Because we’re being sponsored by Symmetry in London once more, we once again must include a 20% VAT. So the total early-bird rate is $408 (similarly, the regular rate with VAT will be $480). We’re required by UK law to show you the basic rate and VAT in GBP based on the current HMRC exchange rate. That changes every month, so you can see the latest GPB rates in the registration section of the DConf 2020 homepage.

There, you’ll find options for Flipcause and PayPal. From our perspective, we prefer you use our Flipcause form. That gives you the option to cover the credit card processing fee for us so that 100% of your payment can be put toward DConf expenses. If you choose to uncheck that option, that’s fine, too! It will still save us from paying other fees. Every penny we can put toward the expenses helps.

If you do choose to go through PayPal, you have an option for USD and one for GBP. Some registrants told me last year that they get a GBP option even when clicking the USD button. And of course, some register with GBP-based credit cards. However, the GBP button on the DConf 2020 homepage is a fixed amount based on the current HMRC exchange rate. It changes, but only once a month. It may turn out to be cheaper for you than the rate you get from PayPal or your credit card provider. Of course, it could turn out to be more expensive, so if you’re looking to save a few pounds, you may want to investigate the different exchange rates if they apply to your situation.

And Now For Something Completely Different

DConf isn’t the only event Symmetry Investments is sponsoring these days. We recently wrapped up the 2019 edition of the Symmetry Autumn of Code.

This year, we started with five participants working on five interesting projects. Each participant was to complete a total of four milestones over four months with guidance from a mentor. At the successful completion of the first three milestones, each participant would receive $1000. At the end of the fourth and final milestone, one participant would be selected to receive one more $1000 payment and an all-expense paid trip to DConf.

As the event played out, we lost one of the participants at the end of Milestone 2. Two more were unable to fully commit to the Milestone 4 deadline (though they promised to continue working on their projects after SAOC). That left two participants for the SAOC review committee to select from. It was a very difficult decision, as both participants did excellent work and received glowing evaluations from their mentors.

Now I can announce that the SAOC 2019 finalist was Roberto Rosmaninho!

Roberto, with his mentor Nicholas Wilson, worked on adding support for Multi-Level Intermediate Representation (MLIR) to LDC, the LLVM-based D compiler. He is currently working on putting together pull requests for LDC and intends to work on optimizations going forward. He has also confirmed that he will take advantage of his reward so that we will have at least two Robertos at DConf this year.

As we did last year with Francesco Gallà, the SAOC 2018 finalist, we’ve asked Roberto to submit a talk this year. He promised to do so. We can’t promise his talk will be selected (though the odds are high out of the gate), but he still gets a free trip if it isn’t! Besides, we’re looking forward to meeting him.

On behalf of the D Language Foundation and Symmetry Investments, I want to thank everyone who participated in SAOC 2019. Keep an eye on this blog for news about future events.

Now go prep your DConf 2020 submissions!

DIP Reviews: Discussion vs. Feedback

Digital Mars D logoFor a while now, I’ve been including a link to the DIP Reviewer Guidelines in the initial forum post for every DIP review. My hope was that it would encourage reviewers to keep the thread on topic and also to provide more focused feedback. As it turns out, a link to reviewer guidelines is not quite enough. Recent review threads have turned into massive, 20+ page discussions touching on a number of tangential topics.

The primary purpose of the DIP review process, as I’ve tried to make clear in blog posts, forum discussions, and the reviewer guidelines, is to improve the DIP. It is not a referendum on the DIP. In every review round, the goal is to strengthen the content where it is lacking, bring clarity and precision to the language, make sure all the bases are covered, etc.

At the same time, we don’t want to discourage discussion on the merits of the proposal. Opinions about the necessity or the validity of a DIP can raise points that the language maintainers can take into consideration when they are deciding whether to approve or reject it, or even cause the DIP author to withdraw the proposal. It’s happened before. That’s why such discussion is encouraged in the Community Review rounds (though it’s generally discouraged in Final Review, which should be focused wholly on improving the proposal).

The problem

One issue with allowing such free-form discussion in the review threads is that there is a tremendous amount of noise drowning out the signal. Finding specific DIP-related feedback requires trawling through every post, digging through multiple paragraphs of mixed discussion and feedback. Sometimes, one or more people will level a criticism that spawns a long discussion and results in a changing of minds. This makes it time consuming for me as the DIP manager when I have to summarize the review. It also increases the likelihood that I’ll overlook something.

My summary isn’t just for the ‘Reviews’ section at the bottom of the DIP. It’s also my way of ensuring that the DIP author is aware of and has considered all the unique points of feedback. More than once I have found something the DIP author missed or had forgotten about. But if I overlook something and the DIP author also overlooks it, then we may have missed an opportunity to improve the DIP.

I have threatened to delete posts that go off topic in these threads,  but I can count on one hand the number of posts I’ve actually deleted. In reality, these discussions branch off in so many directions that it’s not easy to say definitively that a post that isn’t focused on the DIP itself is actually off topic. So I tend to let the posts stand rather than risk derailing the thread or removing information that is actually relevant.

The Solution

Starting with the upcoming Final Review of DIP 1027, I’m going to take a new approach to soliciting feedback. Rather than one review thread, I’ll be launching two for each DIP.

The Discussion Thread will be much the same as the current review thread. Opinions and discussion will be welcome and encouraged. I’ll still delete posts that are completely off topic, but other than that I’ll let the discussion flow where it may.

The Feedback Thread will be exclusively for feedback on the document and its contents. There will be no discussion allowed. Every post must contain specific points of feedback (preferably actionable items) intended to improve the proposal. Each post should be a direct reply to my initial post. There are only two exceptions: when a post author who has decided to retract feedback they made in a previous post, said poster can reply to the post in which they made the original feedback in order to make the retraction; and the DIP author may reply directly to any feedback post in order to indicate agreement or disagreement.

Posts in the feedback thread should contain answers to the questions posed in the DIP Reviewer Guidelines. It would be great if reviewers could take the time to do what Joseph Rushton Wakeling did in the Community Review for DIP 1028, where he explicitly listed and answered each question, but we won’t be requiring it. Feedback as bullet points is also very welcome.

Opinions on the validity of the proposed feature will be allowed in the feedback thread as long as they are backed with supporting arguments. In other words, “I’m against this! This is a terrible feature.” is not valid for the feedback thread. That sort of post goes in the discussion thread. However, “I’m against this. This is a terrible feature because <reasoned argument goes here>” is acceptable.

The rules of the feedback thread will be enforced without prejudice. Any post that is not a reply to my initial post, retraction of previous feedback, or a response by the DIP author will be deleted. Any post that does not provide the sort of feedback described above will be deleted. If I do delete a post, I won’t leave a new post explaining why. I’m going to update the DIP Reviewer Guidelines and each opening post in a feedback thread will include a link to that document as well as a paragraph or two summarizing the rules.

I’ll require DIP authors to follow both threads and to participate in the discussion thread. When it comes time to summarize the review, the feedback thread will be my primary source. I will, of course, follow the discussion thread as well and take notes on anything relevant. But if you want to ensure any specific criticisms you may have about a DIP are accounted for, be sure to post them in the feedback thread.

Hopefully, this new approach won’t be too disruptive. We’ll see how it goes.

 

Recent D Compiler Releases

Digital Mars D logoThe LDC team closed out the old year with release 1.19.0 of the LLVM-based D compiler, and the core D team opened the new year with version 2.090.0 of the reference D compiler, DMD. And if you haven’t yet heard, there was some big news about the GCC-based D compiler, GDC, a while back. Time to catch up!

LDC 1.19.0

This release updates the LDC compiler to D front end version 2.089.1, which was the current version when the compiler was released on the day after Christmas. The prebuilt packages are based on LLVM 9.01.

Among the big items in this release is some love for Android. The prebuilt DRuntime/Phobos library is now available for all supported Android targets. This release can be used in conjunction with Adam Ruppe’s D Android project, a collection of helper programs and interfaces, currently in beta, to facilitate D development on Android with LDC.

Windows users will find that the bundled MinGW-based link libraries for Windows development have been upgraded. They are now derived from .def files from the MinGW-w64 7.0.0 package. These libraries allow you to use the Windows system libraries without needing to install the Windows SDK.

DMD 2.090.0

The latest version of DMD was announced on January 7th. It ships with 10 major changes and 71 closed issues courtesy of 48 contributors.

With this release, it’s now possible to do more with lazy parameters. D has long supported lazy parameters:

An argument to a lazy parameter is not evaluated before the function is called. The argument is only evaluated if/when the parameter is evaluated within the function. Hence, a lazy argument can be executed 0 or more times.

Under the hood, they are implemented as delegates. Now, it’s possible to get at the underlying delegate by taking the address of the parameter, an operation which was previously illegal.

import std.stdio;

void chillax(lazy int x)
{
    auto dg = &x;
    assert(dg() == 10);
    writeln(x);
}

void main()
{
    chillax(2 * 5);
}

This release also renders obsolete a D idiom used by those who find themselves with a need to distinguish between finalization (non-deterministic object destruction usually initiated by the garbage collector) and normal destruction (deterministic object destruction) from inside a class or struct destructor.

With the current GC implementation, it’s illegal to perform some GC operations during finalization. However, D does not provide for separate finalizers and destructors. There is only ~this, which is referred to as a destructor even though it fills both roles. This sometimes presents difficulties when implementing destructors for types that are intended to be used with both GC and non-GC allocation. Any cleanup activity that touches the GC could throw an InvalidMemoryOperationError. Hence the need for the aforementioned workaround.

Now it’s possible to call the static GC member function, core.memory.GC.inFinalizer, to get your bearings in a destructor. It returns true if the current thread is performing object finalization, in which case you don’t want to be taking any actions that touch on GC operations. (I’ve been waiting for something like this before writing the next article in my GC series.)

GDC

Thanks to the hard work of Iain Buclaw, Johannes Pfau, and all of the volunteers who have maintained and contributed to it over the years, GDC was accepted into GCC 9 in late 2018 and made available as part of the GCC 9.1 package released in May of last year. GCC 9.2 was released last August. This version of GDC implements version 2.076 of the D front end. You can build it yourself or install it from the same place you install the GCC 9.x series.

DConf 2020: Double Decker Edition

To kick off the year of double 20’s (or double X’s if you prefer), the D Language Foundation is excited to announce that DConf 2020 will return to 99 City Road for a second round in London! We had such a great time last year that we were over the moon when we heard that our DConf 2019 hosts and sponsors at Symmetry Investments were willing to do it all again in 2020. The venue’s Sinisa Poznanovic will be back live streaming the talks on the D Language Foundation’s YouTube channel, and all of the talks will once again be recorded in HD via the capable hands of the Stage Engage crew.

Since DConf 2013, our annual D gathering has taken place each year in May. This time, we’re breaking tradition by running the conference in the middle of June. Our usual three days of talks will take place June 17th – 19th, followed by our annual DConf Hackathon on the 20th. There’s a reason we picked these dates, but it’s tied to an announcement I hope to make some time in the next few weeks. My fingers are crossed that things work out the way we intend and that I can make that announcement sooner rather than later.

Early-bird registration will open in the near future. From now, we’re accepting submissions. If you’ve got an idea for a talk or a panel, don’t be shy. It doesn’t matter if you’re a D veteran or a D noob, if you’ve spoken at multiple DConfs or spoken at none (or never spoken in public at all). We’re eager to see submissions from any and all, but we’re particularly interested in seeing some new faces at the lectern this year. If your talk gets selected, you can plan your trip to London and, as a speaker, you’ll be eligible for reimbursement for the cost of your transportation and lodgings. If your talk doesn’t make the cut, you lose nothing. So head to the DConf 2020 web site for the details and send us your submission!

Additionally, we’re currently working out the details of a potential event peripheral to the conference itself. If all goes well and the plans come to fruition, I’ll announce it here as soon as I’m able (otherwise, I’ll have just teased you for no reason whatsoever). We’ve also got an eye out for opportunities like the walking tours we organized before the conference last year. I don’t know which ideas or opportunities will materialize this year, but I do want you to know that we’re looking.

So start making your plans, send your thanks to Laeeth and Symmetry Investments (if you’re so inclined) for taking on a second DConf and for everything they’ve done and continue to do for the D community, and send us your submissions!

Goings-on in DLand

The blog has been quiet for the past month, largely because I’ve been busy. I’ve had a couple of articles submitted to me which were a little light on content, so I asked the authors to flesh them out some more. Both are busy at the moment, but I’ll check back in with them in the New Year.

In the interim, I figured I’m due for a new update. I’m also working on the next article in my D and C series, which I hope to publish soon. If you’ve got something you’d like to say, please don’t hesitate to contact me. I can’t promise I’ll publish your article, but if it checks all but a few boxes I’ll be happy to work with you to check off the rest. I’m also open to Project Highlights. If you’ve got a project to show off, let me know and I’ll tell you how to proceed. The D Language Foundation pays a bounty for most guest contributions, so it’s a relatively easy way to make some cash. Speaking of bounties…

Task Bounties

Don’t forget that we’ve got 8 open task bounties awaiting someone to claim them. You can also make a contribution to increase the bounties for the tasks you’re concerned about by clicking on the corresponding card on that page. Click the first card on the page if you’d like to seed a new bounty with a contribution, but be sure to include a note with a Bugzilla issue number or a request that I contact you for details. Once we’ve got it sorted, I’ll create a new card for your task and assign the seeded amount.

I’ll be adding some new tasks to the page in January. We’d all love to see some of the existing tasks closed out before then!

Contract Work

Some readers may be aware that Adam Ruppe is working on contract for the D Language Foundation to take LDC’s Android support to completion. It looks like he’s not too far away from the finish line. You can read about his progress and his JNI module in the latest installment of This Week in D.

Back in October, Sebastiaan Koppe posted a comment in a forum thread where the OP asked what was holding up D support for WebAssembly. Sebastiaan at that point had made a few announcements about his Spasm project and posted some demos, but there was still a lot of work to be done. His response to the question:

The short answer is manpower…With D the main issue is that someone needs to port druntime to wasm. I am working on it in my spare time, but progress is slow.

I wondered if there was a way to speed things along. After securing permission from the people in charge of the Foundation’s purse strings and discussing the details with Sebastiaan, he agreed to make a dedicated effort to get the project done on contract. He needed a few weeks before he could get started. He also wanted to draw up a document detailing his approach and ask for feedback. That resulted in a forum thread, Proposal for porting D runtime to WebAssembly.

I’m happy to report that the contract has since been signed and the work is underway!

The Human Resource Fund and More

Both Adam and Sebastiaan will be paid from our Human Resource Fund, which WekaIO seeded and expanded through two generous donations. We are thankful to everyone who has donated so far, but we need to keep growing it. There’s a good deal of work out there that can improve the ecosystem if we have the money to throw at it. You can donate directly through the Human Resource Fund donation page, where we apply the same rewards as listed on our OpenCollective page, or you can donate $60 through our special donation page and we’ll send you a DConf 2019 t-shirt.

We also welcome direct donations to our General Fund. You can make indirect donations by shopping through AmazonSmile at smile.amazon.com and selecting the D Language Foundation as your preferred charity. We’ll receive a small percentage of your purchases through that URL (and we’re only available through the .com domain, not .uk, .de, .jp, or any other Amazon domain). There are browser extensions, such as Smile Always for Chrome and Smart Amazon for Firefox, that will automatically send you to the smile subdomain when you visit amazon.com. You can also turn on AmazonSmile in the Amazon Mobile App.

Purchases through the DLang Swag Emporium also send money to the general fund. We get a commission on every item sold, but if you visit through this link (or the one in the sidebar) which contains our referral number, we’ll get referral commissions on any item you buy on your visit to Zazzle, including those in our own store. We’re selling D-themed coffee mugs, stickers, t-shirts, hoodies and now wrapping paper. We’ll be adding more items and more emblems as time goes by. So far, you’ve helped us raise $135.05.

SAOC 2019

SAOC 2019 Milestone 3 wraps up on December 15. The final round kicks off the same day. Out of five who started the event back in September, four remain. The reviewers have largely been pleased with their efforts so far. At the end of Milestone 4 in January, only one of the four remaining participants will be eligible for the final $1000 payment and the award of a free trip to DConf 2020.

The participants are supposed to be posting weekly updates in the General forum, so you can follow their progress there. After the event, I’ll ask those who didn’t get the grand prize to write about their projects and their SAOC experience here on the blog.

The D Language Foundation, the SAOC reviewers, and I wish good luck to all of the participants as they enter the final stretch. They’ve been working hard and picking one “winner” isn’t going to be easy!

DConf 2020

Preparations for DConf 2020 are well underway. At the moment, I’m waiting on the news that the venue contract has been signed and delivered. As soon as I hear that, I’ll come straight to the blog with the announcement. I’m hoping to be able to announce our invited keynote at the same time, but I’ll not delay the main announcement for it.

What I can tell you now is that we’ll have a longer submission period this year. We’ll also keep the registrations open longer. We’re aiming to bring new people in and are currently discussing a special event with that goal in mind. That will require an advertising budget this time around. We did some advertising for DConf 2018 and learned some lessons in the process. We hope to apply them to better effect for 2020. Any donations you can make to the General Fund will help us toward that end.

Keep it Going

Thanks to all who have contributed their time, their energy, and their money to help make the D language and the D community what they are today. We’ve come a long way since the day I first stumbled upon the Digital Mars website in the summer of 2003. But there’s always more work to do. Newcomers to D have no perception of what came before, only of the way things are when they arrive. We need to continually improve the DLang experience, meet the expectations that surround a modern programming language, and live up to the ideal. That means we are always in need of more donations of time, energy, and money. If you have any to spare, we welcome it!

DMD 2.089.0 Released

Digital Mars logoThe latest release of DMD, the D reference compiler, is ready for download. It’s a relatively light release in terms of changes and features, with 11 major changes and 66 closed Bugzilla issues. Most of the changes cover narrow use cases. To highlight a few: proper non-D mangling in template mixins, a renamed default linker, and expanded support in DUB for LDC.

Proper non-D mangling in template mixins

Maintainers of C bindings, or anyone writing D programs that need to interface with a custom C codebase, may find this change particularly useful. Previously, symbols declared as extern(C), extern(Windows)(which is stdcall), and extern(Objective-C) in template mixins were improperly mangled as D symbols when the templates were mixed in at global scope. It was easy to work around if you didn’t need parameterization (just use string mixins), but if you did need it, then you were either stuck or had to jump through hoops.

The root of the issue was that a template mixin introduces a new scope at the point it’s mixed in and creates aliases to the declarations inside that scope so that they may be accessed externally without the need for dot notation. This is a major convenience when only one instance of the template is mixed into a scope (as is the usual case) and allows for code to be written as if the template mixin doesn’t exist. In other words:

mixin template Foo(T)
{
    T x;
}

mixin Foo;

// Not required
// mixin Foo f;

// Allows this:
int main()
{
    x = 10;

    // Not required
    // f.x = 10;
}

The additional scope meant that, e.g., an extern(C) symbol in a template mixin was never in global scope, so it was mangled as a D symbol rather than a C symbol. With the change, such symbols are promoted from the mixin scope to the global scope and are properly mangled. Now you can choose either string mixins or template mixins for your C/stdcall /Objective-C boilerplate.

No more link.exe conflict

From the first alpha release of DMD, OPTLINK has been the default linker that ships with the compiler on Windows. When Walter Bright first started working on DMD, he used the existing C compiler backend he had been maintaining for 20 years. Since the backend already output object files in the Intel OMF format, he also decided to make use of OPTLINK; it had become a part of the C and C++ compiler package while he was at Borland. It was several years later that he added support Microsoft’s MSCOFF (PE) and the Microsoft linker, cl, to DMD. The fact that both the OPTLINK and cl executables were named link.exe wasn’t an issue early on, but over time it has begun to pop up more often, particularly when performing the compile and link steps separately.

With DMD 2.089, it will never be an issue again. The version of OPTLINK that ships with DMD has been renamed to optlink.exe.

DUB and LDC

DUB, the D build tool and package manager, has shipped with DMD for several releases. When executing dub on a properly configured source package, DMD is the default compiler. It also supports LDC (the LLVM-based D compiler) and GDC (the GCC-based D compiler, which is part of GCC 9) via command-line options, but the full range of DUB features haven’t been available for those compilers.

The latest version improves support for LDC. DUB command-line options to enable code coverage, profiling, keeping the stack frame, and separate linking now work with LDC. Target triples can be given to the --architecture (-a) switch to enable cross-compilation with LDC.

D Language Foundation Funding: New Platforms, New Bounties

Digital Mars logoWhen I first announced the HR Fund here on the blog back in April, there was talk among the D Language Foundation team of hiring one or more people to flesh out the specification and implementation of shared. That sort of work requires a very specific skillset that only a few people in the orbit of D possess. So far, we’ve been unable to find any of them with the time to spare. Meanwhile, the HR Fund is sitting there, waiting to be used.

Mobile Support for LDC

A few weeks ago, Ethan Watson wrote a post in the D forums titled, DMD or LDC on mobile. That thread, followed up by emails with Ethan and a few other people, presented a great opportunity to start putting the HR fund to use. Given that LDC already has support for ARM and DMD does not, it’s more practical to fund efforts on LDC than on DMD

As Adam Ruppe has suggested in the forums, he is currently working under contract to complete the existing work on Android support for LDC. By the time he’s finished, it should be possible for anyone to build a D application for Android and distribute it through the Play Store.

The iOS story, unfortunately, hasn’t yet moved forward. We had the ideal candidate on board and eager to get started, but he was sadly unable to get the time off from work that he would need to get the job done. We’ve asked around, looking for someone else with the same skillset to take on the task, but have come up empty. So now we’re reaching to the community at large. But with a twist…

New Task Bounties

Back in August, I announced that we had launched a new Bug Bounty system. The term “Bug” was perhaps too restrictive, so I’ve renamed the menu to Task Bounties. And as of today the D Language Foundation has seeded three new bounties: two for Bugzilla issues and one for the aforementioned LDC project.

Donate to the campaign for adding iOS/iPadOS support to LDC.

The D Language Foundation has put forward $3000 to seed the bounty to add iOS and iPadOS support to LDC. We encourage anyone interested in seeing this task complete to donate to increase the bounty.

This isn’t a typical bounty, as the money will only be paid as the result of contract work. As such, the money to seed it comes from the HR fund. So if you’re interested in taking the bounty home, click the image above and read the bounty description. We want to get this completed as soon as possible, else we’d wait for our original candidate to become available. So if you have the requisite knowledge, skills, and abilities to get the job done, please don’t hesitate to reach out.

The Foundation seeded two Bugzilla bounties (from the General Fund) at $50 each: one for issue #18472 (betterC: cannot use format at compile time) and the other for issue #18062 (ddoc: Generated .html files should retain the package hierarchy). Click through those links to increase the bounties, or visit Bugzilla #18472 or Bugzilla #18062 for the bug details to get started on fixing one.

I’d like to thank the members of the dlang-jp community for bringing these bugs to our attention. I recently met three of them in Tokyo along with Átila Neves. Aside from having a great time hanging out and touring part of Asakusa, we had a good chat about D and the Japanese D community. I look forward to the next opportunity to see them.

We’ll be seeding more Bugzilla bounties in the coming weeks. I’ll be digging into some of the old #dbugfix issues that are still open. If you have a bug that’s particularly troubling you, please consider seeding a bounty for it yourself. Alternatively, post a link to it on Twitter with the #dbugfix hashtag and we’ll consider the possibility of seeding a bounty with Foundation money.

Please visit the Task Bounties page to see if anything else there strikes your fancy!

The HR Fund Status

The HR Fund currently sits at $16,345. We’re about to lose some of it to Adam for his work on Android and (hopefully) more to someone who takes on the iOS task. Currently, we’re looking into other opportunities to put some of it to use. We still have dreams of funding major work, so we need to continue to make the HR Fund grow.

You can help us by donating to the HR Fund campaign directly, or by using our special $60 campaign: donate $60 to the HR Fund and get a DConf 2019 t-shirt. We still have several shirts available, scattered throughout the world, so please take one off of someone’s hands!

AmazonSmile

In a previous post, I mentioned the AmazonSmile plugins Smile Always for Chrome and Smart Amazon Smile for Firefox as easy ways to support the D Language Foundation. These plugins ensure that every time you visit amazon.com you will be sent to smile.amazon.com instead to support your selected charity. If its the D Language Foundation, we get 0.5% of every eligible purchase you make (and sorry to the international folks, but the D Language Foundation is only available as a charity through the .com domain).

Now, you can also support the D Language Foundation through the Amazon Shopping App for Android. Visit the AmazonSmile Mobile page to see how.

DMD 2.088.0 Released

Digital Mars logoThe newest DMD has rolled off the assembly line and is ready for download. A total of 58 contributors fixed 58 bugs and introduced 27 major changes to version 2.088.0 of the compiler.

I’m always looking for the big ticket items in a new DMD release to highlight on the blog, but this is a workaday release that isn’t showing off anything too shiny in the changleog. Much of it is run-of-the mill maintenance: deprecations, removals, and behavior adjustments. All of that is important, and we all welcome it, but it doesn’t make for great reading on the blog. That said, there are a handful of useful additions that I can point to, one of which actually is a big deal when it comes to C++ interop.

std::string and std::vector

Thanks to the work Manu Evans has been performing and advocating, C++ interoperability gets a big boost in this release with bindings to std::string and std::vector in the DRuntime modules core.stdcpp.string and core.stdcpp.vector, respectively.  There’s one caveat with the std::string binding that anyone intending to use it must be aware of.

When compiling on Linux, where DMD makes use of the GCC libraries and linker, there’s a compatibility issue when using the modern version of std::string which is compliant with C++11. It contains an interior pointer, which in D is both illegal and incompatible with move semantics. The work around is to pass -D_GLIBCXX_USE_CXX11_ABI=0 to g++ and compile your D application with -version=_GLIBCXX_USE_CXX98_ABI. This will be resolved in the future when work on move constructors in D is complete.

New Utilities

The language gets an interesting new compile-time trait in the form of getLocation. Given a symbol, this trait will return a tuple containing the file name, line number, and column number at which the symbol appears in the source code. This opens the door to more informative debug logging and error reporting beyond the functionality already available via __FILE__ and __LINE__. And I’m sure folks will find other uses for it.

The standard library utility module std.file, which provides a lot of convenience functions for working with files as a unit, now has the new function getAvailableDiskSpace. Give it a directory path on Windows, or the path to a directory or file on Posix, and it will give you the number of bytes available on that path.

Other News

The Symmetry Autumn of Code 2019 participants all have mentors now and they are hard at work laying out their milestones. Milestone 1 officially kicks off on September 15, after which we can expect to see weekly updates from the participants in the General forum.

Google Summer of Code 2019 has come to an end. Five of our students submitted their work at the end of August. You can find information about their projects and view their code submissions from our GSOC projects page. Congratulations to all who participated!

The D Language Foundation is currently in discussions to put some of the Human Resource Fund to use in finalizing LDC support for iOS and Android. Hopefully, I’ll have details to report on that front in the very near future. In the meantime, please help us raise the HR Fund even higher than it is now. There’s some important work waiting to be done that will require as much money as we can throw at it. You can donate any amount directly to the HR Fund Campaign or use the special campaign we set up to send $60 to the HR Fund and get a DConf 2019 t-shirt in return.

Speaking of t-shirts, thanks to everyone who has made a purchase in our DLang Swag Emporium. You’ve helped us raise over $77 so far, all of which will go to the General Fund. If you haven’t yet dropped in, what are you waiting for? We’ve got t-shirts, stickers, and coffee mugs, with updates coming soon. It’s an easy way to support our favorite programming language!

 

SAOC 2019 Projects and Participants

Symmetry Investments logoLast Sunday, August 18, was the deadline for Symmetry Autumn of Code 2019 applications. We received a total of eight applications, which is the same number we saw last year. This time around we were able to accept more than three: five of the applicants will be participating.

The applications were reviewed by the five members of the SAOC 2019 Committee. Each member independently ranked the applications in order of preference. Points were assigned based on the rankings and the top five applications were accepted.

Before we get into the details of the projects, on behalf of the D Language Foundation and the SAOC team, I’d like to publicly thank all eight applicants for taking the time to submit an application. I’d also like to thank Laeeth Isharc and Symmetry Investments for sponsoring the event again this year, and our five SAOC Committee members for volunteering their time throughout the event:  John Colvin, Mathias Lang, Átila Neves,  Robert Schadek, and Ethan Watson. They will be monitoring the progress of each project through the milestone reports and ultimately will select one participant to receive an extra $1000 payment and an all-expense paid trip to DConf 2020.

The Projects

  • Multi-Level Intermediate Representation Support for LDC – According to the MLIR project README, it’s “a common intermediate representation” intended to “unify the infrastructure required to execute high performance machine learning models in TensorFlow and similar ML frameworks”. Roberto Rosmaninho’s primary project goal is to provide the LDC D compiler with “a new level of abstraction to support the integration of MLIR into the D ecosystem”. Roberto is working on a Computer Science major and is an undergraduate research assistant at Federal University of Minas Gerais in Brazil. His mentor for the project is Nicholas Wilson.
  • Implement DIP 1014 and expand support for C++ STL containers – Suleyman Sahmi’s main goal is to “advance the existing work on [the] D interface to C++ STL containers”. There is a project at GitHub geared toward that end which Manu Evans and Laeeth Isharc have been working on and which is blocked on the lack of an implementation for DIP 1014, along with a few issues with the D ABI and name mangling. He first intends to implement DIP 1014, then he’ll resolve several of the related DMD bugs and will use the remaining time to expand support for the C++ STL. Suleyman is a self-taught programmer from Morocco and already has become a contributor to DMD.
  • DPP with Linux kernel headers – The DPP tool, which allows D modules to directly #include C and C++ headers, currently is unable to work with the Linux kernel headers. Cristian Becerescu aims to fix that. If he is able to do so with time remaining, he will work on further improvements and refinements to DPP, including ironing out issues it might have with other C library headers the community brings to his attention. Cristian is a 4th-year Computer Science and Engineering student at University Politehnica of Bucharest. He is fortunate to have two mentors for this project in the form of Edi Staniloiu and Razvan Nitu.
  • Create a CI or other infrastructure for measuring D’s progress and performance – Max Haughton, an 18-year-old British physics student, will be taking on the task of “creating a mechanism by which we can measure various properties of the D ecosystem in a deterministic manner”. This includes properties such as compilation time, compile-time memory usage, and profiling the compiler to determine “why performance is what it is”. He also intends to extend it to run-time performance by “forming a set of benchmarks by which we can profile Phobos and druntime both against their versions…and the version of the compiler”.
  • Solve Dependency Hell: link with more than one version of the same project – When a project has dependencies that in turn rely on different versions of the same library, steps must be taken to reconcile the version difference in order to successfully compile. If it’s even possible, it’s cumbersome and introduces new difficulties. Tiberiu Lepadatu aims to solve this problem of Dependency Hell by making it possible to compile a project with multiple versions of the same library. This is considered as a crucial first step in making Phobos available via the DUB registry. Tiberiu is no stranger to D and has contributed to the core projects in the past. He will likely be working with Sebastian Wilzbach as his mentor.

Getting Under Way

The SAOC participants will spend the next three weeks preparing to get their projects started. They’ll be compiling their Milestones, doing research, and those without a mentor will be searching for one. Things officially kick off on September 15, with Milestone deadlines falling on the 15th of each month through January.

This year, we’ll be expecting the participants to make weekly updates in the forums. We will also encourage them to spend time on IRC, Slack, or Discourse to get to know the community, discuss their projects, and find inspiration in solving the challenges they’ll face. We encourage all members of the D community to show their support and help keep up motivation.

Each of these projects will improve the D ecosystem.We’re fortunate to have this opportunity, along with out participation in the currently ongoing Google Summer of Code, to get so much done without the need to raise more money or dig into our Human Resource Fund. We should all be willing to do what we can to help these projects succeed.

On a personal level, I’m looking forward to working with these five programmers in the coming months and to seeing all of them make it through to the end of a successful Symmetry Autumn of Code!