[I had sent Walter an email, answering a question he asked me a few years ago. Walter asked me to post the message here. Slightly redacted - I took out an non-relevant aside, and since the forum doesn't support HTML bold, italic, underscore tags those have been stripped as well.]

Hi Walter,

You had asked me a question that I have been thinking about for a couple years.

Your question from 2009 was, “How can D become adopted at my company?”


*** What makes a language successful? ***

I think Stroustrup’s answer is the best metric I’ve heard: a language is successful if it is used. Or in my wording, if you know that technology can you get a job utilizing that technology.

Looking at all the successful languages, I have noticed that all the successful ones I am familiar with have had some sort of sponsor pushing the technology. For example, Ada by the U.S. government, C# by Microsoft, Objective-C by Apple, C and C++ by AT&T, Lua by PCU in Rio, REXX by IBM, the list goes on and on and on.

The only exception I can think of is Ruby, a successful language that prospered by a grassroots movement without a corporate, government, or academic sponsor as far as I’m aware.

My understanding is that Facebook is sponsoring D. At least in some capacity, I’m not sure of the details or extent. But still, it’s a start, and important, and Facebook has monetary resources.


*** What makes a language popular? ***

The classic chicken-and-egg problem. A language is popular because a lot of people use it. A lot of people use it because it is popular.

So how does a budding language like D become more popular? That’s a marketing and evangelist problem. And not my forte. But I have raised awareness of D with developers I know, word-of-mouth.

Some leading-edge independent developers have used D, and their programs demonstrate that D can walk-the-walk as well as talk-the-talk (e.g., Torus Troopers using D 0.110 and OpenGL).

Maybe Facebook could be convinced to pay some book writers to make D books.
   * Numerical Recipes in D
   * Design Patterns in D
   * The Dao of D
   * Harry Potter and the Frumious D Compiler


*** Who will use D?  And why?  And for what? ***

D is a neat language because it is a systems programming language, suitable as a more-than-viable alternative to C or C++.

But unlike C and C++, it has Safe D, which is eminently suitable for applications programming language. Sure, C and C++ are used as applications programming languages, but that’s not what they were designed for. D has an applications language story that is far more compelling than C and C++, and has the potential as a native applications programming language that VM based languages can’t touch.


*** What does D lack? ***

I think it is interesting to take a step back, and look at the whole enchilada of programming. From Python to BASIC, from SQL to Brainf**k.

I think all these following things could be asked for as D Project Requests to the D user community.

Web framework. What do people use Ruby on Rails, or slightly less popular Python and Django for? Is D a suitable alternative? Maybe, maybe not. D can do the compiling job, no doubt, but is there a “Rails” or “Django” for D that is as strong as, well, Rails or Django?

Scripting. Many games use Lua as an embedded scripting language. With mixin we could write our own DSL in D. Possibly even re-implement Lua-in-D. Yet, I think D could greatly benefit by coming with a canned scripting language (e.g., a Lua-like language), as a standard feature. Perhaps someone will do so (or has done so), and submit it for consideration. That would make plumbing up a do-it-yourself scripting language (like Lua-on-C) to your engine-written-in-D so much easier. If not Lua-in-D, perhaps JavaScript-in-D...?

Linux kernel in D. This would be a crazy project for someone who is a Linux lover, an operating systems wonk, a D enthusiast, and highly OCD. It is crazy because is a lot of effort to re-write something like a Linux kernel in another language, because it is a lot of work without any visible gain at the end. But the final result would showcase that D can do the heavy lifting of an operating system. Let’s see /language-X/ do that! (Where /language-X/ is not Assembly, C, C++, or Sing#.)

D on iOS. So for me personally, I would love to use D to write my applications for iOS, and OS X. But… I’m not sure how to do that. (The Objective-D project looks abandoned, never got out of the “toy” project stage, and doesn’t bridge Cocoa’s Frameworks written in Objective-C to D/Objective-D anyway.)

D for .NET. Or I would love to use D to write my applications for .NET … and again, I’m not sure how to do that. (The D.NET project looks abandoned, and never got out of the “toy” project stage. And I don’t see a way to generate CIL from D.)

(For the above two D Project Requests, I have to admit I haven’t really looked all that hard. So they could be already solved problems that I’m just ignorant of the existing solution.)


*** What features would you add to D? ***

I think these two features would help D tremendously:
   * D comes with a canned embedded scripting language, like Lua
* D comes with the Objective facilities, like those found in Objective-C

For embedded scripting languages, Lua has shown it has the right balance of tiny-tiny-tiny footprint, rich expressivity, and highly performant. It has been used in many games like World of Warcraft, and desktop applications such as the logic-and-UI language for Adobe Lightroom.

So why not just use Lua itself in D? Because Lua has a nice Lua-to-C API, and in my opinion having Lua-in-D would be able to leverage some of D’s strengths and make the scripting language seamless.

The Objective portion of Objective-C is very interesting. The amazing advantage of Objective-Whatever is not in the Whatever inasmuch as it is in what the Objective portion brings to the table. Since all Objective objects use message-and-dispatch mechanism, it means that frameworks all become incredibly loosely coupled. Also do to late-binding and the dispatch mechanism, anyone can extend any class or proxy any class or remote proxy any class, easily, even without source code.

To illustrate, I will compare C++ to Objective-C. In C++, if you have a public API that takes in a std∷string const& as a parameter, you will soon discover that the std∷string const& is intimately affected by the compiler used and the optimization settings. In Objective-C, the Objective string objects can be mixed-and-matched from different frameworks in which different string objective have entirely different implementations, but all comply with the same message contract. And any framework can extend all the string objects used with novel functionality. That de-coupling is super-important for scalability, including plug-ins and extension frameworks.


*** What’s the future of programming? ***

The “Next Big Thing” for computer languages probably won’t be emphasizing their super-awesome encapsulation and way-cool message-and-dispatcher based de-coupling. :-)

I think the Next Big Thing in computer languages is rich DSL support, which will enable more complexity by simplifying what needs to be written in a more suitably (i.e., domain specific) expressivity. Due to mixin and generational programming, I think D enables DSL grammars really-really-really well.

Also, due to a confluence of factors, the rising star for becoming the most widely used programming language is JavaScript. I have to say, I’m not a fan of JavaScript. I’ve seen the leading edge of compile-to-JavaScript languages, such as CoffeeScript and DART. Can D get on that bandwagon and have the D compiler compile to JavaScript as some sort of IL? I know that sounds like utter crazy talk, like Script# (C# to JavaScript compiler).

Sincerely,
Eljay

Reply via email to