More automated interfacing of D with C codebases

Jacob Carlborg doob at me.com
Mon Oct 22 23:35:05 PDT 2012


On 2012-10-22 21:48, Brad Lanam wrote:

> Nothing wrong with that.
> I had different goals -- portability and legacy systems.  My tool is all
> bourne shell and awk.  There aren't many systems it does not work on
> (e.g. ULTRIX shell runs out of memory).

How can you mention bourne shell and portability in the same sentence? I 
doesn't work on Windows (yes I know about cygwin and mingw). Clang does 
work on Windows, I just haven't been able to compile DStep for Windows 
yet due to optlink not cooperating.

Sure, if you're satisfied with Posix then I guess that's fine. But it's 
not really easy to build cross-platform code with shell script.

> I should also state my tool was written as a build configuration tool
> (like autoconf/iffe/dist), not a conversion tool.  SWIG is better
> supported, faster and supports more languages.
>
> If you need to write code that runs on multiple systems and works with
> low level system calls (rpc, et.al.), my tool might be a better choice.

Why would that make a difference.

> This sort of thing (from the D compiler):
>
> #if __sun
> #include        <alloca.h>
> #endif
>
> Is nuts.  I thought everyone had gotten away from that sort of thing (it
> died out in the mid-eighties!), but I still see it in code everywhere.
> The system should be tested for its capabilities and what it has
> available, not whether it is a sun machine.

DMD (DMC) is from the eighties. It sill uses the .c for its C++ files.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list