Re: Article on incremental compilation

2023-04-23 Thread Zachary Yedidia via Digitalmars-d-announce
Ah I see, that makes sense. I'll add an edit about that. Thanks 
for the explanation!


Re: Article on incremental compilation

2023-04-23 Thread Steven Schveighoffer via Digitalmars-d-announce

On 4/22/23 7:33 PM, Zachary Yedidia wrote:

Hi everyone,

I've been tinkering with setting up incremental compilation in my D 
projects by using `.di` files to ensure that a module is only recompiled 
if its interface changes (not its implementation). I've written an 
article about it here: 
https://zyedidia.github.io/blog/posts/4-incremental-d-knit/. Hopefully 
you find it interesting! Thanks!


Nice! Your build system sounds pretty cool.

On your section on "Areas for improvements in D interface files":

The previous section holds the answer -- templates. Templates must be 
included in full because they are instantiated by the caller. But a 
template can still use:


* private variables/functions
* private types
* private imports

etc. Basically anything that can be used in the implementation. The only 
thing that's hidden is non-template function implementations.


In order to avoid copying those things, the compiler would have to prove 
that no template inside the module can use these things.


One possible mechanism could be if *no* templates exist, it could 
exclude them. But to determine whether an existing template might use 
them, I believe is the halting problem.


So we are stuck with it.

-Steve


Article on incremental compilation

2023-04-22 Thread Zachary Yedidia via Digitalmars-d-announce

Hi everyone,

I've been tinkering with setting up incremental compilation in my 
D projects by using `.di` files to ensure that a module is only 
recompiled if its interface changes (not its implementation). 
I've written an article about it here: 
https://zyedidia.github.io/blog/posts/4-incremental-d-knit/. 
Hopefully you find it interesting! Thanks!