digitalmars.D.announce - C++ to D converter based on clang
- =?UTF-8?B?TG/Dr2M=?= HAMOT (34/34) May 28 2016 Hello,
- Seb (6/40) May 28 2016 That's a great project! IIRC Walter still searches for someone to
- =?UTF-8?B?TG/Dr2M=?= HAMOT (11/29) May 28 2016 I gave a try to magicport2, but I read it is specifically done
- Steven Schveighoffer (4/9) May 28 2016 Very nice! Looking at your examples, you should know that the
- Stefan Koch (2/7) May 28 2016 Interesting!
- Jacob Carlborg (6/9) May 31 2016 Is there a reason to reinvent the wheel instead of contributing to DStep...
- =?UTF-8?B?TG/Dr2M=?= HAMOT (13/22) Jun 01 2016 Hello Jacob.
- Jacob Carlborg (13/25) Jun 01 2016 No. Targeting C++ is not against the objectives of DStep. C and
- Daniel Murphy (2/5) Jun 01 2016 Haha that really depends on your goals.
- Jacob Carlborg (5/6) Jun 02 2016 Yeah, I know magicport can translate DMD. The goal there is to translate...
Hello, I am working on a C++ to D converter. The project is opensource, on github : https://github.com/lhamot/CPP2D Clang is used to parse the C++ code and get the abstract syntax tree. Then I can visit the AST to print it to D language. Some tricks are used to convert the simplest macros to mixin. Some C++ features which are not straightforward to convert are already handled, like (A not exhaustive list): class constructor/destructor virtual abstract override initialization list call base constructor Operator overloading member free left or right Template function function specialization class class/struct specialization class/struct partial specialization arrays static dynamic Some examples here : https://github.com/lhamot/CPP2D/wiki/Conversion-samples If somebody is interested to use this software, or to participate, do not hesitate to contact me. Regards
May 28 2016
On Saturday, 28 May 2016 at 11:02:37 UTC, Loïc HAMOT wrote:Hello, I am working on a C++ to D converter. The project is opensource, on github : https://github.com/lhamot/CPP2D Clang is used to parse the C++ code and get the abstract syntax tree. Then I can visit the AST to print it to D language. Some tricks are used to convert the simplest macros to mixin. Some C++ features which are not straightforward to convert are already handled, like (A not exhaustive list): class constructor/destructor virtual abstract override initialization list call base constructor Operator overloading member free left or right Template function function specialization class class/struct specialization class/struct partial specialization arrays static dynamic Some examples here : https://github.com/lhamot/CPP2D/wiki/Conversion-samples If somebody is interested to use this software, or to participate, do not hesitate to contact me. RegardsThat's a great project! IIRC Walter still searches for someone to convert the dmd backend to D. Btw do you know about Daniel's porting tool that was used to migrate the dmd frontend to D? https://github.com/yebblies/magicport2
May 28 2016
On Saturday, 28 May 2016 at 11:26:23 UTC, Seb wrote:On Saturday, 28 May 2016 at 11:02:37 UTC, Loïc HAMOT wrote:I gave a try to magicport2, but I read it is specifically done for DMD. Moreover is seams to have some limitations which don't fit for my needs : template, C++11, ... I also tried the cpp2d project inside VisualD. But is has also many limitations in the C++ features it can parse (and the parser is pretty hard to extend). This is why I finally decided to use an existing, robust and reusable C++ parser : clang. I am far away to be able to convert the full DMD backend, but this is a very interesting challenge!Hello, I am working on a C++ to D converter. The project is opensource, on github : https://github.com/lhamot/CPP2D [...] If somebody is interested to use this software, or to participate, do not hesitate to contact me. RegardsThat's a great project! IIRC Walter still searches for someone to convert the dmd backend to D. Btw do you know about Daniel's porting tool that was used to migrate the dmd frontend to D? https://github.com/yebblies/magicport2
May 28 2016
On Saturday, 28 May 2016 at 11:02:37 UTC, Loïc HAMOT wrote:Hello, I am working on a C++ to D converter. The project is opensource, on github : https://github.com/lhamot/CPP2D [...]Very nice! Looking at your examples, you should know that the default protection in D classes is public. -Steve
May 28 2016
On Saturday, 28 May 2016 at 11:02:37 UTC, Loïc HAMOT wrote:Hello, I am working on a C++ to D converter. The project is opensource, on github : https://github.com/lhamot/CPP2D [...]Interesting!
May 28 2016
On 2016-05-28 13:02, Loïc HAMOT wrote:Hello, I am working on a C++ to D converter. The project is opensource, on github : https://github.com/lhamot/CPP2DIs there a reason to reinvent the wheel instead of contributing to DStep [1]? [1] https://github.com/jacob-carlborg/dstep -- /Jacob Carlborg
May 31 2016
On Wednesday, 1 June 2016 at 06:45:09 UTC, Jacob Carlborg wrote:On 2016-05-28 13:02, Loïc HAMOT wrote:Hello Jacob. It think DStep and CPP2D have very different objectives. DStep target C and Objective-C headers, but CPP2D target C++ full source code. Maybe do you think I could participate to DStep in order to extend it to full C++ source handling? Yes I could. Like I could participate to VisualD/cpp2d or magicport2 projects. But the reason why I didn't is I want to test the feasibility of a C++ to D conversion using the clang parser. Now, I think I passed the proof of concept step, and merge my work in an other project is not out of the question.Hello, I am working on a C++ to D converter. The project is opensource, on github : https://github.com/lhamot/CPP2DIs there a reason to reinvent the wheel instead of contributing to DStep [1]? [1] https://github.com/jacob-carlborg/dstep
Jun 01 2016
On 2016-06-01 10:55, Loïc HAMOT wrote:Hello Jacob. It think DStep and CPP2D have very different objectives. DStep target C and Objective-C headers, but CPP2D target C++ full source code.No. Targeting C++ is not against the objectives of DStep. C and Objective-C just happens to be what DStep currently supports. It make sense to start with C since it's a subset of both Objective-C and C++. Also, when I started the C++ support in D didn't exist or was very limited.Maybe do you think I could participate to DStep in order to extend it to full C++ source handling?Yes ;)Yes I could. Like I could participate to VisualD/cpp2d or magicport2 projects.Anything that is not using a real front end is a lost cause.But the reason why I didn't is I want to test the feasibility of a C++ to D conversion using the clang parser.I don't see a reason why it was necessary to create a completely new project for that.Now, I think I passed the proof of concept step, and merge my work in an other project is not out of the question.Not sure how easy it would be to integrate in DStep. I'm guessing you're using the C++ API while DStep is written in D and is using the C API. -- /Jacob Carlborg
Jun 01 2016
On 1/06/2016 9:40 PM, Jacob Carlborg wrote:Haha that really depends on your goals.Yes I could. Like I could participate to VisualD/cpp2d or magicport2 projects.Anything that is not using a real front end is a lost cause.
Jun 01 2016
On 2016-06-01 14:50, Daniel Murphy wrote:Haha that really depends on your goals.Yeah, I know magicport can translate DMD. The goal there is to translate arbitrary C++ code to D. -- /Jacob Carlborg
Jun 02 2016