Thread overview
DStep 1.0.0
Apr 22, 2019
Jacob Carlborg
Apr 22, 2019
Dennis
Apr 22, 2019
Jacob Carlborg
Apr 26, 2019
Robert M. Münch
Apr 27, 2019
Jacob Carlborg
April 22, 2019
I would like to announce a new major release of DStep, 1.0.0.

This release is the biggest release since the initial release. It has support for translating some of the preprocessor, like `#define` for contestants and function-like macros. It now supports preserving comments and support for one more platform has been added: Windows. Many more features have been added and bugs have been fixed, too many to mention here.

For those not familiar, DStep is a tool for automatically generating D bindings for C and Objective-C libraries. This is implemented by processing C or Objective-C header files and output D modules. DStep uses the Clang compiler as a library (libclang) to process the header files.

This release would not have been possible without Wojciech Szęszoł, the Google Summer of Code student that started to work on DStep during the summer of 2016 and still is contributing.

For the full changelog (this has been built up for over three years, so I'm sure things are missing), see the release page [1].

Binaries are available for macOS, Linux and Windows [1]. The Linux binary is completely statically linked and should work on any distro. The macOS binary is statically linked with libclang and doesn't have any additional dependencies besides the system libraries. The Windwos binaries require to install libclang.

[1] https://github.com/jacob-carlborg/dstep/releases/tag/v1.0.0

-- 
/Jacob Carlborg
April 22, 2019
On Monday, 22 April 2019 at 11:02:24 UTC, Jacob Carlborg wrote:
> It now supports preserving comments and support for one more platform has been added: Windows.

Huh, I've been using DStep on Windows back in January.
I can't remember how I obtained the binary, but it's version 0.2.3-67-gdeabc63.
It worked partially, but could not translate C function pointers to D's `function()` syntax, leaving a 'TODO' stub instead.
Has that changed? I can't find anything about it in the release notes.

In any case, glad to see the tool maturing!
April 22, 2019
On 2019-04-22 15:20, Dennis wrote:

> Huh, I've been using DStep on Windows back in January.
> I can't remember how I obtained the binary, but it's version 0.2.3-67-gdeabc63.

The Windows support was implemented during GSoC 2016. It just has never been a new release since then. I have created a few tags, for various reasons, since then, but no official release.

> It worked partially, but could not translate C function pointers to D's `function()` syntax, leaving a 'TODO' stub instead.
> Has that changed? I can't find anything about it in the release notes.

Translating function pointers has probably been supported since the first release. There are tests for this. If there's something that is not working, please file a bug at [1]. Ideally with a minimal test case with the C code and the expected D code.

[1] https://github.com/jacob-carlborg/dstep/issues

-- 
/Jacob Carlborg
April 26, 2019
On 2019-04-22 11:02:24 +0000, Jacob Carlborg said:

> ... and support for one more platform has been added: Windows...

Are there are any functional differences between the platforms? Or can I just use the OSX version and use the generated .d files with the DMD Windows version too?

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster

April 27, 2019
On 2019-04-26 10:33, Robert M. Münch wrote:

> Are there are any functional differences between the platforms?

The short answer is yes.

> Or can I just use the OSX version and use the generated .d files with the DMD
> Windows version too?

The longer answer is that it depends. DStep behaves the same way as the compiler (Clang in this case). That means that there are different predefined macro constants for different platforms. For example:

#if _WIN32
#include <windows.h>
DWORD foo();
#else
int foo();
#endif

If you run DStep on Windows it will output:

extern (C):

DWORD foo();

But on any other platform it will output:

extern (C):

int foo();

So it's a question if the header files contain any code like the above. The bindings that DStep uses for libclang are generated on macOS but are used unchanged on Windows and Linux as well. But these are the most forgiven headers that I've seen when it comes to create bindings.

-- 
/Jacob Carlborg