Hacker News new | ask | show | jobs
by WalterBright 1663 days ago
BetterC got a lot of resistance at first, along the lines of who needs it. (BetterC is a subset of D that only relies on the C standard library.) But over time it has accumulated a lot of users, as being C without the troubles.

We've gone a step further with ImportC, and now C code can be imported directly into the D compiler, which makes it easy to interface D code to your existing C base.

3 comments

You seem to have some familiarity with the language. Nonetheless, you're understating a bit the degree of integration with C. You can also: create a shared library in D and call it trivially from C or any language with a FFI, call C shared libraries with little effort from D, compile a C file and add the .o file to your D program compilation command directly, use dstep to write C bindings for you, and directly #include a C header file with dpp. C is more or less a subset of D at this point. C programmers can stick with what they know but use D for incremental elimination of pain points.

Edit: I added that first sentence because it's awkward to tell the creator of the language that his answer was incomplete.

> You seem to have some familiarity with the language.

Well he should, he's the guy who created D.

I've seen that guys name around before, I assume he knows who Walter is and was making a joke.
The other WalterBright is the evil one.
Have you been time travelling recently?

(https://en.m.wikipedia.org/wiki/Primer_(film))

You assume wrong. It's the real guy.
No I mean I've seen bachmeier around the D community. possibly in IRC or the forums.
> You seem to have some familiarity with the language.

Remarkable understatement right there :-P

> You seem to have some familiarity with the language.

Just to note: Walter Bright, whom you replied to, is the creator of D.

> You can also: create a shared library in D and call it trivially from C

this is definitely a killer feature; i can think of very few languages that can do this. i think rust and zig are the only other two that have gotten any sort of popularity, though i would love to hear of any language i've missed.

The person you are replying to created D.
real r/dontyouknowwhoiam moment here
More like r/woosh
Actually, the truth is that Walter is a pretty poor D programmer who isn't that familiar with the language and knows next to nothing about the ecosystem outside dmd.

It wouldn't surprise me if he genuinely didn't know about how dstep and dpp are used.

Partial aside, BetterC sounds a lot like Zig and Andrew Kelley moved to Oregon a year or two ago. Have you talked with Andrew? Funny that two of the language creators in the space are so close to each other on Earth.

I'd love to listen to you two discuss D, BetterC and Zig and C.

I met him at Handmade Seattle last Nov. He's a good guy.
Wonderful!
ImportC is a killer feature, IMHO. Makes the choice to use D quite an easy one for a lot of tasks.

But - it's not production ready yet, is it?

Unfortunately no. A lot does compile, though, if you can avoid compiler extensions. I downloaded the sqlite amalgamation today (several hundred thousand LOC) and ImportC only had two problems, one which was easy to fix, and one I don't know how to fix (__builtin_va_arg).
__builtin_va_arg is another gcc compiler extension. It's for functions that deal with ... argument lists.
We're dogfooding it now. It's in a workable state, and keeps getting better. Besides, use it and file bug reports for anything not working perfectly.