Thread overview
(Oh My) Gentool 0.4.0 released
Jun 06
evilrat
Jun 06
sighoya
Jun 06
evilrat
Jun 07
evilrat
Jun 08
evilrat
June 06

(oh my) gentool v0.4 is now out.

It is my fancy tool to generate extern(C++) stuff quicker, it takes regular compiler flags that you usually pass to clang and translates C/C++ code to D.

This release has one new feature: support pragma mangle on aggregates (class, struct, etc...).

Also a lot of work was put into template support, but it is still has lots of unhandled cases, so do not expect it will translate STL or Boost without need of manual fixes.

Source
https://github.com/Superbelko/ohmygentool

Windows binaries
https://github.com/Superbelko/ohmygentool/releases/tag/v0.4.0

June 06

On Sunday, 6 June 2021 at 10:03:11 UTC, evilrat wrote:

>

(oh my) gentool v0.4 is now out.

It is my fancy tool to generate extern(C++) stuff quicker, it takes regular compiler flags that you usually pass to clang and translates C/C++ code to D.

This release has one new feature: support pragma mangle on aggregates (class, struct, etc...).

Also a lot of work was put into template support, but it is still has lots of unhandled cases, so do not expect it will translate STL or Boost without need of manual fixes.

Source
https://github.com/Superbelko/ohmygentool

Windows binaries
https://github.com/Superbelko/ohmygentool/releases/tag/v0.4.0

+1

How did you parse C++ code which seems overkill to do alone. Did you enact clang for?

June 06

On Sunday, 6 June 2021 at 10:38:22 UTC, sighoya wrote:

>

On Sunday, 6 June 2021 at 10:03:11 UTC, evilrat wrote:

>

(oh my) gentool v0.4 is now out.

It is my fancy tool to generate extern(C++) stuff quicker, it takes regular compiler flags that you usually pass to clang and translates C/C++ code to D.

This release has one new feature: support pragma mangle on aggregates (class, struct, etc...).

Also a lot of work was put into template support, but it is still has lots of unhandled cases, so do not expect it will translate STL or Boost without need of manual fixes.

Source
https://github.com/Superbelko/ohmygentool

Windows binaries
https://github.com/Superbelko/ohmygentool/releases/tag/v0.4.0

+1

How did you parse C++ code which seems overkill to do alone. Did you enact clang for?

Yes, it's all clang under the hood.
But it's not just clang tooling that uses pre-made Tool class that has to be invoked as part of clang itself using special flag.
Instead it creates compiler instance and runs regular compilation pass in memory extracting declarations recursively (as part of older pipeline, can be done to some extent using C API with cursors), and then it converts C++ AST to D source code with minimal AST manipulation (can't be done with C API), though I'm looking into AST-to-AST translation instead and then using D compiler frontend to emit source code for better result.

June 07

On Sunday, 6 June 2021 at 10:03:11 UTC, evilrat wrote:

>

(oh my) gentool v0.4 is now out.

It is my fancy tool to generate extern(C++) stuff quicker, it takes regular compiler flags that you usually pass to clang and translates C/C++ code to D.

This release has one new feature: support pragma mangle on aggregates (class, struct, etc...).

Also a lot of work was put into template support, but it is still has lots of unhandled cases, so do not expect it will translate STL or Boost without need of manual fixes.

Source
https://github.com/Superbelko/ohmygentool

Windows binaries
https://github.com/Superbelko/ohmygentool/releases/tag/v0.4.0

Nice work. Is there a docker somewhere in order to test it?

June 07

On Sunday, 6 June 2021 at 10:03:11 UTC, evilrat wrote:

>

(oh my) gentool v0.4 is now out.

It is my fancy tool to generate extern(C++) stuff quicker, it takes regular compiler flags that you usually pass to clang and translates C/C++ code to D.

This release has one new feature: support pragma mangle on aggregates (class, struct, etc...).

Also a lot of work was put into template support, but it is still has lots of unhandled cases, so do not expect it will translate STL or Boost without need of manual fixes.

Source
https://github.com/Superbelko/ohmygentool

Windows binaries
https://github.com/Superbelko/ohmygentool/releases/tag/v0.4.0

Splendid work, keep it up

June 07

On Monday, 7 June 2021 at 09:45:53 UTC, Andrea Fontana wrote:

>

On Sunday, 6 June 2021 at 10:03:11 UTC, evilrat wrote:

>

(oh my) gentool v0.4 is now out.

It is my fancy tool to generate extern(C++) stuff quicker, it takes regular compiler flags that you usually pass to clang and translates C/C++ code to D.

This release has one new feature: support pragma mangle on aggregates (class, struct, etc...).

Also a lot of work was put into template support, but it is still has lots of unhandled cases, so do not expect it will translate STL or Boost without need of manual fixes.

Source
https://github.com/Superbelko/ohmygentool

Windows binaries
https://github.com/Superbelko/ohmygentool/releases/tag/v0.4.0

Nice work. Is there a docker somewhere in order to test it?

It's got a dockerfile few days back, though I haven't tried it myself yet.

(SSH port at end is for IDE's)
https://github.com/Superbelko/ohmygentool/blob/master/Dockerfile.local-dev

It detects standard library includes automatically, but if you're going to cross compile you'll have to tell it where to look, also probably need to pass proper target triple.

June 08

On Monday, 7 June 2021 at 10:15:28 UTC, evilrat wrote:

>

On Monday, 7 June 2021 at 09:45:53 UTC, Andrea Fontana wrote:

>

On Sunday, 6 June 2021 at 10:03:11 UTC, evilrat wrote:

>

(oh my) gentool v0.4 is now out.

It is my fancy tool to generate extern(C++) stuff quicker, it takes regular compiler flags that you usually pass to clang and translates C/C++ code to D.

This release has one new feature: support pragma mangle on aggregates (class, struct, etc...).

Also a lot of work was put into template support, but it is still has lots of unhandled cases, so do not expect it will translate STL or Boost without need of manual fixes.

Source
https://github.com/Superbelko/ohmygentool

Windows binaries
https://github.com/Superbelko/ohmygentool/releases/tag/v0.4.0

Nice work. Is there a docker somewhere in order to test it?

Added image to dockerhub

https://hub.docker.com/r/superbelko/gentool

Get it using

docker pull superbelko/gentool

How to use

https://github.com/Superbelko/ohmygentool/wiki/Docker