D libraries in other languages

Manu turkeyman at gmail.com
Thu Jan 24 04:37:06 UTC 2019


On Wed, Jan 23, 2019 at 2:30 PM . . via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> C++ is notoriously hard to use with other languages. Is D any
> better?
>
> If I made a D library, how easy would it be to use it in other
> languages (C, C++, Go, and Rust)?

Approximately equally challenging as C++.
You basically depend on `extern(C)`. In D you may gain one substantial
advantage, in that you might create a system to automatically wrap the
D-facing API in `extern(C)` export shims.
So perhaps you can automate a lot of `extern(C)` boilerplate...


More information about the Digitalmars-d mailing list