D to C compiler?
Chad J
gamerchad at __spam.is.bad__gmail.com
Fri Feb 6 15:03:41 PST 2009
Robert Fraser wrote:
> Nicolay Korslund wrote:
>> The exception problem and C could be sidestepped altogether by
>> compiling to C++ instead of pure C. All the major console SDKs at
>> least will compile C++. This doesn't mean we would need to use any
>> more C++ features like classes or templates, the result could be
>> pretty much "C with exceptions". An added benefit would be automatic
>> eh compatibility with existing C++ code, on all platforms.
>
> At the expense of D->D compatibility...
huh?
I mean... "This doesn't mean we would need to use any more C++ features
like classes or templates"
The next step is to mark everything extern C, and make sure it's all
mangled before it hits codegen (that happens anyways). ABI
compatibility is preserved. We win.
The only problem I see with this plan is that LLVM supposedly HAS a C
backend, but I've yet to hear about any C++ backend. It may be a lot
more work than if you can just use some macro/setjmp/etc hacks to make
eh work in C.
More information about the Digitalmars-d
mailing list