My vision for the future D

When Andrei Alexandrescu resigned as deputy head of the D programming language department, I was asked to take on this role in the future. There is no need to talk about it, but I’ll still say that this hat is too big on me.

I am still entering my new role in society and figuring out how I want to act and what it really is. This process does not take place in a vacuum, since Walter is also with us.



On the D forums, I was asked to write a blog post about my “dreams and next steps for D,” so here is the result. What I would like to become with D in the near future:



Memory security



“But D is a language with GC!”, I hear your exclamations. Yes, but it is also a system programming language with non-reference types and pointers, which means that today D is not completely safe for working with memory. DIP1000 was a step in the right direction (prim. borrowing system, as in Rust, see here ), but working with memory should be safe until the programmer refuses via “I know what I'm doing” with @ trusted attribute of a block or function. This implies a switch to @ safe by default.



Simple and reliable multithreading



We for the most part are already at the right point - using the actor model eliminates many of the problems that usually arise. It remains to finish work on the shared attribute and do everything @ safe .



Make D the default programming language



The possibilities of D in terms of static reflection and code generation make it an ideal candidate for creating code that should be called from several different languages ​​and environments (e.g. Python, Excel, R, etc.). This is usually done by specifying data structures and RPC calls in an interface definition language (IDL), and then translating them into supported languages ​​with the appropriate exchange protocol.



In the case of D, none of this is needed. You can write industrial code in D and with the help of libraries this code can be automatically called from other languages. Add to all this, you can easily write D code that works just as fast or faster than alternatives, and it will be a victory on all fronts.



Unrivaled reflection



Instead of disparate ways to work with fragmented APIs (__traits, std.traits, bikes), I would like to have a library that centralizes all the needs for reflection with a great API. I am already working on this.



Simplify interoperability with C ++



As I mentioned in my speech at DConf 2019 , C ++ achieved success by making the transition from C almost seamless. I would like current C ++ programmers with an outdated code base to just as easily start writing code in D. That's why I wrote dpp ( note: translator for C ++ headers in D), but that’s not all, and we may need to make changes to the language in order to adapt this in the future.



Development speed



I think we need an incredibly fast interpreter so that we can abandon the constant machine code generation and layout. In my opinion, this should be the standard way to run unittest blocks ( primitive unit tests are built into the language) to provide quick feedback, and so that programmers have to compile their code only for maximum performance and / or for deployment to end users. It would also allow for the introduction of REPL .



Interpolated Strings



Initially, I was against it, but the more I thought about it, the more it was logical for D. Why? String mixins. Code generation is one of the strengths of D, and string tokens allow you to visually delight blocks of code that are actually “just strings”. String interpolation would greatly simplify their use. So far, a draft DIP is under development.



This is what occurred to me after a long walk along Lake Geneva. I would like to know what the community thinks about it, what their favorite calluses and opportunities are in D, and how, in their opinion, this will help or hinder progress for D.



Discussion on the D-forum here



Translated using www.DeepL.com/Translator (this is not an automatic translation if someone has not noticed, but at the same time this translator with AI elements helps a lot)



PS Who missed the previous article from the blog about D plans for mobile development. She was suspected of advertising (oh, donat is mentioned) and expelled from hub D.



All Articles