[Issue 9285] New: dtoh

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 9 00:10:48 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9285

           Summary: dtoh
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrei at erdani.com


--- Comment #0 from Andrei Alexandrescu <andrei at erdani.com> 2013-01-09 00:10:47 PST ---
Generating D files from C or C++ header files is a difficult endeavor. However,
the converse process of generating C++ header files from D source files is
easier to approach, and very useful.

Possible uses include migrating a large C++ codebase to D in small steps
without needing to deal with declaration duplication across D code and C++
legacy code. (The dmd compiler itself may use the tool.) Using D as source and
translating from D to C++ gives a robust unique point of maintenance.

Here are a few requirements:

* dtoh takes a D file as input and generates C++ declarations for all pertinent
function and class declarations in the D file.

* Accepted declarations: data, functions, classes, and interfaces for all types
that have a C++ correspondent.

* D declarations that cannot be translated into C++ will be ignored.

* In order to stay decoupled from the compiler, dtoh should generate C++ code
from the JSON output of the D compiler.

* For make friendliness, dtoh should overwrite its output if and only if the
generated output is different from the existing output.

* The generated C++ code should be human readable (nicely indented etc) and use
good C++ practices (e.g. include guards etc).

* C++11 generation is default, there should be an option to generate C++98.

The tool would be in the tools/ repository and distributed alongside with the
compiler in source and binary forms.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list