Why is D unpopular?
Walter Bright
newshound2 at digitalmars.com
Mon May 16 08:08:51 UTC 2022
On 5/15/2022 11:51 PM, Siarhei Siamashka wrote:
> On Sunday, 15 May 2022 at 17:21:18 UTC, Walter Bright wrote:
>> In my experience, it is not an option to rewrite working C code into D.
>>
>> Note that I have successfully converted small and medium C code projects to D.
>
> Don't these two sentences contradict each other? Unless I'm misinterpreting the
> meaning of words "converted" and "successfully".
It means I have credibility when it comes to this topic.
>> 2. converting a program all at once does not work. It must be done
>> incrementally, one function at a time
> Can you elaborate on this?
Doing it one function at a time means if your new build doesn't work, you only
have one function to look at to find the error. This means orders of magnitude
less time spent debugging.
> But once the job is done, long term maintenance is relatively
> painless.
No, it isn't. I speak from experience. C's limitations makes for code that is
brittle (very hard to refactor).
> D is good for rapid development of new code, but isn't great for long term
> maintenance because of the language evolution and compatibility breakages. My
> understanding is that many D projects and libraries died off because they could
> not afford to keep up and can't be even compiled anymore.
I've brought forward code myself. The D1 => D2 transition was hard, but since
then, it isn't that hard. But people don't want to bother with this.
> Well, everyone is doing this and bindings for popular C libraries are available
> for most programming languages.
This vastly underestimates the scope of the problem.
> Do I understand it right that ImportC is intended for implementing major new
> features in the existing old C projects using D language?
?
> One of the old C projects is the Linux kernel. I know that some people are
> working on making it possible to develop some parts of the Linux kernel using
> Rust language. Would ImportC make it possible to use D for developing some parts
> of the Linux kernel and how is it different from what Rust people are doing?
I am unfamiliar with kernel development and its needs. It apparently is also
written in a dialect of C with special compiler switches.
More information about the Digitalmars-d
mailing list