• 0

D programming language


Question

I'm curious if anybody else here has ever looked at or used the D programming language. Personally, it's my favorite programming language and I find it much more enjoyable to use than any other language. It was designed to be a successor of C and C++, although it's not backwards compatible and a very different language. It's a modern language in many aspects including garbage collection, exception handling, modules, dynamic arrays, associative arrays, functional programming (pure, immutable, shared, etc.), and much more. At the same time, it's a systems programming language - It compiles to machine code, supports pointers, inline assembly, and is fully linkable with C.

While the language itself is great, there are other problems. There isn't a huge number of libraries available for D, and many are out of date or not of the best quality. There are two standard libraries, the official Phobos and the unofficial Tango, which causes some fragmentation in the community. No IDE has full support for D yet, the best is perhaps DDT, a plugin for Eclipse. The best way to participate in the community is a newsgroup server with a buggy web client.

I'm hopeful for the future of D, but I simply don't find it reliable enough for serious development. I don't think it simply needs more time, it's been developed for over 10 years now. What it really needs is growth in the community and a serious effort to make D mainstream.

Link to comment
https://www.neowin.net/forum/topic/1014486-d-programming-language/
Share on other sites

21 answers to this question

Recommended Posts

  • 0

D is on my list of languages to learn, but I'm wary of spending time on it for fear that it is going to fade into obscurity. I guess that makes me part of the problem, rather than the solution, but it does seem to have some good ideas going for it.

  • 0

From what I've seen, it's what C++ should have been. Unfortunately, it's too late to dethrone C++ as the standard, best-supported way of doing native code for any platform. All the compilers, IDEs, tooling, libraries etc. Also, the big C++ libraries (boost, stl) are template libraries and thus unusable by any language other than C++.

  • 0
Why would you choose this over other things?
C++ has many problems. Compilation takes ages, headers are a maintenance nightmare, and basically every feature of it is a pitfall*. Its popularity and level of support is what makes it essential; there are way better languages that achieve the same goals, like D or Go.

C# isn't meant to replace C++.

*see this and this.

  • 0

The one thing that D possibly does better than any other language is metaprogramming.

1. Templates

Templates in D are a pleasure to work with. The syntax is clean, predictable, and very powerful. Unlike C++ in which templates are attached to a function or class, D can define templates independent of any other construct.

void main(string[] args){
	// D doesn't use angle brackets which causes many syntactic problems in C++
	foo!(string).value = "Hello!";
	foo!(int).value = 300;

	// In certain cases, the parenthesis are omissible
	writeln(foo!string.value);
	writeln(foo!int.value);

	// D programs are correct - Even though main has no return value, it will always return zero...
	// Unless an exception occurs, in which case, the program will return a non-zero value
}

// Things don't have to be declared in order; No need for prototyping.
template foo(T){
	T value;
}

D does have syntactic sugar for defining templates as part of a function or class.

void main(string[] args){
	// Largest floating point type supported by hardware, typically 80-bits
	real[] arr;

	// Template arguments can be implicitly derived from function arguments
	foo(arr);
}

void foo(T)(T[] arr){ }
class N(T){ }

Template Constraints consists of specialization and if statements.

template foo(int V : 300){ }
template foo(int V : 400){ }
template foo(int V) if(V > 1000){ }

2. Mixins

Mixins can be used to essentially paste a template or string into code at compile time.

void main(string[] args){
	int a = 35, b = 40;
	writeln(mixin("a + b"));
}

3. Static If

Static if allows you to define conditions at compile time which will include or exclude code. This is similar to using #if, #endif in C. Unlike C, static if is not a separate language. The condition can access constants or call functions at compile time.

void main(string[] args){
	foo();
}

const v = 30;
static if(v > 0){
	void foo(){
		writeln("What?");
	}
}

4. Compile Time Function Execution (CTFE)

All of the features above ultimately adds up to this - CTFE. CTFE means that D can interpret code at compile time to do all sorts of meaningful metaprogramming in a much less complex manner. The standard sort function allows you to define a custom condition for sorting:

void main(string[] args){
	struct ST{
		string name;
	}

	ST[] arr;
	sort!("a.name < b.name")(arr);
}

Just how powerful is it? scregexp is a statically compiled regular expression library for D. You provide a regular expression as a template argument, like in the example above, and CTFE is used to generate a static routine from that regular expression at compile time.

  • 0

*bump* So there's been some positive developments in the D community recently.

The best news first, bugs are being fixed at a faster rate than ever. The community is very devoted to making D stable and production ready. The D compiler and standard library (Phobos) are hosted on Github, so anybody can contribute to its development.

