{"id":2225,"date":"2019-10-15T12:51:40","date_gmt":"2019-10-15T12:51:40","guid":{"rendered":"http:\/\/dlang.org\/blog\/?p=2225"},"modified":"2021-09-30T13:38:02","modified_gmt":"2021-09-30T13:38:02","slug":"my-vision-of-ds-future","status":"publish","type":"post","link":"https:\/\/dlang.org\/blog\/2019\/10\/15\/my-vision-of-ds-future\/","title":{"rendered":"My Vision of D&#8217;s Future"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"alignleft size-thumbnail wp-image-2163\" src=\"http:\/\/dlang.org\/blog\/wp-content\/uploads\/2019\/08\/royal_d-200x200.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/dlang.org\/blog\/wp-content\/uploads\/2019\/08\/royal_d-200x200.png 200w, https:\/\/dlang.org\/blog\/wp-content\/uploads\/2019\/08\/royal_d.png 250w\" sizes=\"(max-width: 200px) 100vw, 200px\" \/>When Andrei Alexandrescu stepped down as deputy leader of the D programming language, I was asked to take over the role going forward. It\u2019s needless to say, but I\u2019ll say it anyway, that those are some pretty big shoes to fill.<\/p>\n<p>I\u2019m still settling into my new role in the community and figuring out how I want to do things and what those things even are. None of this happens in a vacuum either, since Walter needs to be on board as well.<\/p>\n<p>I was asked <a href=\"https:\/\/forum.dlang.org\/post\/lcrsrevmvtnbqsqktsbe@forum.dlang.org\">on the D forums<\/a> to write a blog post on my \u201cdreams and way forward for D\u201d, so here it is. What I\u2019d like to happen with D in the near future:<\/p>\n<h3 id=\"memorysafety\">Memory safety<\/h3>\n<p>\u201cBut D has a GC!\u201d, I hear you exclaim. Yes, but it\u2019s also a systems programming language with value types and pointers, meaning that today, D isn\u2019t memory safe. <a href=\"https:\/\/github.com\/dlang\/DIPs\/blob\/master\/DIPs\/other\/DIP1000.md\">DIP1000 was a step in the right direction<\/a>, but we have to be memory safe unless programmers opt-out via a \u201cI know what I\u2019m doing\u201d <code>@trusted<\/code> block or function. This includes transitioning to <code>@safe<\/code> by default.<\/p>\n<h3 id=\"safeandeasyconcurrency\">Safe and easy concurrency<\/h3>\n<p>We\u2019re mostly there\u2014using the actor model eliminates a lot of problems that would otherwise naturally occur. We need to finalize <code>shared<\/code> and make everything <code>@safe<\/code> as well.<\/p>\n<h3 id=\"makedthedefaultimplementationlanguage\">Make D the default implementation language<\/h3>\n<p>D\u2019s static reflection and code generation capabilities make it an ideal candidate to implement a codebase that needs to be called from several different languages and environments (e.g. Python, Excel, R, \u2026). Traditionally this is done by specifying data structures and RPC calls in an Interface Definition Language (IDL) then translating that to the supported languages, with a wire protocol to go along with it.<\/p>\n<p>With D, none of that is necessary. One can write the production code in D and have libraries automagically make that code callable from other languages. Add to all of this that it\u2019s possible and easy to write D code that runs as fast or faster than the alternatives, and it\u2019s a win on all fronts.<\/p>\n<h3 id=\"secondtononereflection.\">Second to none reflection.<\/h3>\n<p>Instead of disparate ways of getting things done with fragmented APIs (<code>__traits<\/code>, <code>std.traits<\/code>, custom code), I\u2019d like for there to be a library that centralizes all reflection needs with a great API. I\u2019m currently working on it.<\/p>\n<h3 id=\"easierinteropwithc.\">Easier interop with C++.<\/h3>\n<p>As I mentioned in <a href=\"https:\/\/www.youtube.com\/watch?v=79COPHF3TnE&amp;t=1s\">my DConf 2019 talk<\/a>, C++ has had the success it\u2019s enjoyed so far by making the transition from C virtually seamless. I want current C++ programmers with legacy codebases to just as easily be able to start writing D code. That\u2019s why I wrote dpp, but it\u2019s not quite there yet and we might have to make language changes to accommodate this going forward.<\/p>\n<h3 id=\"fastdevelopmenttimes.\">Fast development times.<\/h3>\n<p>I think we need a ridiculously fast interpreter so that we can skip machine code generation and linking. To me, this should be the default way of running <code>unittest<\/code> blocks for faster feedback, with programmers only compiling their code for runtime performance and\/or to ship binaries to final users. This would also enable a REPL.<\/p>\n<h3 id=\"stringinterpolation\">String interpolation<\/h3>\n<p>I was initially against this, but the more I think about it the more it seems to make sense for D. Why? String mixins. Code generation is one of D\u2019s greatest strengths, <a href=\"https:\/\/dlang.org\/spec\/lex.html#token_strings\">and token strings enable<\/a> visually pleasing blocks of code that are actually \u201cjust strings\u201d. String interpolation would make them vastly easier to use. As it happens, <a href=\"https:\/\/github.com\/dlang\/DIPs\/pull\/165\">there\u2019s a draft DIP for it<\/a> in the pipeline.<\/p>\n<p>That\u2019s what I came up with after a long walk by Lake Geneva. I\u2019d love to know what the community thinks of this, what their pet peeves and pet features would be, and how they think this would help or hinder D going forward.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When Andrei Alexandrescu stepped down as deputy leader of the D programming language, I was asked to take over the role going forward. It\u2019s needless to say, but I\u2019ll say it anyway, that those are some pretty big shoes to fill. I\u2019m still settling into my new role in the community and figuring out how [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[8,6,20],"tags":[],"_links":{"self":[{"href":"https:\/\/dlang.org\/blog\/wp-json\/wp\/v2\/posts\/2225"}],"collection":[{"href":"https:\/\/dlang.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dlang.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dlang.org\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/dlang.org\/blog\/wp-json\/wp\/v2\/comments?post=2225"}],"version-history":[{"count":3,"href":"https:\/\/dlang.org\/blog\/wp-json\/wp\/v2\/posts\/2225\/revisions"}],"predecessor-version":[{"id":2228,"href":"https:\/\/dlang.org\/blog\/wp-json\/wp\/v2\/posts\/2225\/revisions\/2228"}],"wp:attachment":[{"href":"https:\/\/dlang.org\/blog\/wp-json\/wp\/v2\/media?parent=2225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dlang.org\/blog\/wp-json\/wp\/v2\/categories?post=2225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dlang.org\/blog\/wp-json\/wp\/v2\/tags?post=2225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}