digitalmars.D - C backend for D
- Dibyendu Majumdar (1/1) Mar 05 2020 Has there ever been an attempt to create a C backend for D?
- Stefan Koch (8/9) Mar 05 2020 Indeed.
- sarn (10/15) Mar 05 2020 Yep, I've experimented with using using this with (plain) LDC:
- Dibyendu Majumdar (5/12) Mar 06 2020 Is it this one you mean:
- Walter Bright (2/3) Mar 06 2020 https://news.ycombinator.com/item?id=22402123
- Dibyendu Majumdar (5/8) Mar 06 2020 Well most reasons stated in that thread appear to be spurious?
- kinke (2/4) Mar 06 2020 Wrong question - what would be the point of such a backend?
- Walter Bright (4/12) Mar 06 2020 I know people like to argue with me about the validity of the points. Mo...
- bachmeier (3/15) Mar 06 2020 Notably absent from the OP's post is a compelling argument in
- Dibyendu Majumdar (4/9) Mar 07 2020 My question was whether anyone had done this before ... not an
- 12345swordy (5/6) Mar 06 2020 None, there is simply no good reason for dmd to have a c backend.
- IGotD- (10/16) Mar 06 2020 With LLVM, intermediate languages or "transpilers" has become
Has there ever been an attempt to create a C backend for D?
Mar 05 2020
On Thursday, 5 March 2020 at 20:51:40 UTC, Dibyendu Majumdar wrote:Has there ever been an attempt to create a C backend for D?Indeed. If I recall correctly Daniel Murphy did work on one. newCTFE has a C backend as well, which of course will only work for CTFEable code. There are also approaches which use the unofficial LLVM C backend via a custom build of LDC.
Mar 05 2020
On Thursday, 5 March 2020 at 21:43:45 UTC, Stefan Koch wrote:On Thursday, 5 March 2020 at 20:51:40 UTC, Dibyendu Majumdar wrote:Yep, I've experimented with using using this with (plain) LDC: https://github.com/JuliaComputing/llvm-cbe I got "Hello World" to work, but unfortunately llvm-cbe's forward reference generation is buggy, so I gave up trying to get anything more complicated to compile. Credit goes to this post for the original inspiration: https://qiita.com/mono_shoo/items/81b98ac5656a47617232 (Post from the Japanese D community about using llvm-cbe to run D on a microcontroller.)Has there ever been an attempt to create a C backend for D?There are also approaches which use the unofficial LLVM C backend via a custom build of LDC.
Mar 05 2020
On Thursday, 5 March 2020 at 21:43:45 UTC, Stefan Koch wrote:On Thursday, 5 March 2020 at 20:51:40 UTC, Dibyendu Majumdar wrote:Is it this one you mean: https://github.com/yebblies/dmd/tree/microdHas there ever been an attempt to create a C backend for D?Indeed. If I recall correctly Daniel Murphy did work on one.newCTFE has a C backend as well, which of course will only work for CTFEable code.Cool, is there an example C output? Regards
Mar 06 2020
On 3/5/2020 12:51 PM, Dibyendu Majumdar wrote:Has there ever been an attempt to create a C backend for D?https://news.ycombinator.com/item?id=22402123
Mar 06 2020
On Friday, 6 March 2020 at 11:02:36 UTC, Walter Bright wrote:On 3/5/2020 12:51 PM, Dibyendu Majumdar wrote:Well most reasons stated in that thread appear to be spurious? Only one that is perhaps a valid issue is debug info. What would real issues for the better C dialect to have a C backend?Has there ever been an attempt to create a C backend for D?https://news.ycombinator.com/item?id=22402123
Mar 06 2020
On Friday, 6 March 2020 at 13:08:47 UTC, Dibyendu Majumdar wrote:What would real issues for the better C dialect to have a C backend?Wrong question - what would be the point of such a backend?
Mar 06 2020
On 3/6/2020 5:08 AM, Dibyendu Majumdar wrote:On Friday, 6 March 2020 at 11:02:36 UTC, Walter Bright wrote:I know people like to argue with me about the validity of the points. Most of them are value judgements, and I consider it compelling. With enough effort, one can make anything work.On 3/5/2020 12:51 PM, Dibyendu Majumdar wrote:Well most reasons stated in that thread appear to be spurious? Only one that is perhaps a valid issue is debug info.Has there ever been an attempt to create a C backend for D?https://news.ycombinator.com/item?id=22402123
Mar 06 2020
On Friday, 6 March 2020 at 21:27:12 UTC, Walter Bright wrote:On 3/6/2020 5:08 AM, Dibyendu Majumdar wrote:Notably absent from the OP's post is a compelling argument in favor of a C backend.On Friday, 6 March 2020 at 11:02:36 UTC, Walter Bright wrote:I know people like to argue with me about the validity of the points. Most of them are value judgements, and I consider it compelling. With enough effort, one can make anything work.On 3/5/2020 12:51 PM, Dibyendu Majumdar wrote:Well most reasons stated in that thread appear to be spurious? Only one that is perhaps a valid issue is debug info.Has there ever been an attempt to create a C backend for D?https://news.ycombinator.com/item?id=22402123
Mar 06 2020
On Saturday, 7 March 2020 at 02:41:27 UTC, bachmeier wrote:My question was whether anyone had done this before ... not an ask to create one. So no argument needed. I was curious, that's all.I know people like to argue with me about the validity of the points. Most of them are value judgements, and I consider it compelling. With enough effort, one can make anything work.Notably absent from the OP's post is a compelling argument in favor of a C backend.
Mar 07 2020
On Thursday, 5 March 2020 at 20:51:40 UTC, Dibyendu Majumdar wrote:Has there ever been an attempt to create a C backend for D?None, there is simply no good reason for dmd to have a c backend. Once the backend has been open sourced, effort has been made to port it to d via dbetterC.
Mar 06 2020
On Friday, 6 March 2020 at 19:24:13 UTC, 12345swordy wrote:On Thursday, 5 March 2020 at 20:51:40 UTC, Dibyendu Majumdar wrote:With LLVM, intermediate languages or "transpilers" has become less usual simply because they are less and less necessary. Also debugging becomes more difficult as you have an intermediate language that will fill up the debugging information rather than the actual language that you are using. Nim, is the language that stands out that uses C as the main backend. It has benefits as well as drawbacks. With LDC and GDC, a C backend is more or less obsolete and pointless.Has there ever been an attempt to create a C backend for D?None, there is simply no good reason for dmd to have a c backend. Once the backend has been open sourced, effort has been made to port it to d via dbetterC.
Mar 06 2020