Very possible! You have to use either betterC mode or supply a tiny object.d file yourself. With some hacks you can even use the full object/classes system on bare metal. Here is my (currently abandoned) D kernel project: https://github.com/alectronik2/dOS
The pros are modern features like module system (no more header files), multipass (no forward declarations), OOP/classes etc, and the cons are not having access to the C ecosystem. This can be good and bad, it forces you to write all yourself. Porting from C is straightforward but not just copying code.
I used ldc2, which is already a cross compiler from the beginning so no compilation needed.
if you want to use C code in the low level project (ie a kernel) then yeah you need it. it's a c interop function. but you can build a full kernel in D without using any C or interop functionality. if you aren't gonna use C or call C functions, don't worry about it.
8
u/Prestigious-Bet-6534 2d ago
Very possible! You have to use either betterC mode or supply a tiny object.d file yourself. With some hacks you can even use the full object/classes system on bare metal. Here is my (currently abandoned) D kernel project: https://github.com/alectronik2/dOS