Re:Using D to Create the World’s Fastest File System
by WalterBright on Wednesday December 05, 2018 @04:30AM
(#18606834)
"C++ has a very complex ABI, and the Rust ABI is not frozen. However, both C++ and Rust support functions that use the C ABI. Therefore, interoperability between C++ and Rust involves writing things in such a way that C++ sees Rust code as C code and Rust sees C++ code as C code."
Re:Using D to Create the World’s Fastest File System
by hardwaresofton on Wednesday December 05, 2018 @10:36AM
(#18609145)
Context: this poster is likely Walter Bright the creator and first implementer of D lang itself.
Cool to know you also read that article about C++ in rust (I personally read a little bit then left because trying to interface with C++ from rust wasn't a problem I had), but I guess it's obvious that you would.
Re:Using D to Create the World’s Fastest File System
by WalterBright on Wednesday December 05, 2018 @03:16PM
(#18612053)
> is likely
Probably 100%
Re:Using D to Create the World’s Fastest File System
by arunc on Wednesday December 05, 2018 @05:52AM
(#18607195)
I've written wrappers for C++ libraries to work with D and it's _very_ easy. To work with C++ classes in D, I created factory methods that created/destroyed them with C ABI and used/disposed them respectively.
Working with C is even more easier. There is no FFI, etc. Just use Dstep[1] and get going. Or use dpp[2].
Re:Using D to Create the World’s Fastest File System
by WalterBright on Wednesday December 05, 2018 @06:14AM
(#18607298)
Up until quite recently, while the front end of D was written in D, the back end was in C++ (more precisely, C with classes, as it is fairly auld skool).
It's now finally pretty much all in D, and I've been piece by piece refactoring it into more idiomatic D.
From Go / CGo, it can be pretty scary to interface with native C++ code, and it requires lots of annoying boilerplate.