What I don't like about LDC, is you have to install the entire Visual Studio if you want a static build [1]. Contrast this with Go, Nim, Rust, Zig and others, that don't put this burden developers. Is DMD any different in this regard? 1. https://github.com/ldc-developers/ldc/issues/4047
Next C compiler is a D compiler: Introducing DMD's ImportC
41–50 of 89 posts
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#42Earlier quoted context omitted.
I don't think it's your mistake. It seems HN automatically removes certain leading/trailing words from titles so as to reduce clickbait but it doesn't seem to be very smart about it.
It gets annoying, because in cases like this it doesn't make sense, but in other cases it actually changes the meaning of the title. I honestly don't understand it given the prohibition against submitters changing the title.
I'd be much less annoyed by it if dang finally made it a pre-submit check (maybe with a checkbox "Overrule") like the "too long" check. But no, it seems to be important that the submitter has to check manually whether the title he just typed in is still there.
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#43Earlier quoted context omitted.
Using Rust code in D should be relatively easy: expose C API, compile it into a shared library and use it on the D side as any other library. cbindgen ( https://github.com/eqrion/cbindgen ) can help with generation of header files. Static linking is possible as well. Using D code in Rust probably will be much more painful and I am not sure if it can be done 100% safely...
I don't think Rust will ever consider FFI'in with another language "100% safe."
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#44That's impressive, i thought the preprocessor wasn't planned, looks like it takes care of it too, i guess it's time to revisit D, C but better
Infact, D was the first language I learnt templating in and I really like it (or rather, the way D goes about it - made it much more approachable for me).
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#45Earlier quoted context omitted.
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.
Do you plan on giving Zig a try? (They seem to be doing a lot right.) 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-…
All this Zig spam is getting very tiring.
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#46That's impressive, i thought the preprocessor wasn't planned, looks like it takes care of it too, i guess it's time to revisit D, C but better
My experience with D is always a joyful one. If it isn't because it is a relatively straightforward language to learn then it is learning something new now and then that just makes life to much more easier. Infact, D was the first language I learnt templating in and I really like it (or rather, the way D goes about it - made it much more approachable for me).
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#47Hello Walter, do you have any advice on integrating Rust and D? Especially regarding GC
Using Rust code in D should be relatively easy: expose C API, compile it into a shared library and use it on the D side as any other library. cbindgen ( https://github.com/eqrion/cbindgen ) can help with generation of header files. Static linking is possible as well. Using D code in Rust probably will be much more painful and I am not sure if it can be done 100% safely...
You can just as easily declare D code to be extern(C) and have rust treat it as a C library.
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#48Earlier quoted context omitted.
Do you plan on giving Zig a try? (They seem to be doing a lot right.) 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-…
> Do you plan on giving Zig a try? (They seem to be doing a lot right.) All this Zig spam is getting very tiring.
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#49Earlier quoted context omitted.
> Do you plan on giving Zig a try? (They seem to be doing a lot right.) All this Zig spam is getting very tiring.
In a conversation about languages with this kind of C interop, how can you omit Zig?
It's not. It's a discussion about "the C compiler built into the Digital Mars D compiler".
Please stop with all the Zig spam.
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#50> Error: C designator-list not supported yet I guess only a subset of C11 is supported? Is there all of C89?
Designator-list support has since been added. The multi-layer designators are still to be done, though (they're rarely used, so are a lower priority).
For instance check out this call to create a 3D-API pipeline-state-object in C99:
https://github.com/floooh/sokol-samples/blob/ad9047e228a8441...