RFC in Comparison between Rust, D and Go

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Fri Nov 13 13:08:54 PST 2015


On Friday, 13 November 2015 at 20:51:54 UTC, Ola Fosheim Grøstad 
wrote:
> On Friday, 13 November 2015 at 14:31:08 UTC, Chris wrote:
>> So D does a better job at interfacing to C/C++, because it 
>> uses the same memory model as C/C++, as opposed to outputting 
>> C code like Nim. This is actually very clever.
>
> err... No. You get better interop by transpiling to C/C++.
>
> With C it is easy, you don't use C's typesystem after all. Many 
> languages do it. C++ is more complicated if you want to 
> generate code that looks like C++...

What you need is ABI compatibility, and it doesn't matter if you 
get it by transpiling to C or not. Even if you tranpile you 
declaration from language X to C, you need to make sure the 
generated C is the same as in the C code you interact with, and 
this isn't any simpler than generating the ABI directly (in fact, 
it is probably easier to map ABI directly as its semantic is much 
simpler).

But yeah, you'll debate everything to death even when it doesn't 
make any sense whatsoever.



More information about the Digitalmars-d mailing list