How does D compare to Go when it comes to C interop?

Ola Fosheim Gr via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 10 17:25:24 PST 2015


On Thursday, 10 December 2015 at 23:25:42 UTC, Chris Wright wrote:
> This doesn't work well for 32-bit processes because, while it 
> doesn't demand memory up front, it does demand address space. 
> But lazily demanding pages from the OS doesn't help. You still 
> have to divide the address space among fiber stacks.

it does not work for 64 bit either. You will:

1. Kill caches and TLB
2. Get bloated page tables.
3. Run out of memory.
4. Run out of stack space.

These 3 approaches work:

1. Allocate all activation records on the heap (Simula/Beta)
2. Use stacks that grows and shrink dynamically (Go)
3. Require no state on stack at yield. (Pony / C++17)


More information about the Digitalmars-d mailing list