digitalmars.D.announce - RFC: initial release of dtoh
- Mihails (17/17) Aug 22 2018 https://gitlab.com/mihails.strasuns/dtoh
- Seb (6/10) Aug 22 2018 Yeah, the dub registry is "smart" enough to reject all tags from
- Mihails (8/12) Aug 22 2018 This is a bit sad, because that means no stable tool can be built
- =?UTF-8?Q?S=c3=b6nke_Ludwig?= (3/16) Aug 22 2018 Can't we at least use something like "0.0.1-dmd-2.080.0" that is sure to...
- =?UTF-8?Q?S=c3=b6nke_Ludwig?= (2/19) Aug 22 2018 correction: "0.0.1+dmd-2.080.0"
- Mihails (4/7) Aug 22 2018 Sounds like a good workaround, though it does have to actually be
- Manu (5/22) Aug 22 2018 This is very topical for me just now... but no extern(C++)??
- Mihails (7/11) Aug 23 2018 Not if I can get away without it. I am rather opinionated against
- Jacob Carlborg (6/28) Aug 22 2018 Iain has a PR in DMD for generating C++ headers from extern(C++)
- Mihails (3/6) Aug 23 2018 Will have a look, thanks!
- Walter Bright (2/4) Aug 24 2018 This is not a bad idea.
- Manu (3/7) Aug 26 2018 This, please!
- Uknown (5/11) Aug 24 2018 This is all very nice. I agree that this kind of thing should be
- Mike Franklin (4/8) Aug 24 2018 I agree. We also need compiler plugins for things like this:
- Jacob Carlborg (4/8) Aug 25 2018 We have the front end available as a library, but not support for plugin...
- rikki cattermole (3/11) Aug 25 2018 Even though it is available, you won't be using it.
https://gitlab.com/mihails.strasuns/dtoh Tool to grab all `extern(C)` declarations in a D module and generate C header file based on it. Partially addresses https://issues.dlang.org/show_bug.cgi?id=9285 but is intended to be much more simple (no C++, no human-readable emphasis). Main differences from version written by Adam some years ago: - Uses DMD frontend as a library directly - Has tests Former is quite intentional decision though I do expect it to be controversial. Using json output requires parsing information that is already present in DMD FE in a strongly typed way - and the only benefit is that the tool becomes more decoupled from compiler. In my opinion, this functionality _should_ be part of compiler itself, similar to .di generation. Sadly can't put it on code.dlang.org right now because there are no tagged versions of http://code.dlang.org/packages/dmd to depend on, thus have to resort to submodule.
Aug 22 2018
On Wednesday, 22 August 2018 at 11:01:02 UTC, Mihails wrote:https://gitlab.com/mihails.strasuns/dtohCool!!Sadly can't put it on code.dlang.org right now because there are no tagged versions of http://code.dlang.org/packages/dmd to depend on, thus have to resort to submodule.Yeah, the dub registry is "smart" enough to reject all tags from the dmd repository as they all don't conform with SemVer. There has been a long discussion on this (https://forum.dlang.org/post/drcekmxvfszpwifbukzk forum.dlang.org), but sadly it seems that no consensus has been reached.
Aug 22 2018
On Wednesday, 22 August 2018 at 11:51:59 UTC, Seb wrote:Yeah, the dub registry is "smart" enough to reject all tags from the dmd repository as they all don't conform with SemVer. There has been a long discussion on this (https://forum.dlang.org/post/drcekmxvfszpwifbukzk forum.dlang.org), but sadly it seems that no consensus has been reached.This is a bit sad, because that means no stable tool can be built to use DMD FE as a library as long as it want to be available via code.dlang.org (also afair branch dependencies are deprecated in dub itself now). For dtoh it is probably less of a problem as I intend to propose it for inclusion in dmd if it proves itself good enough in production, but it feels like a missed opportunity overall.
Aug 22 2018
Am 22.08.2018 um 14:32 schrieb Mihails:On Wednesday, 22 August 2018 at 11:51:59 UTC, Seb wrote:Can't we at least use something like "0.0.1-dmd-2.080.0" that is sure to not interfere with any official scheme that might be decided on later?Yeah, the dub registry is "smart" enough to reject all tags from the dmd repository as they all don't conform with SemVer. There has been a long discussion on this (https://forum.dlang.org/post/drcekmxvfszpwifbukzk forum.dlang.org), but sadly it seems that no consensus has been reached.This is a bit sad, because that means no stable tool can be built to use DMD FE as a library as long as it want to be available via code.dlang.org (also afair branch dependencies are deprecated in dub itself now). For dtoh it is probably less of a problem as I intend to propose it for inclusion in dmd if it proves itself good enough in production, but it feels like a missed opportunity overall.
Aug 22 2018
Am 22.08.2018 um 15:59 schrieb Sönke Ludwig:Am 22.08.2018 um 14:32 schrieb Mihails:correction: "0.0.1+dmd-2.080.0"On Wednesday, 22 August 2018 at 11:51:59 UTC, Seb wrote:Can't we at least use something like "0.0.1-dmd-2.080.0" that is sure to not interfere with any official scheme that might be decided on later?Yeah, the dub registry is "smart" enough to reject all tags from the dmd repository as they all don't conform with SemVer. There has been a long discussion on this (https://forum.dlang.org/post/drcekmxvfszpwifbukzk forum.dlang.org), but sadly it seems that no consensus has been reached.This is a bit sad, because that means no stable tool can be built to use DMD FE as a library as long as it want to be available via code.dlang.org (also afair branch dependencies are deprecated in dub itself now). For dtoh it is probably less of a problem as I intend to propose it for inclusion in dmd if it proves itself good enough in production, but it feels like a missed opportunity overall.
Aug 22 2018
On Wednesday, 22 August 2018 at 13:59:35 UTC, Sönke Ludwig wrote:Can't we at least use something like "0.0.1-dmd-2.080.0" that is sure to not interfere with any official scheme that might be decided on later?Sounds like a good workaround, though it does have to actually be present as a tag in DMD repo as far as I understand and it will definitely confuse the hell out of random by-passers.
Aug 22 2018
On Wed, 22 Aug 2018 at 04:05, Mihails via Digitalmars-d-announce <digitalmars-d-announce puremagic.com> wrote:https://gitlab.com/mihails.strasuns/dtoh Tool to grab all `extern(C)` declarations in a D module and generate C header file based on it. Partially addresses https://issues.dlang.org/show_bug.cgi?id=9285 but is intended to be much more simple (no C++, no human-readable emphasis). Main differences from version written by Adam some years ago: - Uses DMD frontend as a library directly - Has tests Former is quite intentional decision though I do expect it to be controversial. Using json output requires parsing information that is already present in DMD FE in a strongly typed way - and the only benefit is that the tool becomes more decoupled from compiler. In my opinion, this functionality _should_ be part of compiler itself, similar to .di generation. Sadly can't put it on code.dlang.org right now because there are no tagged versions of http://code.dlang.org/packages/dmd to depend on, thus have to resort to submodule.This is very topical for me just now... but no extern(C++)?? I have some extern(C++) classes that need to have .h files generated for them. Is this a goal for the project?
Aug 22 2018
On Wednesday, 22 August 2018 at 17:58:15 UTC, Manu wrote:This is very topical for me just now... but no extern(C++)?? I have some extern(C++) classes that need to have .h files generated for them. Is this a goal for the project?Not if I can get away without it. I am rather opinionated against `extern(C++)` on principle and stand by the point it is not a suitable language for inter-language operations. Sorry, I know you have a very different opinion here :) Actual production cases may end up requiring it anyway but I'll see how it goes.
Aug 23 2018
On 2018-08-22 13:01, Mihails wrote:https://gitlab.com/mihails.strasuns/dtoh Tool to grab all `extern(C)` declarations in a D module and generate C header file based on it. Partially addresses https://issues.dlang.org/show_bug.cgi?id=9285 but is intended to be much more simple (no C++, no human-readable emphasis). Main differences from version written by Adam some years ago: - Uses DMD frontend as a library directly - Has tests Former is quite intentional decision though I do expect it to be controversial. Using json output requires parsing information that is already present in DMD FE in a strongly typed way - and the only benefit is that the tool becomes more decoupled from compiler. In my opinion, this functionality _should_ be part of compiler itself, similar to .di generation. Sadly can't put it on code.dlang.org right now because there are no tagged versions of http://code.dlang.org/packages/dmd to depend on, thus have to resort to submodule.Iain has a PR in DMD for generating C++ headers from extern(C++) declarations [1]. Perhaps join forces on this. [1] https://github.com/dlang/dmd/pull/8591 -- /Jacob Carlborg
Aug 22 2018
On Wednesday, 22 August 2018 at 19:13:37 UTC, Jacob Carlborg wrote:Iain has a PR in DMD for generating C++ headers from extern(C++) declarations [1]. Perhaps join forces on this. [1] https://github.com/dlang/dmd/pull/8591Will have a look, thanks!
Aug 23 2018
On 8/22/2018 4:01 AM, Mihails wrote:In my opinion, this functionality _should_ be part of compiler itself, similar to .di generation.This is not a bad idea.
Aug 24 2018
On Fri, 24 Aug 2018 at 02:40, Walter Bright via Digitalmars-d-announce <digitalmars-d-announce puremagic.com> wrote:On 8/22/2018 4:01 AM, Mihails wrote:This, please!In my opinion, this functionality _should_ be part of compiler itself, similar to .di generation.This is not a bad idea.
Aug 26 2018
On Wednesday, 22 August 2018 at 11:01:02 UTC, Mihails wrote:https://gitlab.com/mihails.strasuns/dtoh Tool to grab all `extern(C)` declarations in a D module and generate C header file based on it. Partially addresses https://issues.dlang.org/show_bug.cgi?id=9285 but is intended to be much more simple (no C++, no human-readable emphasis). [...]This is all very nice. I agree that this kind of thing should be a part of the compiler, but I think it should be a compiler plugin. If dmd had compiler plugins, I think stuff like this and `dpp` would be much nicer to use.
Aug 24 2018
On Friday, 24 August 2018 at 10:09:07 UTC, Uknown wrote:This is all very nice. I agree that this kind of thing should be a part of the compiler, but I think it should be a compiler plugin. If dmd had compiler plugins, I think stuff like this and `dpp` would be much nicer to use.I agree. We also need compiler plugins for things like this: https://github.com/dlang/dmd/pull/6961 Mike
Aug 24 2018
On 2018-08-24 12:09, Uknown wrote:This is all very nice. I agree that this kind of thing should be a part of the compiler, but I think it should be a compiler plugin. If dmd had compiler plugins, I think stuff like this and `dpp` would be much nicer to use.We have the front end available as a library, but not support for plugins. -- /Jacob Carlborg
Aug 25 2018
On 26/08/2018 7:08 AM, Jacob Carlborg wrote:On 2018-08-24 12:09, Uknown wrote:Even though it is available, you won't be using it. Between memory leaks and not-reusable, it aren't an option.This is all very nice. I agree that this kind of thing should be a part of the compiler, but I think it should be a compiler plugin. If dmd had compiler plugins, I think stuff like this and `dpp` would be much nicer to use.We have the front end available as a library, but not support for plugins.
Aug 25 2018