News for hackers. Stuff that matters.
Re:DConf 2019 in London by zerr on Friday February 15, 2019 @03:00AM (#19169248)
Considering the development and pace of modern C++, where does D stick nowadays?
Re:DConf 2019 in London by CyberShadow on Friday February 15, 2019 @03:19AM (#19169327)
D has:

- fast compilation times

- a module system

- famously powerful metaprogramming and compile-time introspection

- a familiar, but not ugly syntax

- comes with a package manager

- simple-to-use build tools with dependency discovery

- mostly-optional garbage collector (great for 90% projects!)

- interfaces with C and C++

- memory safe

C++ still has:

- header files

- a preprocessor

- infamously hard-to-parse syntax

- decades of legacy cruft

- fun things like design-by-SFINAE

My biggest reason to use D is that it works great for both small scripts (one program can be one file and is ran with one command, or even a shebang), and large projects (with packages / dependencies etc.). Similarly, if idiomatic D is too slow, you can optimize it by going as low as C or inline assembler without having to call-out to a lower-level language.

Source: using D for almost everything since 2006, while also maintaining a few C++ projects.

Re:DConf 2019 in London by zerr on Friday February 15, 2019 @01:05PM (#19173143)
The issue with D, I guess, how do you find gigs? :)
Re:DConf 2019 in London by WalterBright on Friday February 15, 2019 @03:49AM (#19169445)
Looking past the feature comparisons, it's simply a pleasure to program in D. It's easy to write code in D, it looks good once written, it's easy to refactor, and it performs as well as the equivalent C or C++ code.

The features are designed with an eye towards simple things should be simple, code should not have to written twice, the layout of the code should match the layout of the problem being solved (not the language), drudgery should be eliminated, and common bugs should be impossible.

Re:DConf 2019 in London by yarg on Friday February 15, 2019 @03:24AM (#19169353)
One thing that I like the look of in D (although just the LLVM version) is DCompute.

It's GPGPU functionality with an absolute minimum of boilerplate. Unfortunately it does not seem to be in active development.

Re:DConf 2019 in London by nicwilson on Friday February 15, 2019 @03:44AM (#19169430)
I'm not dead yet.

I've just had a bit of fun updating the SPIR-V backend to use https://github.com/KhronosGroup/SPIRV-LLVM-Translator instead of the old one which wasn't being updated. I'm in the process of adding clspv as a backend for Vulkan Compute shaders (in turn as a basis for targeting Intel's ispc compiler optimisations). Most of that fun involves bashing CMake around that head to try to get it to talk properly with pkg-config (I hate them both).

Re:DConf 2019 in London by yarg on Friday February 15, 2019 @05:15AM (#19169769)
Nice. Thanks for doing the ugly work so that other people don't have to.
Re:DConf 2019 in London by Profan on Friday February 15, 2019 @03:09AM (#19169284)
D is still miles ahead of C++ if you care about compile times, even in pathological cases (like using tons of templates and/or CTFE in your D code).
Re:DConf 2019 in London by zerr on Friday February 15, 2019 @05:31AM (#19169820)
When I hear about fast compile times, like e.g. for Pascal, immediately comes to mind - how good is optimization of the resulting executable? AFAIK, the back-end, not the front-end/parsing, takes most time when compiling C++. So in case of GCC or LLVM based D compilers, the time should be similar?
Re:DConf 2019 in London by atilaneves on Friday February 15, 2019 @06:56AM (#19170142)
> AFAIK, the back-end, not the front-end/parsing, takes most time when compiling C++

Is there a reason why you believe that to be true?

> So in case of GCC or LLVM based D compilers, the time should be similar?

They are not: https://atilanevesoncode.wordpress.com/2018/12/31/comparing-...

Re:DConf 2019 in London by atilaneves on Friday February 15, 2019 @06:58AM (#19170154)
C++ 11, 14 and 17 have all closed the gap with D in terms of features, but IMHO even when those features exist in C++ they're a lot harder to use and a lot easier to shoot oneself in one's foot.

You _can_ get things done in modern C++, it just takes longer and is buggier. In my experience, anyway.

Re:DConf 2019 in London by thepapanoob on Friday February 15, 2019 @03:17AM (#19169318)
try D! its a seemingly weird mixture of scripting languages and compiled ones. but ill all makes so much goddamn sense once you try it :)
Re:DConf 2019 in London by vaylian on Friday February 15, 2019 @03:44AM (#19169434)
Totally agree. It's been a while since I have last used D but my experience is that it hits a sweet spot between classical C-like compiled programming languages and scripting languages. If you need both, scripting and performance, D is a good pick. If you are already familiar with C or C++, getting into D is not that hard.

Disclaimer: Nowadays I am more enthusiastic about Rust than D, but I still consider D to be a very solid and nice language.