News for hackers. Stuff that matters.
Re:Moving forward with work on the D language and foundation by SloopJon on Friday August 28, 2015 @10:52AM (#10135718)
One of the first things I'm looking at in Go and Rust is compatibility with C. I haven't used D, but this page makes it look as good or better from that perspective:

http://dlang.org/interfaceToC.html

Can anyone comment further?

Re:Moving forward with work on the D language and foundation by dbaupp on Friday August 28, 2015 @08:39PM (#10138533)
It seems Rust and D have very very similar C FFIs, see http://doc.rust-lang.org/book/ffi.html .

https://github.com/crabtw/rust-bindgen is a tool in the vein of dstep.

(Rust has the advantage of having no runtime beyond what C needs unlike D with its current garbage collector, so FFI, especially exposing a C interface, is likely somewhat simpler.)

Re:Moving forward with work on the D language and foundation by rlonstein on Friday August 28, 2015 @01:26PM (#10136732)
I can. I've written D interfaces to vendor-supplied C and C++ SDKs and for an open source C library (libusb). We're using this at work. For C, it's relatively easy and mechanical to translate by hand but https://github.com/jacob-carlborg/dstep makes starting trivial. For C++, I had two cases- one was easy as that vendor provided a C handle and function call syntax while the other required doing a C shim (facade) to wrap up the object. I didn't find SWIG to be useful but did examine its output to get ideas. The built-in unit testing in D is very handy.