www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D in the KDAB blog: using D as a glue language between C++ and Rust

reply Chris J <cjljosten gmail.com> writes:
Today, I stumbled on a blog post where someone used D as a glue 
language between C++ and Rust, by using the C++ linkage 
functionality to call C++ code and the ability to manually 
override the name mangling using `pragma(mangle, "…")` to call 
Rust code.

https://www.kdab.com/mixing-c-and-rust-for-fun-and-profit-part-1/
Dec 07 2023
next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 12/7/2023 11:10 AM, Chris J wrote:
 Today, I stumbled on a blog post where someone used D as a glue language
between 
 C++ and Rust, by using the C++ linkage functionality to call C++ code and the 
 ability to manually override the name mangling using `pragma(mangle, "…")`
to 
 call Rust code.
 
 https://www.kdab.com/mixing-c-and-rust-for-fun-and-profit-part-1/
Lots of fun!
Dec 07 2023
prev sibling next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 12/7/2023 11:10 AM, Chris J wrote:
 Today, I stumbled on a blog post where someone used D as a glue language
between 
 C++ and Rust, by using the C++ linkage functionality to call C++ code and the 
 ability to manually override the name mangling using `pragma(mangle, "…")`
to 
 call Rust code.
 
 https://www.kdab.com/mixing-c-and-rust-for-fun-and-profit-part-1/
https://x.com/WalterBright/status/1732933729096786020
Dec 07 2023
prev sibling next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 12/7/2023 11:10 AM, Chris J wrote:
 Today, I stumbled on a blog post where someone used D as a glue language
between 
 C++ and Rust, by using the C++ linkage functionality to call C++ code and the 
 ability to manually override the name mangling using `pragma(mangle, "…")`
to 
 call Rust code.
 
 https://www.kdab.com/mixing-c-and-rust-for-fun-and-profit-part-1/
https://news.ycombinator.com/newest
Dec 07 2023
prev sibling next sibling parent zjh <fqbqrr 163.com> writes:
On Thursday, 7 December 2023 at 19:10:32 UTC, Chris J wrote:
 Today, I stumbled on a blog post where someone used D as a glue 
 language between C++ and Rust, by using the C++ linkage
 https://www.kdab.com/mixing-c-and-rust-for-fun-and-profit-part-1/
[chinese version](https://fqbqrr.blog.csdn.net/article/details/134871850)
Dec 07 2023
prev sibling next sibling parent Dukc <ajieskola gmail.com> writes:
On Thursday, 7 December 2023 at 19:10:32 UTC, Chris J wrote:
 Today, I stumbled on a blog post where someone used D as a glue 
 language between C++ and Rust, by using the C++ linkage 
 functionality to call C++ code and the ability to manually 
 override the name mangling using `pragma(mangle, "…")` to call 
 Rust code.

 https://www.kdab.com/mixing-c-and-rust-for-fun-and-profit-part-1/
Wow, doesn't Rust have a name mangling override pragma to do this in itself? Honestly I think any language would do well to ad that. Of course, even if it'd have it D would still be superior in this regard thanks to `extern(C++)` and ability to use CTFE for the mangled names.
Dec 08 2023
prev sibling parent reply Sergey <kornburn yandex.ru> writes:
On Thursday, 7 December 2023 at 19:10:32 UTC, Chris J wrote:
 Today, I stumbled on a blog post where someone used D as a glue 
 language between C++ and Rust, by using the C++ linkage 
 functionality to call C++ code and the ability to manually 
 override the name mangling using `pragma(mangle, "…")` to call 
 Rust code.

 https://www.kdab.com/mixing-c-and-rust-for-fun-and-profit-part-1/
Nice finding! Thanks for sharing. Someone with Reddit account - can you please post it here: https://www.reddit.com/r/ThePrimeagenReact/ ? It is interesting article and it deserves some more attention. If it will be chosen could be good for D as well
Dec 08 2023
parent Paulo Pinto <pjmlp progtools.org> writes:
On Friday, 8 December 2023 at 10:18:20 UTC, Sergey wrote:
 On Thursday, 7 December 2023 at 19:10:32 UTC, Chris J wrote:
 Today, I stumbled on a blog post where someone used D as a 
 glue language between C++ and Rust, by using the C++ linkage 
 functionality to call C++ code and the ability to manually 
 override the name mangling using `pragma(mangle, "…")` to call 
 Rust code.

 https://www.kdab.com/mixing-c-and-rust-for-fun-and-profit-part-1/
Nice finding! Thanks for sharing. Someone with Reddit account - can you please post it here: https://www.reddit.com/r/ThePrimeagenReact/ ? It is interesting article and it deserves some more attention. If it will be chosen could be good for D as well
Done, https://www.reddit.com/r/ThePrimeagenReact/comments/18dk19s/mixing_c_d_and_rust_for_fun_and_profit_part_1/?
Dec 08 2023