November 19, 2020 Re: My idea for seamless interop to C++ | ||||
---|---|---|---|---|
| ||||
Posted in reply to Petar Kirov [ZombineDev] | On Thursday, 19 November 2020 at 07:37:52 UTC, Petar Kirov [ZombineDev] wrote: > On Thursday, 19 November 2020 at 07:02:58 UTC, Jacob Carlborg wrote: >> On Wednesday, 18 November 2020 at 23:32:00 UTC, Petar Kirov [ZombineDev] wrote: >> > dpp makes for some cool live demoes, I'm using it in autowrap to translate the Python headers. Still some issues with macros though, that I had to translate by hand. But, then again, there's no other way to get around this and I'm out of ideas wrt to those particular macros. > but I've always preferred my source code committed to git, You can! Use `--keep-d-files`. But, like object files, I don't know why you'd want to check them in. > rather than just existing in-memory They're on the file system, but by default they get deleted after the binary is generated. I should probably change that - since nearly everything has dub dependencies, using d++ as a compiler makes little sense, and dub needs to see the resulting D files to actually use them. |
November 19, 2020 Re: My idea for seamless interop to C++ | ||||
---|---|---|---|---|
| ||||
Posted in reply to Atila Neves | On Thursday, 19 November 2020 at 16:36:47 UTC, Atila Neves wrote:
> [snip]
>
> I'm using it in autowrap to translate the Python headers. Still some issues with macros though, that I had to translate by hand. But, then again, there's no other way to get around this and I'm out of ideas wrt to those particular macros.
> [snip]
Would using some like warp to process the macros first be something you have considered?
|
November 21, 2020 Re: My idea for seamless interop to C++ | ||||
---|---|---|---|---|
| ||||
Posted in reply to jmh530 | On Thursday, 19 November 2020 at 17:29:54 UTC, jmh530 wrote: > On Thursday, 19 November 2020 at 16:36:47 UTC, Atila Neves wrote: >> [snip] >> >> I'm using it in autowrap to translate the Python headers. Still some issues with macros though, that I had to translate by hand. But, then again, there's no other way to get around this and I'm out of ideas wrt to those particular macros. >> [snip] > > Would using some like warp to process the macros first be something you have considered? Yes. It didn't build. After I edited it to make it build, it didn't work. In any case, I *am* using the C preprocessor on the macros. The problem is translating something like this from https://github.com/python/cpython/blob/0e62efc51e31c741b61604787aeab4936e6e50e4/Include/object.h#L84: #define PyObject_HEAD_INIT(type) \ { _PyObject_EXTRA_INIT \ 1, type }, I know how to translate that as a human, but I don't know how to write a program that does that for me and that works in the general case. Or even most cases. |
Copyright © 1999-2021 by the D Language Foundation