Earlier 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.
Next C compiler is a D compiler: Introducing DMD's ImportC
31–40 of 89 posts
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#32Hello Walter, do you have any advice on integrating Rust and D? Especially regarding GC
Using D code in Rust probably will be much more painful and I am not sure if it can be done 100% safely...
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#33Earlier quoted context omitted.
My mistake. Thanks for pointing it out.
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.
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#34Hello 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...
Can you elaborate? Saying it will be "much more painful" without anything further is not especially helpful. I've added D functions to C programs more or less trivially, including compiling to a shared library, with no change to the code.
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#35Earlier 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...
> Using D code in Rust probably will be much more painful and I am not sure if it can be done 100% safely... Can you elaborate? Saying it will be "much more painful" without anything further is not especially helpful. I've added D functions to C programs more or less trivially, including compiling to a shared library, with no change to the code.
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#36Hello 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...
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#37Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#38Can you tell the D compiler to free a pointer returned from a C method when it goes out of scope? Like uniq_ptr
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#39Walter, since you're here: what's your position regarding bootstrapping and Ken Thompson's "Reflections on Trusting Trust"?
Re: Next C compiler is a D compiler: Introducing DMD's ImportC
#40Can you tell the D compiler to free a pointer returned from a C method when it goes out of scope? Like uniq_ptr