April 23, 2021

On Friday, 23 April 2021 at 20:24:24 UTC, Brian wrote:

>

On Friday, 23 April 2021 at 19:58:53 UTC, bachmeier wrote:

>

I guess my first preference would be the D compilers handling it. Just as dub init creates a new Dub project, dmd dlang.mk dumps dlang.mk in the directory and a Makefile that includes it.

I suspect that makes this a larger conversation which requires the enrollment of the compiler writers, possibly on the order of a DIP (which I can author if desired).

~Brian

I'm not sure how that decision would be made. It shouldn't require a DIP since it's not a language change.

April 23, 2021

On Friday, 23 April 2021 at 20:24:24 UTC, Brian wrote:

>

On Friday, 23 April 2021 at 19:58:53 UTC, bachmeier wrote:

>

I guess my first preference would be the D compilers handling it. Just as dub init creates a new Dub project, dmd dlang.mk dumps dlang.mk in the directory and a Makefile that includes it.

I suspect that makes this a larger conversation which requires the enrollment of the compiler writers, possibly on the order of a DIP (which I can author if desired).

~Brian

Building D code does not require a DIP.

dmd --smart-makefile-output=dlang.mk or similar would be a better API

April 23, 2021

On Friday, 23 April 2021 at 12:34:09 UTC, Brian wrote:

>

So I went ahead and added D support to GNU Make: https://github.com/ibara/gmake-d

It looks like it doesn't handle inter-module dependencies yet.

You might be interested in looking at rdmd's --makedepend and --makedepfile switches. These output a module dependency graph in a format that can be included into a makefile, thus allowing safe and correct rebuilds of D programs.

However, generally, single-object compilation doesn't scale very well. This area has been explored quite thoroughly over the past two decades, and I think the best middle ground is that which Dub uses: build things one package at a time, and then link them together. Issues with which object files which template instantiations go into, and the quality of generated .di files, have been the obstacles in significantly improving the building of D programs, and I don't think sufficient progress has occurred there lately either.

April 24, 2021

On Friday, 23 April 2021 at 22:33:28 UTC, bachmeier wrote:

>

On Friday, 23 April 2021 at 20:24:24 UTC, Brian wrote:

>

On Friday, 23 April 2021 at 19:58:53 UTC, bachmeier wrote:

>

I guess my first preference would be the D compilers handling it. Just as dub init creates a new Dub project, dmd dlang.mk dumps dlang.mk in the directory and a Makefile that includes it.

I suspect that makes this a larger conversation which requires the enrollment of the compiler writers, possibly on the order of a DIP (which I can author if desired).

~Brian

I'm not sure how that decision would be made. It shouldn't require a DIP since it's not a language change.

Perhaps I misunderstood the process then, since DIP specifically mentions tooling changes, and this would be a tooling change that (probably) all the compilers would have to get behind to get much tractions.

April 24, 2021

On Friday, 23 April 2021 at 22:48:56 UTC, Vladimir Panteleev wrote:

>

On Friday, 23 April 2021 at 12:34:09 UTC, Brian wrote:

>

So I went ahead and added D support to GNU Make: https://github.com/ibara/gmake-d

It looks like it doesn't handle inter-module dependencies yet.

True. It only handles the simple case right now.

>

You might be interested in looking at rdmd's --makedepend and --makedepfile switches. These output a module dependency graph in a format that can be included into a makefile, thus allowing safe and correct rebuilds of D programs.

This is good to know.

>

However, generally, single-object compilation doesn't scale very well. This area has been explored quite thoroughly over the past two decades, and I think the best middle ground is that which Dub uses: build things one package at a time, and then link them together. Issues with which object files which template instantiations go into, and the quality of generated .di files, have been the obstacles in significantly improving the building of D programs, and I don't think sufficient progress has occurred there lately either.

I agree with you here. But I also generally think that we need to "meet people where they are" and not where we want them to be.

~Brian

April 24, 2021

On Friday, 23 April 2021 at 22:48:56 UTC, Vladimir Panteleev wrote:

>

On Friday, 23 April 2021 at 12:34:09 UTC, Brian wrote:

>

So I went ahead and added D support to GNU Make: https://github.com/ibara/gmake-d

It looks like it doesn't handle inter-module dependencies yet.

Neither do any of GNU make's other built-in rules (see e.g. [1]). They are not intended to be comprehensive.

[1] http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/

1 2
Next ›   Last »