On 7/7/2012 7:47 AM, Jacob Carlborg wrote:
DStep is a tool for translating C and Objective-C headers to D modules. It uses
libclang for lexing/parsing and AST traversal. This means it handles everything
that Clang itself can handle, although this doesn't mean it will correctly
translate everything.
I would consider this release alpha or beta. I'm releasing this now in hope I
get some feedback on what language features the tool can't handle.
I think this is potentially a big deal.
If it can be made complete enough, I'd like to add support into D for it, so you
could do things like:
import "stdio.h";
and the D compile would fork/exec Dstep, generate the corresponding .d file, and
import the .d file.
Some issues:
1. Passing macro definitions to Dstep
2. The name "Dstep" has no obvious relationship to what it does.
3. The -o flag is not necessary. Just "do the right thing" when you see the
filename extension.
In fact, we could make it a general facility, where if D sees:
import "filename.ext";
that it fork/exec's the program:
ext_to_D filename.ext tmpfile.d
and them imports tmpfile.d.