D: pay for what you use?

Rel relmail at rambler.ru
Thu Feb 13 09:04:43 PST 2014


Hello! I really enjoy D and some brilliant concepts in the 
language, like scope(exit) for example. But what I dislike about 
D is the druntime, where each single function depends on 100 
other functions. I'd like to be able to develop system level code 
in D (like windows drivers or linux kernel modules or do osdev), 
but I can not do it, as D is very dependent on the druntime. It 
would be great if D would have the same "pay for what you use" 
way, as C/C++ do. So I'd like to ask several questions:

1) Is it possible to fully disable exceptions? Generally I tend 
not to use exceptions in C++ as well, as exception path may take 
a whole lot of a time. Also returning error codes or using 
something like Expected<T> is more readable in most cases. 
Obviously I'm not going to use exceptions in my code, and I won't 
be linking with code that throws/catches exceptions.

2) Is it possible to fully disable runtime type information? I 
understand that being able to get different information about 
object type in the runtime may be very useful, but I've never 
used it. However D compilers do generate RTTI-tables no matter 
what with all class names, module names and etc.

3) Is it possible to fully disable garbage collection? Sometimes 
having GC is a good thing, but I'd rather do manual memory 
management or use automatic reference counting instead.

4) What compiler is better to use when I want to compile and run 
D on "bare bones" (running code without operating system)? Is it 
DMD? Or is it LDC? Or GDC?

5) Does anyone try to make a tiny druntime library? Did it work 
out well for you? And can I have a look at it?

PS I know that these kind of questions come out in the D 
community from time to time, but there's a lot of things I'd like 
to discuss on this subject, so I decided to make a new thread... 
sorry...


More information about the Digitalmars-d mailing list