http://www.dlang.org/bugstats.php

New simple domain: http://www.dlang.org/

There's a new web interface for the newsgroups to replace the old, horrid one. It mimics a forum, though it also has threaded views and is a pleasure to use. It uses Gravatar or identicons to generate unique avatars for everybody. It's also really snappy because, well, it's written in D. :p

http://forum.dlang.org/

D 1.x will be discontinued by the end of this year, leaving just the D 2.x branch.

There are fewer breaking changes, and they're clearly marked in the changelog now.

While there's an unofficial third-party standard library called Tango, it doesn't officially support D 2.x, only some unofficial branches. So this leaves Phobos as the official and only standard library for D 2.x.

While little work has been done on this, there's been lots of discussion about improving the garbage collector as well as revamping the standard library for manual memory management. At the moment, the GC isn't great and turning it off means you can't use the standard library.

The website is still a mess at the moment, with several broken links and out of date material. A better place to start would be the Wiki.

http://prowiki.org/wiki4d/

There's a free ebook available here which is still in the process of being translated to english:

http://ddili.org/ders/d.en/index.html

  • 0

Is there a way to use D in Visual Studio?

Wiki4D is the place to find this info (check the links on the left), but what you're looking for is Visual D.

While I agree that C++ should of been like D, but I know D will never be useful. It was dead, before it even began.

There's a small number of people using D in the real world. As D matures, its usage will grow, but it's hard to say if it can ever succeed C++.

  • 0

There's a small number of people using D in the real world. As D matures, its usage will grow, but it's hard to say if it can ever succeed C++.

I'd probably be a bit more optimistic about it's success if you'd said that there's 'a small number of large-corporations using D in the real world.'

It's just not apparent to me where it could wedge itself in amongst the current mainstay languages of real-world enterprise development.

  • 0
C# is the future. It overtook D in a matter of months.
They don't have the same purpose; C# is meant for application development, D (and C++) is for systems programming.

That said, I want to agree that C# pretty much pwns everything at the moment. It has been used to develop operating systems (1, 2), so it's demonstrated its viability for systems programming even though that's not its original vocation. D looks very well-designed, seemingly better than C# (at least the way it handles generics and compile-time evaluation of functions), but it's not a CLI language and as such it's isolated from the rich ecosystem of libraries and languages built around .NET.

A lot of platforms today don't support .NET, and by platforms I mean every piece of electronic equipment we use including computer hardware (device drivers), routers, cars, airplanes, gps, etc. Then again, they often only support C (not even C++!), so there's little hope for D there as well.

So, for D, the only avenue I see is for new performance-critical components for PC applications, which would currently require C++. Whenever performance is not an absolute, a .NET language will be better simply because of the interoperability with .NET libraries and other CLI languages.

  • 0

There's a small number of people using D in the real world. As D matures, its usage will grow, but it's hard to say if it can ever succeed C++.

How many years has it been out, and no one really did accept accept it yet?

  • 0

How many years has it been out, and no one really did accept accept it yet?

Between 2006-2009 (4 years), there were 2000 bug fixes. Between 2010-2011 (2 years), there were nearly 3000. As well, less work is being done the language design and much more on the standard library. So things are picking up and D is finally maturing. There's lots of work yet to be done, and it may be years to come, but they'll get there eventually. I'm just afraid it could be too little, too late.

  • 0

Between 2006-2009 (4 years), there were 2000 bug fixes. Between 2010-2011 (2 years), there were nearly 3000. As well, less work is being done the language design and much more on the standard library. So things are picking up and D is finally maturing. There's lots of work yet to be done, and it may be years to come, but they'll get there eventually. I'm just afraid it could be too little, too late.

