My choice to pick Go over D ( and Rust ), mostly non-technical

Jonathan M Davis newsgroup.d at jmdavisprog.com
Mon Feb 5 22:56:47 UTC 2018


On Monday, February 05, 2018 18:54:32 John Gabriele via Digitalmars-d wrote:
> What is the specific purpose of -betterC? I see from
> <https://dlang.org/spec/betterc.html> that it's (A) useful when
> targeting constrained environments, and (B) for easier embedding
> of D libraries into larger projects. But I think I've read
> elsewhere in this forum that it was specifically useful for the
> DMD implementation itself.
>
> Is betterC intended to be used for standalone "D -betterC"
> programs where C might've otherwise been used? My impression of D
> so far is that it can indeed already be used as a better C by
> avoiding the GC yourself, or invoking it yourself when
> appropriate.
>
> It may be useful if that betterc.html page gave a rationale for
> it; to avoid any confusion on what its intended purpose is.

Based on Walter's comments, I get the impression that he thinks that the
primary benefit of -betterC is to make it easier to port a C program to D,
because then you can port it piece by piece rather than having to do it all
at once. After that, it's D, and you can ditch -betterC and start taking
advantage of the full feature set of D. Certainly, that's all that I would
ever consider using -betterC for. I have zero interest in giving up on the
features that require druntime. If I were going to consider that, I'd just
ditch D for C++. At least then, I'd get a fully featured language even if it
isn't as nice as D.

However, there are some folks who like the idea of using -betterC as their
primary or only way to use D, because they don't want the runtime for
whatever reason. Some of that comes from the fact that it's easier to link
against a D library from a C/C++ program when the D library doesn't require
the runtime, but I don't think that that's the only reason.

- Jonathan M Davis



More information about the Digitalmars-d mailing list