ImportC is shaping up to be one of the greatest feature of D<p>Being able to just import your C code, and call it from C, or when you need to go back to C and resume your work by just importing your D modules<p>I tried it, while it still need some finish, it worked very well! (you had to put your files through a preprocessor though, hopefully this step won't be needed in the future)<p>Every modern language should include a C compiler, it is stupid to give up the entire C ecosystem!<p>No wonder Walter's name is "Bright"!<p>To the people who still doubt about D "because of the GC", it doesn't exist for me, i am making an online 3D game targeting WASM without it, with all the language features!<p>For cases when you need one "if you use D as a scripting language", it will be very helpful to have!<p><a href="https://www.kdom.xyz/" rel="nofollow">https://www.kdom.xyz/</a><p>If you love C, but need something modern with more safeties, give D a try!<p>D is a pragmatic language, very powerful, covers everyone's needs!<p>If you tried it before, now is the time to give it another try!
I've done something different before:<p><pre><code> // main.c
#include <module.c>
int main() {
moduleFunction();
}
// module.c
#include <stdio.h>
void moduleFunction() {
printf("calling modules");
}
</code></pre>
This has its issues (you can't do parallel compilation anymore; you don't have unexported functions, etc), but it works fine for small things. Super helpful when I want to make a small thing and don't want to bother with headers.<p>You just include all the C files in one file and be done with it.
On the topic of the presentation, I'd be happy to have a way to kill the preprocessor. Not that I expect that to happen. Reading C code is like reading literature that only makes sense if you know eight languages, four of which are known to fewer than 100 people.