Readit News logoReadit News
Kapendev commented on Why we built Lightpanda in Zig   lightpanda.io/blog/posts/... · Posted by u/ashvardanian
brabel · 8 days ago
> Don't use betterC as a global @nogc attribute.

Well I am not, but thanks.

Kapendev · 8 days ago
> Using D in betterC mode is what I am most interested about

Well you will. It's a common mistake new D users do.

Kapendev commented on Why we built Lightpanda in Zig   lightpanda.io/blog/posts/... · Posted by u/ashvardanian
brabel · 10 days ago
I really like D and want to use D instead of Zig if I can...

But it's difficult to do so! Nothing to do with marketing in my case, at least. The reasons are :

* `dub` is badly documented and does dumb things like including test code in the generated binary.

* `serve-d` is terrible. It can't handle even my little hello world programs - either crashes or consumes 100% CPU until I manually kill it.

* MacOS support sucks. All the time I have problems: the linker didn't work for years (fixed now). Immediate segmentation faults currently (fixed in nightly AFAIK). C code using the new flat128 doesn't compile (I think it was fixed already?). Just constant frustration.

* Too many features, many broken. It has an experimental borrow-checking feature, I tried to use it but it's largely undocumented. People in the Forum told me to that feature is completely unfinished. It has an allocators package as well, but no idea how I can make use of those like I would in Zig. Would love to see a well written post about that.

Using D in betterC mode is what I am most interested about exactly because it looks more like Zig and C than Java - and performs much better. But currently, that means forgetting about Phobos, the standard library, as that's written exclusively with GC and Exceptions in mind. Maybe that's ok as you can just use all C libraries you want, but would be nice to have some D conveniences to make that worthwhile.

Apart from that, I completely agree that D's comptime and metaprogramming is the best I've seen in any language (except for Lisp of course). All I need to keep using D is much better tooling and clarification about what parts of the language are "half-baked" (especially around DIP1000) and which parts are stable - perhaps "editions" will give us that, will check it out when it's ready. Oh and also top-notch MacOS support... I know that's a moving target but even Zig manages to handle that just fine, why not D?!

Kapendev · 8 days ago
Don't use betterC as a global @nogc attribute. This flag does more than just remove the garbage collector and adds extra checks that can sometimes be overly restrictive. If writing GC-free code is important and compiler assistance is really needed, then add @nogc: at the top of every file. But even that is a bit extreme because the @nogc attribute is just a hint to the compiler, telling it to check that called functions also carry that hint. It is not essential for writing GC-free code.

My library for example is not using the GC, but I don't put @nogc on every function because it does not make sense. Here is the link to the library: https://github.com/Kapendev/joka

Kapendev commented on Why we built Lightpanda in Zig   lightpanda.io/blog/posts/... · Posted by u/ashvardanian
johnfn · 10 days ago
Why would a comment suggesting to use D not be the place to have a conversation for why D doesn't see adoption?
Kapendev · 10 days ago
You and Walter could do that, but this post is about some cool devs and their cool Zig project.
Kapendev commented on Why we built Lightpanda in Zig   lightpanda.io/blog/posts/... · Posted by u/ashvardanian
Fire-Dragon-DoL · 10 days ago
Why D sees low adoption?
Kapendev · 10 days ago
Good question, but I don't think this is the place for that conversation :) And I say that as a Dlang fan :)
Kapendev commented on I spent a year making an ASN.1 compiler in D   bradley.chatha.dev/blog/d... · Posted by u/BradleyChatha
mort96 · 2 months ago
My conclusion remains that the language is fractured by the optional GC and that its adoption was severely hampered by the proprietary toolchain. Nothing you have said meaningfully challenges that in my opinion, and many things you've said supports it. I don't think anything I've said is misleading.
Kapendev · 2 months ago
> language is fractured by the optional GC

That's an interesting fantasy you have constructed. You should try listening to the people who actually use it.

u/Kapendev

KarmaCake day9October 24, 2025
About
I make cool games sometimes. GitHub: https://github.com/Kapendev

Them games: https://kapendev.itch.io/

View Original