How does D compare to Go when it comes to C interop?
Ola Fosheim Grøstad via Digitalmars-d
digitalmars-d at puremagic.com
Thu Dec 10 12:17:57 PST 2015
On Thursday, 10 December 2015 at 16:37:16 UTC, Chris Wright wrote:
> From what you're saying about Go, it sounds like someone
> implemented the C calling convention at runtime.
Go has a more advanced, memory efficient and secure runtime than
D fibers. So when calling C Go has to do extra work. E.g. Ensure
that the stack is large enough for C etc.
> On the other hand, coroutines are coroutines, and D has a
> coroutine implementation (core.thread.Fiber).
But the D fiber stacks aren't managed/safe, so in D the
programmer is responsible for allocating a stack that is large
enough. And that is neither safe or scalable.
D fibers are also assumed to not migrate between threads at the
moment.
More information about the Digitalmars-d
mailing list