The zig lang, v lang is able to translate into C code.
Is there a plan to translate d source code into C code ? (or maybe just betterC subset)
| Thread overview | |||||||
|---|---|---|---|---|---|---|---|
|
May 09, 2023 add translate into c source code function | ||||
|---|---|---|---|---|
| ||||
The zig lang, v lang is able to translate into C code. Is there a plan to translate d source code into C code ? (or maybe just betterC subset) | ||||
May 09, 2023 Re: add translate into c source code function | ||||
|---|---|---|---|---|
| ||||
Posted in reply to d007 | On 5/8/2023 11:37 PM, d007 wrote:
> The zig lang, v lang is able to translate into C code.
>
> Is there a plan to translate d source code into C code ? (or maybe just betterC subset)
There isn't a current plan to implement one.
Translating into C comes with a lot of problems. For example, C doesn't specify the order of evaluation of terms in an expression, while D does.
| |||
May 09, 2023 Re: add translate into c source code function | ||||
|---|---|---|---|---|
| ||||
Posted in reply to d007 | On Tuesday, 9 May 2023 at 06:37:58 UTC, d007 wrote: >The zig lang, v lang is able to translate into C code. Zig could run from C, but not to C AFAIK. | |||
May 09, 2023 Re: add translate into c source code function | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | I suspect c++ would be a better target instead. We already have a bunch of capability for this with the C++ header generator. It only need to support a subset of the language, just enough to bootstrap the compiler. This would be a massive boost in undoing any harm from self hosting wrt. getting a working compiler going on a given target. Not to mention the potential to making gdc/ldc lives a bit easier. | |||
May 10, 2023 Re: add translate into c source code function | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Sergey | On Tuesday, 9 May 2023 at 07:41:07 UTC, Sergey wrote: >On Tuesday, 9 May 2023 at 06:37:58 UTC, d007 wrote: >The zig lang, v lang is able to translate into C code. Zig could run from C, but not to C AFAIK. And it seems Odin also choose this path: https://youtu.be/g1qF9LZOoFE | |||