btdu - a sampling disk usage profiler for btrfs (written in D)

Jacob Carlborg doob at
Tue Nov 10 09:40:33 UTC 2020

On Sunday, 8 November 2020 at 17:23:32 UTC, Vladimir Panteleev 

> - D programs that build fine on one Linux machine may still 
> fail to build with mysterious linking errors on another, even 
> when using Dub which takes care of dependency management. I saw 
> two counts of this, caused by differences in DMD/LDC and 
> Arch/Debian (one being that, for whatever reason, libz is not 
> pulled in on LDC/Debian despite being a Phobos dependency). 
> Also, LDC is the D compiler that's installed by default when 
> the system wants a D compiler (e.g. if you try do install Dub 
> by itself).

I don't think this is specific to D. I've seen in the past 
problems caused by package maintainers not building the package 
in the same way as upstream. Or they split up a package in 
multiple packages.

> - The garbage collector is still a major hindrance for system 
> programming. In this case it was due to the ioctls used being 
> slow, and when the GC tries to stop the world to do its thing, 
> it just hangs the entire program until ALL ioctls in all 
> threads complete.

You should probably never let the GC run on a realtime thread, 
like audio or video processing (not sure if ioctls falls into 
this category). These days, modern UIs should probably fall into 
the realtime category.

> This means it wasn't possible to have a stutter-free 
> interactive UI, so I had to move processing to subprocesses.

I'm not sure if it's possible to ever have a completely 
stutter-free UI with a stop-the-world GC.

> - One user wondered why the program needed so many threads. The 
> answer was that half of them were owned by the GC (it never 
> stops its worker threads, they just sit idle).

Is that the answer? I mean, the GC doesn't create any threads by 
itself, does it?

> - I used the Deimos ncurses bindings package. I'm thankful that 
> it already existed, though I had to push some fixes to fix 
> static linking. The most annoying part was waiting overnight 
> for to pick up the new tags, because there is no 
> way to get it to update a package unless you're the owner, and 
> no way to otherwise specify a dependency unless using a branch 
> (which is deprecated and prints a big warning when your users 
> build your program).

Since 2.094.0, you can specify a Git repository as a dependency 
[1]. You can also specify a local path as a dependency [2], 
useful when developing a library and an application at the same 
time, as two separate Dub packages.


More information about the Digitalmars-d mailing list