Signed word lengths and indexes
bearophile
bearophileHUGS at lycos.com
Tue Jun 15 12:58:43 PDT 2010
Don:
>Indeed, only a subset of D is useful for low-level development.<
A problem is that some of those D features (that are often useful in application code) are actively negative for that kind of development.
>But D has more close-to-the-metal features than C does.<
I don't know if those extra D features are enough. And the C dialect used for example by Linux is not standard C, it uses many other tricks. I think D doesn't have some of them (I will try to answer this better to a Walter's post).
A recent nice post by Linus linked here by Walter has partially answered a question I have asked here, that is what language features a kernel developer can enjoy that both C and C++ lack. That answer has shown that close-to-the-metal features are useful but they are not enough.
I presume it's not even easy to express what those more important things are, Linus writes:
>So I agree that describing the data is important, but at the same time, the things that really need the most description are how the data hangs together, what the consistency requirements are, what the locking rules are (and not for a single data object either), etc etc. And my suspicion is that you can't easily really describe those to a compiler. So you end up having to write that code yourself regardless. And hey, maybe it's because I do just low-level programming that I think so. As mentioned, most of the code I work with really deeply cares about the kinds of things that most software projects probably never even think about: stack depth, memory access ordering, fine-grained locking, and direct hardware access.<
D gives few more ways to give complex semantics to the compiler, but probably other better languages need to be invented for this. I think it is possible to invent such languages, but maybe they will be hard to use (maybe as Coq http://en.wikipedia.org/wiki/Coq ), so they will be niche languages. Such niche can be so small that maybe the work to invent and implement and keep updated and debugged such language is not worth it.
Bye,
bearophile
More information about the Digitalmars-d
mailing list