Driving with D

Here is what comes to mind when I think of D: fast, expressive, easy, and… driving? That’s right, I drive with D. Enter my venerable Holden VZ Ute daily driver. From the factory, it came with a rubbish four-speed automatic gearbox. During 18 months of ownership, I destroyed four gearboxes. I could not afford a… Continue reading Driving with D

Function Generation in D: The Good, the Bad, the Ugly, and the Bolt

Introduction A while ago, Andrei Alexandrescu started a thread in the D Programming Language forums, titled “Perfect forwarding”, about a challenge which came up during the July 2020 beerconf: Write an idiomatic template forward that takes an alias fun and defines (generates) one overload for each overload of fun. Several people proposed solutions. In the… Continue reading Function Generation in D: The Good, the Bad, the Ugly, and the Bolt

A Pattern for Head-mutable Structures

When Andrei Alexandrescu introduced ranges to the D programming language, the gap between built-in and user-defined types (UDTs) narrowed, enabling new abstractions and greater composability. Even today, though, UDTs are still second-class citizens in D. One example of this is support for head mutability—the ability to manipulate a reference without changing the referenced value(s). This… Continue reading A Pattern for Head-mutable Structures

A Look at Chapel, D, and Julia Using Kernel Matrix Calculations

Introduction It seems each time you turn around there is a new programming language aimed at solving some specific problem set. Increased proliferation of programming languages and data are deeply connected in a fundamental way, and increasing demand for “data science” computing is a related phenomenon. In the field of scientific computing, Chapel, D, and… Continue reading A Look at Chapel, D, and Julia Using Kernel Matrix Calculations

DustMite: The General-Purpose Data Reduction Tool

If you’ve been around for a while, or are a particularly adventurous developer who enjoys mixing language features in interesting ways, you may have run into one compiler bug or two: Implementation bugs are inevitably a part of using cutting-edge programming languages. Should you run into one, the steps to proceed are generally as follows:… Continue reading DustMite: The General-Purpose Data Reduction Tool

Tracing D Applications

At one time or another during application development you need to make a decision: does your application work like it should and, if not, what is wrong with it? There are different techniques to help you decide, some of which are logging, tracing, and profiling. How are they different? One way to look at it… Continue reading Tracing D Applications

wc in D: 712 Characters Without a Single Branch

After reading “Beating C With 80 Lines Of Haskell: Wc”, which I found on Hacker News, I thought D could do better. So I wrote a wc in D. The Program It consists of one file and has 34 lines and 712 characters. import std.stdio : writefln, File; import std.algorithm : map, fold, splitter; import… Continue reading wc in D: 712 Characters Without a Single Branch

D For Data Science: Calling R from D

D is a good language for data science. The advantages include a pleasant syntax, interoperability with C (in many cases as simple as adding an #include directive to import a C header file via the dpp tool), C-like speed, a large standard library, static typing, built-in unit tests and documentation generation, and a garbage collector… Continue reading D For Data Science: Calling R from D

Saving Money by Switching from PHP to D

2night was born in 2000 as an online magazine focused on nightlife and restaurants in Italy. Over the years, we have evolved into a full-blown experiential marketing agency, keeping up our vocation of spreading what’s cool to do when you go out, but specialized in producing brand events and below-the-line unconventional marketing campaigns. We started… Continue reading Saving Money by Switching from PHP to D