Yeah, I believe it is a little too late for D. It would be nice, if it had a market for it, but I rarely ever hear about the language to see a market.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Well Statcounter doesn't count Edge users as Chrome. It uses the user agent and my understanding is the Brave browser users the standard Chrome user agent for privacy/tracking reasons and compatibility so that would help the Chrome numbers. Some Firefox users change the user agent for again compatibility reasons. I am going to totally guess the Chrome numbers are inflated some 5 or 6%.
    • BATorrent 4.0.0 by Razvan Serea BATorrent is a lightweight, open-source BitTorrent client built with modern C++ and Qt 6, offering a clean, fast, and privacy-focused alternative to traditional torrent apps. It supports magnet links, .torrent files, resume data, sequential downloading, per-file priorities, and even imports from qBittorrent. Power users benefit from integrated RSS auto-download with regex filtering, duplicate detection, and automatic tracker lists from Stremio. Streaming is seamless thanks to auto-detected players like VLC and IINA. BATorrent includes robust VPN tools—interface binding, auto-detection for WireGuard-based services like Mullvad and NordLynx, kill switch, proxy support, and IP filtering. A full WebUI enables remote control, while integrations with Plex, Jellyfin, and Emby automate library updates. With themes, speed scheduling, system-tray alerts, and cross-platform support for Windows, Linux, and macOS, BATorrent delivers a polished, high-performance torrenting experience. BATorrent features: Core .torrent file and magnet link support Resume data — picks up where you left off after restart Import torrents from qBittorrent Create .torrent files from any file or folder Sequential download mode Per-file priority control (skip, low, normal, high) Seed ratio limits with auto-pause DHT, PEX, UPnP, NAT-PMP RSS Auto-Download Subscribe to RSS feeds — automatically download new torrents as they appear Regex filters — match only what you want (e.g. 1080p|720p, S01E\d+) Per-feed settings — custom save path, check interval (5–1440 min), enable/disable Auto-download — matched items are downloaded automatically in the background Supports magnet links, .torrent URLs, and tags Tray notifications when items are auto-downloaded Duplicate detection — never downloads the same item twice Stremio Stremio Addon System pre-installed — works out of the box Auto tracker list from ngosang/trackerslist Streaming Play while downloading — stream video files before the download is complete Supports mp4, mkv, avi, mov, wmv, flv, webm, m4v, ts Auto-detects installed players (VLC, IINA, system default) VPN & Privacy Interface binding — lock torrent traffic to a specific network interface (e.g. tun0) Auto VPN detection — identifies VPN interfaces (tun, tap, WireGuard, Mullvad, NordLynx, ProtonVPN) Kill switch — automatically pauses all torrents if the VPN interface drops Auto-resume — resumes only the torrents paused by the kill switch when VPN reconnects Proxy support — SOCKS5 and HTTP proxy with optional authentication IP filtering — load P2P blocklists to block unwanted IP ranges Protocol encryption (enabled / forced / disabled) WebUI Remote management — control torrents from any browser at http://localhost:8080 REST API with JSON responses Add torrents via magnet link or .torrent upload Pause, resume, remove torrents remotely View peers and files per torrent Dark theme matching the desktop app HTTP Basic Auth with SHA-256 password hashing Configurable port and remote access (localhost vs 0.0.0.0) Interface 3 themes: Dark, Light, Midnight (bat/vampire aesthetic) Real-time speed graph Detailed panel with tabs: General, Peers, Files, Trackers Filter bar: search by name, filter by state (Active, Downloading, Seeding, Paused, Finished) Drag & drop .torrent files and magnet links Drag & drop reorder in torrent list System tray with notifications (download complete, kill switch events, RSS auto-downloads) Splash screen with bat animation Bilingual: English and Portuguese (BR), auto-detected from system locale Bandwidth Scheduler Alternative speed limits — set different download/upload limits on a schedule Time range — configure active hours (e.g. 01:00 to 07:00), supports overnight ranges Per-day control — choose which days of the week the schedule applies Automatically switches between normal and alternative speeds Media Server Integration Plex — automatically trigger library scan when a download completes Jellyfin / Emby — same automatic library refresh via API Configure server URL and authentication token/key in Settings System Cross-platform: Windows, Linux, macOS Auto-shutdown — automatically shut down PC when all downloads complete (60s cancellable countdown) Auto-update system (AppImage on Linux, installer on Windows, DMG on macOS) CLI arguments: pass .torrent files or magnet: URIs directly Keyboard shortcuts: Space to toggle pause, Ctrl+A to select all, Ctrl+O to open Download: BATorrent 4.0.0 | 37.4 MB (Open Source) Download: BATorrent Portable | 51.7 MB Links: BATorrent Website | Screenshot | Changelog Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Well duh. But it's not their agenda, they just push it forward.
    • Easier to move to Firefox, either Zen Browser or LibreWolf (which includes it by default)
  • Recent Achievements

    • One Month Later
      jojodbn earned a badge
      One Month Later
    • Week One Done
      jojodbn earned a badge
      Week One Done
    • One Year In
      jojodbn earned a badge
      One Year In
    • Week One Done
      D0nn13 earned a badge
      Week One Done
    • Reacting Well
      lamborghiniv10 earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      515
    2. 2
      PsYcHoKiLLa
      231
    3. 3
      +Edouard
      108
    4. 4
      ATLien_0
      88
    5. 5
      Steven P.
      83
  • Tell a friend

    Love Neowin? Tell a friend!