Tracing D Applications

Posted on

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

Read more...

wc in D: 712 Characters Without a Single Branch

Posted on

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

Read more...

D For Data Science: Calling R from D

Posted on

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

Read more...

Saving Money by Switching from PHP to D

Posted on

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

Read more...

Ownership and Borrowing in D

Posted on

Nearly all non-trivial programs allocate and manage memory. Getting it right is becoming increasingly important, as programs get ever more complex and mistakes get ever more costly. The usual problems are: memory leaks (failure to free memory when no longer in use) double frees (freeing memory more than once) use-after-free (continuing to refer to memory … Continue reading Ownership and Borrowing in D

Read more...

Fuzzing Your D Application with LDC and AFL

Posted on

Fuzzing, or fuzz testing, is a powerful method to find hidden bugs in your application. The basic idea is to present random input to your application and monitor how it behaves. If it crashes or shows some other unusual behavior then you have found a bug. The use of true random input is not very … Continue reading Fuzzing Your D Application with LDC and AFL

Read more...

Flexible Default Function Parameters via structs with Nullable Fields

Posted on

The problem Sometimes we need to combine an aggregate of a set of values with an aggregate of the corresponding set of default values to create a combined result. The result for each member is either the explicitly specified value or, where no value is specified, the default value. This is similar to default function … Continue reading Flexible Default Function Parameters via structs with Nullable Fields

Read more...

DStep 1.0.0

Posted on

DStep is a tool for automatically generating D bindings for C and Objective-C libraries. This is implemented by processing C or Objective-C header files and outputting D modules. DStep uses the Clang compiler as a library (libclang) to process the header files. Background The first version of DStep was released on the 7th of July, … Continue reading DStep 1.0.0

Read more...

Project Highlight: DPP

Posted on

D was designed from the beginning to be ABI compatible with C. Translate the declarations from a C header file into a D module and you can link directly with the corresponding C library or object files. The same is true in the other direction as long as the functions in the D code are … Continue reading Project Highlight: DPP

Read more...

Memoization in the D Programming Language

Posted on

The D programming language provides advanced facilities for structuring programs logically, almost like Python or Ruby, but with high performance and the higher reliability of static typing and contract programming. In this article, I will describe how to use D templates and mixins for memoization, that is, to automatically remember a function (or property) result. … Continue reading Memoization in the D Programming Language

Read more...