February 08, 2009 Re: D to C compiler? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Nicolay Korslund | 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.
Is the D exception system not expressible in C? I’d much rather not see a greater dependency on C++ than already exists.
—Joel Salomon
| |||
February 08, 2009 Re: D to C compiler? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Joel C. Salomon |
Joel C. Salomon 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.
>
> Is the D exception system not expressible in C? I’d much rather not see a greater dependency on C++ than already exists.
>
> —Joel Salomon
You might be able to do it with setjmp/longjmp, but it'd probably be horrible.
This isn't a dependency on C++; it's just that C++ has exceptions and C doesn't. The only dependency D has on C++ is that the front end is written in it. Hopefully someone will come along and fix that one day. :)
-- Daniel
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply