Zig vs D generics

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Wed Oct 12 15:40:54 UTC 2022


On Wednesday, 12 October 2022 at 14:52:26 UTC, Tejas wrote:
> But C++20 introduced modules, which will massively reduce build 
> times
>
> Is that feature alone not enough to get up to C++20? It's such 
> a fundamental change

It might be, but I think only Microsoft has a complete 
implementation?

Regardless, C++20 "concepts" is basically syntax sugar, but it 
makes it so much less tedious to write generic code that it is a 
game changer in my view. If you want to write generic code that 
is (C++ code is often limited in terms of generic programming).

C++20 coroutines can potentially change the structuring of 
programs to such an extent at it might create "a new language" if 
used extensively, but I don't think many know how to make use of 
those yet, so the potential impact is difficult to judge.

Anyway, there is no shortage of new projects. Here is the number 
of new Github projects over the past two months:

language | number of new projects
----|-----
C++ | 133K
C    | 90K
Rust | 24K
Zig  |  0.4K
D    |  0.2K


Nearly an order of magnitude more new projects for C/C++ than 
Rust. Granted, getting within 10%, for Rust, is pretty impressive.

If we look at what the most starred new projects are used for we 
get:

* *C++*: wasm runtime, audible feedback app, a compiler-compiler, 
physics module, remote loader, database, firewall workaround,  etc

* *Rust*: tls, crypto-bot strategy, a javascript jit hack, drag 
and drop utility for GTK, sqlite filesystem, postgressql monitor, 
crypto currency tool, package manager improvement, text based ui 
library

* *Zig*: parsing project, bindings for opencv, ssl for wasm, 
webgpu library, validation library, protobuf library, binding for 
tensorflow, midi synth, coff file dump

* *D*: ui library, xml dom library, library for interfacing with 
xdg, cell-based text interface, a D library, config file library, 
math library, D sorting tool, pack/unpack tool, gameboy emulator 
(work in progress)


So there is a notable difference in what kind of projects we get 
as the most popular ones. If we compare Rust with C++ we see that 
the Rust ones are more geared towards tooling, crypto etc. I 
didn't go beyond the first page, though.

If we look at Zig then we see that it is mostly about building up 
the Zig eco system. For D we also get some of the same, basically 
libraries.

The volumes for Zig and D are low, so the results could be more 
random than the ones for Rust.



More information about the Digitalmars-d mailing list