www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - c++ to d converter or c to d

reply janderson <askme me.com> writes:


Has anyone written a c++ to d converter (I'm not talking about wrapping 
a lib, I'm talking about the syntax)?  I'm not volunteering however I 
was thinking if it was made easier to convert c++ to d people may be 
more likely to switch over.

If not I'm sure it would be a challenge however if it could do 90% of 
the work (and perhaps even automatically download the dependent 
libraries from a webpage and convert stl over to d's form) people would 
be able to say, "hay I converted our project to d on the weekend, its 
50% in code size and runs just as fast, why don't we switch over and 
improve our productivity."  Well thats a just a dream, but it would help 
I think.

Legacy code is the biggest hurdle in getting D widely accepted.  No-one 
is going re-invent years of work.

-Joel
Dec 04 2006
next sibling parent reply "John Reimer" <terminal.node gmail.com> writes:
On Mon, 04 Dec 2006 22:19:13 -0800, janderson <askme me.com> wrote:



 Has anyone written a c++ to d converter (I'm not talking about wrapping  
 a lib, I'm talking about the syntax)?  I'm not volunteering however I  
 was thinking if it was made easier to convert c++ to d people may be  
 more likely to switch over.

 If not I'm sure it would be a challenge however if it could do 90% of  
 the work (and perhaps even automatically download the dependent  
 libraries from a webpage and convert stl over to d's form) people would  
 be able to say, "hay I converted our project to d on the weekend, its  
 50% in code size and runs just as fast, why don't we switch over and  
 improve our productivity."  Well thats a just a dream, but it would help  
 I think.

 Legacy code is the biggest hurdle in getting D widely accepted.  No-one  
 is going re-invent years of work.

 -Joel
Just curious, are you the Joel Anderson from Australia that was active on this list a couple of years ago? -JJR
Dec 04 2006
parent reply janderson <askme me.com> writes:
 
 Just curious, are you the Joel Anderson from Australia that was active 
 on this list a couple of years ago?
 
 -JJR
The same one. I'm now in San Francisco working for a game company called Perpetual. -Joel Anderson
Dec 05 2006
parent "John Reimer" <terminal.node gmail.com> writes:
On Tue, 05 Dec 2006 19:39:54 -0800, janderson <askme me.com> wrote:

  Just curious, are you the Joel Anderson from Australia that was active  
 on this list a couple of years ago?
  -JJR
The same one. I'm now in San Francisco working for a game company called Perpetual. -Joel Anderson
Great to see you around again! :) I remember how involved you were with D back then. -JJR
Dec 06 2006
prev sibling next sibling parent Justin C Calvarese <technocrat7 gmail.com> writes:
janderson wrote:

 
 Has anyone written a c++ to d converter (I'm not talking about wrapping 
 a lib, I'm talking about the syntax)?  I'm not volunteering however I 
 was thinking if it was made easier to convert c++ to d people may be 
 more likely to switch over.
I don't think that anyone has created such a tool (yet). The closest thing that I can think of is BCD (http://www.dsource.org/projects/bcd), but I guess it creates bindings from .h files rather than converting C/C++. I've heard that some great strides have been made in automating conversion of Java to D. But C++ can get much more complex, so trying to automate conversion could be a lot more hazardous.
 If not I'm sure it would be a challenge however if it could do 90% of 
 the work (and perhaps even automatically download the dependent 
 libraries from a webpage and convert stl over to d's form) people would 
 be able to say, "hay I converted our project to d on the weekend, its 
 50% in code size and runs just as fast, why don't we switch over and 
 improve our productivity."  Well thats a just a dream, but it would help 
 I think.
 
 Legacy code is the biggest hurdle in getting D widely accepted.  No-one 
 is going re-invent years of work.
-- jcc7
Dec 04 2006
prev sibling next sibling parent Walter Bright <newshound digitalmars.com> writes:
janderson wrote:

 
 Has anyone written a c++ to d converter (I'm not talking about wrapping 
 a lib, I'm talking about the syntax)?  I'm not volunteering however I 
 was thinking if it was made easier to convert c++ to d people may be 
 more likely to switch over.
Currently, the best we've got is htod, which will convert C header files to D import files.
Dec 05 2006
prev sibling next sibling parent reply Paul Findlay <r.lph50+d gmail.com> writes:
Lame dream of mine:

Someone buys me 
http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html?Home=SoftwareTransformation

and I get to work.

  - Paul
Dec 05 2006
parent reply Brad Anderson <brad dsource.org> writes:
Paul Findlay wrote:
 Lame dream of mine:
 
 Someone buys me
 http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html?Home=SoftwareTransformation
 
 
 and I get to work.
 
  - Paul
IIRC, the Language Machine is similar, but it's open-source, free, and written in D. http://www.dsource.org/projects/languagemachine BA
Dec 05 2006
parent reply janderson <askme me.com> writes:
Brad Anderson wrote:
 Paul Findlay wrote:
 Lame dream of mine:

 Someone buys me
 http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html?Home=SoftwareTransformation


 and I get to work.

  - Paul
IIRC, the Language Machine is similar, but it's open-source, free, and written in D. http://www.dsource.org/projects/languagemachine BA
This is neat. I'll be sure to keep an eye on its development. -Joel
Dec 05 2006
parent Brad Anderson <brad dsource.org> writes:
janderson wrote:
 Brad Anderson wrote:
 Paul Findlay wrote:
 Lame dream of mine:

 Someone buys me
 http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html?Home=SoftwareTransformation



 and I get to work.

  - Paul
IIRC, the Language Machine is similar, but it's open-source, free, and written in D. http://www.dsource.org/projects/languagemachine BA
This is neat. I'll be sure to keep an eye on its development. -Joel
It's pretty mature, so I don't think it's under active development. Peri Hankey maintains it, and will help you out if you ask. He did a bunch of work on a Java to D converter a few months back. BA
Dec 05 2006
prev sibling parent Steve Horne <stephenwantshornenospam100 aol.com> writes:
On Mon, 04 Dec 2006 22:19:13 -0800, janderson <askme me.com> wrote:

Legacy code is the biggest hurdle in getting D widely accepted.  No-one 
is going re-invent years of work.
Someone should take a look at TXL and see what it can do. I got the link from http://www.cs.queensu.ca/~thurston/ragel/ where I've been getting all excited over the Ragel FSM / Scanner tool, and to a degree also the Kelbt parser generator, but this guy has also developed an extended TXL. I don't have any understanding of what it does beyond the vague sense that it can do intelligent computer-language translation tasks, but that is enough of a hint that it might be able to do the job, and as a bonus it is available for free. Even with a specialised tool, though, converting any meaningful subset of C++ to D automatically is going to be a tough job. Things that look similar actually have substantially different semantics. -- Remove 'wants' and 'nospam' from e-mail.
Dec 05 2006