digitalmars.D.announce - Article on incremental compilation
- Zachary Yedidia (7/7) Apr 22 2023 Hi everyone,
- Steven Schveighoffer (18/26) Apr 23 2023 Nice! Your build system sounds pretty cool.
- Zachary Yedidia (2/2) Apr 23 2023 Ah I see, that makes sense. I'll add an edit about that. Thanks
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!
Apr 22 2023
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
Apr 23 2023
Ah I see, that makes sense. I'll add an edit about that. Thanks for the explanation!
Apr 23 2023