| Thread overview | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
October 03, 2013 C++ -> D converter mentioned in AMA | ||||
|---|---|---|---|---|
| ||||
Andrei's AMA has interesting answer: "One of the main D(md) contributors, Daniel Murphy is working on automatic conversion tool that eventually will convert DMD's C++ codebase to D." Is this tool already available? Are there any guidelines about how to code in C++ to ease the conversion preocess (or even make it possible). I would be VERY interested in such a tool when the time comes so in the mean time I could slowly "fix" existing C++ codebase for future conversion. | ||||
October 03, 2013 Re: C++ -> D converter mentioned in AMA | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Szymon Gatner | On Thursday, 3 October 2013 at 10:42:32 UTC, Szymon Gatner wrote: > Andrei's AMA has interesting answer: > > "One of the main D(md) contributors, Daniel Murphy is working on automatic conversion tool that eventually will convert DMD's C++ codebase to D." > > Is this tool already available? Are there any guidelines about how to code in C++ to ease the conversion preocess (or even make it possible). I would be VERY interested in such a tool when the time comes so in the mean time I could slowly "fix" existing C++ codebase for future conversion. I think Daniel Murphys tool is aimed directly at the DMD codebase. It probably has plenty of hacks to solve the problem. There are plenty of pull-requests to ease the conversion, so I don't think this is a tool that works for other projects out of the box. The code can be found here: https://github.com/yebblies/dmd VisualD includes a generic tool to automatically convert C++ to D. I haven't tried it myself, but you can find some information here: http://www.dsource.org/projects/visuald/wiki/Tour/CppConversion | |||
October 03, 2013 Re: C++ -> D converter mentioned in AMA | ||||
|---|---|---|---|---|
| ||||
Posted in reply to simendsjo | On Thursday, 3 October 2013 at 10:52:42 UTC, simendsjo wrote: > On Thursday, 3 October 2013 at 10:42:32 UTC, Szymon Gatner wrote: >> Andrei's AMA has interesting answer: >> >> "One of the main D(md) contributors, Daniel Murphy is working on automatic conversion tool that eventually will convert DMD's C++ codebase to D." >> >> Is this tool already available? Are there any guidelines about how to code in C++ to ease the conversion preocess (or even make it possible). I would be VERY interested in such a tool when the time comes so in the mean time I could slowly "fix" existing C++ codebase for future conversion. > > I think Daniel Murphys tool is aimed directly at the DMD codebase. It probably has plenty of hacks to solve the problem. There are plenty of pull-requests to ease the conversion, so I don't think this is a tool that works for other projects out of the box. > The code can be found here: https://github.com/yebblies/dmd > > VisualD includes a generic tool to automatically convert C++ to D. I haven't tried it myself, but you can find some information here: http://www.dsource.org/projects/visuald/wiki/Tour/CppConversion There are also a couple of tools for header files: * https://github.com/jacob-carlborg/dstep?source=cc * http://dlang.org/htod.html | |||
October 03, 2013 Re: C++ -> D converter mentioned in AMA | ||||
|---|---|---|---|---|
| ||||
Posted in reply to simendsjo | On Thursday, 3 October 2013 at 10:54:47 UTC, simendsjo wrote:
> There are also a couple of tools for header files:
> * https://github.com/jacob-carlborg/dstep?source=cc
> * http://dlang.org/htod.html
AFAIK, those are for C/ObjC, not C++
| |||
October 03, 2013 Re: C++ -> D converter mentioned in AMA | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Thursday, 3 October 2013 at 10:57:24 UTC, Dicebot wrote: > On Thursday, 3 October 2013 at 10:54:47 UTC, simendsjo wrote: >> There are also a couple of tools for header files: >> * https://github.com/jacob-carlborg/dstep?source=cc >> * http://dlang.org/htod.html > > AFAIK, those are for C/ObjC, not C++ Ah, you're probably right. Another link then :) http://dlang.org/cpp_interface.html | |||
October 03, 2013 Re: C++ -> D converter mentioned in AMA | ||||
|---|---|---|---|---|
| ||||
Posted in reply to simendsjo | On Thursday, 3 October 2013 at 10:52:42 UTC, simendsjo wrote:
> On Thursday, 3 October 2013 at 10:42:32 UTC, Szymon Gatner wrote:
>> Andrei's AMA has interesting answer:
>>
>> "One of the main D(md) contributors, Daniel Murphy is working on automatic conversion tool that eventually will convert DMD's C++ codebase to D."
>>
>> Is this tool already available? Are there any guidelines about how to code in C++ to ease the conversion preocess (or even make it possible). I would be VERY interested in such a tool when the time comes so in the mean time I could slowly "fix" existing C++ codebase for future conversion.
>
> I think Daniel Murphys tool is aimed directly at the DMD codebase. It probably has plenty of hacks to solve the problem. There are plenty of pull-requests to ease the conversion, so I don't think this is a tool that works for other projects out of the box.
> The code can be found here: https://github.com/yebblies/dmd
>
> VisualD includes a generic tool to automatically convert C++ to D. I haven't tried it myself, but you can find some information here: http://www.dsource.org/projects/visuald/wiki/Tour/CppConversion
Thanks, I actually have VisualD installed but didn't know about that functionality tho looking at the docs it is pretty limited especially when it comes to templates :(
Sorry to hear about Daniel's tool. Maybe some day...
| |||
October 03, 2013 Re: C++ -> D converter mentioned in AMA | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Szymon Gatner | On Thursday, 3 October 2013 at 11:08:29 UTC, Szymon Gatner wrote:
> Thanks, I actually have VisualD installed but didn't know about that functionality tho looking at the docs it is pretty limited especially when it comes to templates :(
>
> Sorry to hear about Daniel's tool. Maybe some day...
Expecting such tool to "just work" is very unrealistic. C++ is very complex language and some behavior just can't be mapped to D directly. For example, one issue with current DMD source translation is that in C++ you can split class implementation among different translation units. Not in D.
Of course, libclang helps a lot with such tools (you don't need to write full C++ front-end on your own anymore!) but the complexity of translation is very high and you need to manually recheck it anyway so this does not seem like a feasible _generic_ tool, only something that can be adopted for specific projects.
| |||
October 03, 2013 Re: C++ -> D converter mentioned in AMA | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Thursday, 3 October 2013 at 11:23:25 UTC, Dicebot wrote:
> On Thursday, 3 October 2013 at 11:08:29 UTC, Szymon Gatner wrote:
>> Thanks, I actually have VisualD installed but didn't know about that functionality tho looking at the docs it is pretty limited especially when it comes to templates :(
>>
>> Sorry to hear about Daniel's tool. Maybe some day...
>
> Expecting such tool to "just work" is very unrealistic. C++ is very complex language and some behavior just can't be mapped to D directly. For example, one issue with current DMD source translation is that in C++ you can split class implementation among different translation units. Not in D.
>
> Of course, libclang helps a lot with such tools (you don't need to write full C++ front-end on your own anymore!) but the complexity of translation is very high and you need to manually recheck it anyway so this does not seem like a feasible _generic_ tool, only something that can be adopted for specific projects.
I fully realize that and actually I was really surprised that such a tool is in production considering amount of code in DMD. OTOH if it can work for DMD then in theory it should be possible to (to some degree) reuse it on other codebase *if* it conforms to certain coding rules/standard right?
| |||
October 03, 2013 Re: C++ -> D converter mentioned in AMA | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Szymon Gatner | On Thursday, 3 October 2013 at 11:29:38 UTC, Szymon Gatner wrote: > On Thursday, 3 October 2013 at 11:23:25 UTC, Dicebot wrote: >> On Thursday, 3 October 2013 at 11:08:29 UTC, Szymon Gatner wrote: >>> Thanks, I actually have VisualD installed but didn't know about that functionality tho looking at the docs it is pretty limited especially when it comes to templates :( >>> >>> Sorry to hear about Daniel's tool. Maybe some day... >> >> Expecting such tool to "just work" is very unrealistic. C++ is very complex language and some behavior just can't be mapped to D directly. For example, one issue with current DMD source translation is that in C++ you can split class implementation among different translation units. Not in D. >> >> Of course, libclang helps a lot with such tools (you don't need to write full C++ front-end on your own anymore!) but the complexity of translation is very high and you need to manually recheck it anyway so this does not seem like a feasible _generic_ tool, only something that can be adopted for specific projects. > > I fully realize that and actually I was really surprised that such a tool is in production considering amount of code in DMD. OTOH if it can work for DMD then in theory it should be possible to (to some degree) reuse it on other codebase *if* it conforms to certain coding rules/standard right? An official reply from Daniel ;) https://github.com/D-Programming-Language/dmd/pull/1980#issuecomment-19539800 | |||
October 03, 2013 Re: C++ -> D converter mentioned in AMA | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Tourist | On Thursday, 3 October 2013 at 11:31:51 UTC, Tourist wrote:
> On Thursday, 3 October 2013 at 11:29:38 UTC, Szymon Gatner wrote:
>> On Thursday, 3 October 2013 at 11:23:25 UTC, Dicebot wrote:
>>> On Thursday, 3 October 2013 at 11:08:29 UTC, Szymon Gatner wrote:
>>>> Thanks, I actually have VisualD installed but didn't know about that functionality tho looking at the docs it is pretty limited especially when it comes to templates :(
>>>>
>>>> Sorry to hear about Daniel's tool. Maybe some day...
>>>
>>> Expecting such tool to "just work" is very unrealistic. C++ is very complex language and some behavior just can't be mapped to D directly. For example, one issue with current DMD source translation is that in C++ you can split class implementation among different translation units. Not in D.
>>>
>>> Of course, libclang helps a lot with such tools (you don't need to write full C++ front-end on your own anymore!) but the complexity of translation is very high and you need to manually recheck it anyway so this does not seem like a feasible _generic_ tool, only something that can be adopted for specific projects.
>>
>> I fully realize that and actually I was really surprised that such a tool is in production considering amount of code in DMD. OTOH if it can work for DMD then in theory it should be possible to (to some degree) reuse it on other codebase *if* it conforms to certain coding rules/standard right?
>
> An official reply from Daniel ;)
> https://github.com/D-Programming-Language/dmd/pull/1980#issuecomment-19539800
It's been self-hosting for two months..?
Perhaps DMD 2.065 will be written in D! :)
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply