www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - d programs conversion to c

reply jicman <jicman gmail.com> writes:
Greetings!

I am trying to see if there are any converters out there from d 
code to c.  Anyone knows?  Thanks.

josé
Dec 11 2019
next sibling parent reply BoraxMan <rotflol2 hotmail.com> writes:
On Wednesday, 11 December 2019 at 18:54:49 UTC, jicman wrote:
 Greetings!

 I am trying to see if there are any converters out there from d 
 code to c.  Anyone knows?  Thanks.

 josé
I don't think there would be any. The BetterC subset is as good as using C. Why specifically do you want to convert?
Dec 13 2019
parent Taylor Hillegeist <taylorh140 gmail.com> writes:
On Saturday, 14 December 2019 at 06:14:23 UTC, BoraxMan wrote:
 On Wednesday, 11 December 2019 at 18:54:49 UTC, jicman wrote:
 Greetings!

 I am trying to see if there are any converters out there from 
 d code to c.  Anyone knows?  Thanks.

 josé
I don't think there would be any. The BetterC subset is as good as using C. Why specifically do you want to convert?
If you want something that works but would be a possible pain. you could always compile the program in d and then use a decompiler, most of these produce C code. It could be a mess though.
Dec 15 2019
prev sibling parent Laeeth Isharc <Laeeth laeeth.com> writes:
On Wednesday, 11 December 2019 at 18:54:49 UTC, jicman wrote:
 Greetings!

 I am trying to see if there are any converters out there from d 
 code to c.  Anyone knows?  Thanks.

 josé
How many lines of code is it ? It's not that bad to do it manually with help from regex. If you're good with vim macros like Robert Schadek then that may help too. There's a project to convert C code to Rust and some day I plan to support something similar for C to D. LLVM used to have a C backend that was revived by the Julia guys. Might get somewhere with that, but if it's not too big a codebase assisted manual isn't that bad. First version of excel-d I had to do entirely manually as dpp didn't exist.
Dec 16 2019