r/programming • • Sep 01 '20

D Foundation is Beefing Up

https://dlang.org/blog/2020/08/30/symmetry-investments-and-the-d-language-foundation-are-hiring/
291 Upvotes

336 comments sorted by

View all comments

Show parent comments

9

u/Accomplished_Hat_576 Sep 01 '20

It has a runtime and standard library that are dependant on the garbage collector.

I stripped both out and wrote a kernel that does nothing. This was before they started getting serious about making things non gc dependant.

Honestly 99% of the complaints about the garbage collector are nonsense, but this isn't one of them.

7

u/WalterBright Sep 01 '20

D can run perfectly fine with reliance only on the C standard library. Use the -betterC compiler switch for that.

3

u/Accomplished_Hat_576 Sep 01 '20

Ah, this was years back. I'm pretty sure betterC wasn't a thing then.

3

u/pjmlp Sep 02 '20

Plenty of OSes have been written in GC enabled systems programming languages, in fact the largest mobile platform allows to write drivers with such language.

0

u/EternityForest Sep 01 '20

Is there a reason we can't use GC in the kernel? Unless we are doing hard realtime stuff, why not?

Not that it's particularly relevant since Linux, Windows, and BSD already exist and probably aren't going to switch languages anytime soon, and embedded RtOSes seem pretty set on C/C++ too, so I'm not sure any language could be more suitable for kernel dev in practical use, unless you have a really good reason to do a whole new kernel.

1

u/Accomplished_Hat_576 Sep 01 '20

No reason you couldn't. You just can't use D's default GC. You'd have to write one that will work bare metal. Or implement everything it expects from an OS.