This article is about using the D compiler's ability to import vanilla C code to compile entire C projects.
Next C compiler is a D compiler: Introducing DMD's ImportC
21–30 of 89 posts
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#22The article's title is "Your next C compiler is a D compiler", which makes sense, though it's a bit clickbaity. The HN submission title is "Next C compiler is a D compiler", which barely makes grammatical sense, and to the extent that it does make sense, it sounds like there's a C compiler called "Next C compiler" which is also a D compiler.
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#23This article is about using the D compiler's ability to import vanilla C code to compile entire C projects.
Can DMD compile C projects directly similar to the Zig compiler?
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#24Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#25Earlier quoted context omitted.
Can DMD compile C projects directly similar to the Zig compiler?
I haven't used Zig, but DMD can compile C projects directly using makefiles or by simply putting the .c files on the dmd command line.
Taking the opportunity here to point people to "Adding Modules to C in 10 Lines of Code" from NWCPP earlier this year:
https://www.youtube.com/watch?v=2ImfbGm0fls>
(The pitfalls you mention running into there wrt to different compiler instances is itself a decent case study in not relying on singletons http://www.object-oriented-security.org/lets-argue/singleton...>—even if it ultimately wasn't so inconvenient that the work never got done, it would be even more convenient if it didn't need to have been done in the first place!)
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#26Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#27The article's title is "Your next C compiler is a D compiler", which makes sense, though it's a bit clickbaity. The HN submission title is "Next C compiler is a D compiler", which barely makes grammatical sense, and to the extent that it does make sense, it sounds like there's a C compiler called "Next C compiler" which is also a D compiler.
My mistake. Thanks for pointing it out.
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#28One of the major appeals of ImportC is that it does away with needing to write (and maintain) D bindings to C libraries -- by hand, or generated.
I was trying to experiment with io_uring in D and using liburing headers included in a C file + ImportC
My D app compiled and ran fine, and I could call liburing but in my editor I was in the dark as to what the methods I could call or their signatures were.
For hardcore vim programmers this is likely the norm, but for me I consider that a step backwards, and I went back to manually generating D bindings and using those.
Waiting for the day we'll see ImportC fully integrated into dub and pure-d/workspace-d!
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#29This article is about using the D compiler's ability to import vanilla C code to compile entire C projects.
I don’t use D seriously but I’d still bet my ass that something smart happens when you feed C code to the D compiler toolchain.
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#30Hello Walter, do you have any advice on integrating Rust and D? Especially regarding GC
I forecast that as it’s pragmatic, industrial uses (inevitably) grow sharply, that the FFI story will just have to improve. Rust is going to be the next “low-level” language.
The “Pure Rust” talking point will have to recede a bit but it will be a net win for Rust’s truly broad adoption, which is going to happen whether cranky old-timers like me like it or not :)