www.digitalmars.com         C & C++   DMDScript  

digitalmars.dip.ideas - Compiler Daemon: dmd -watch

reply xoxorwr <noreply gmail.com> writes:
As a related idea to my previous post (1), a persistent DMD 
compiler daemon could further improve hot reload workflows.

A `dmd watch` mode could keep compiler state resident in memory, 
monitor source files for changes, and serve incremental 
compilation requests.

Example:

```bash
dmd -watch <args>
```

Combined with ` watch`, this would help make D a stronger 
platform for live code reloading.

1 - 
https://forum.dlang.org/thread/ceitihaomrrxhivwryov forum.dlang.org
Jun 12
next sibling parent xoxorwr <noreply gmail.com> writes:
On Friday, 12 June 2026 at 13:07:26 UTC, xoxorwr wrote:
 As a related idea to my previous post (1), a persistent DMD 
 compiler daemon could further improve hot reload workflows.

 A `dmd watch` mode could keep compiler state resident in 
 memory, monitor source files for changes, and serve incremental 
 compilation requests.

 Example:

 ```bash
 dmd -watch <args>
 ```

 Combined with ` watch`, this would help make D a stronger 
 platform for live code reloading.

 1 - 
 https://forum.dlang.org/thread/ceitihaomrrxhivwryov forum.dlang.org
I should note that I already have a working PoC, I'll publish the source soon.
Jun 12
prev sibling parent reply Mike Parker <aldacron gmail.com> writes:
On Friday, 12 June 2026 at 13:07:26 UTC, xoxorwr wrote:
 As a related idea to my previous post (1), a persistent DMD 
 compiler daemon could further improve hot reload workflows.

 A `dmd watch` mode could keep compiler state resident in 
 memory, monitor source files for changes, and serve incremental 
 compilation requests.

 Example:

 ```bash
 dmd -watch <args>
 ```

 Combined with ` watch`, this would help make D a stronger 
 platform for live code reloading.

 1 - 
 https://forum.dlang.org/thread/ceitihaomrrxhivwryov forum.dlang.org
We're moving toward running the compiler as a daemon. This is something Robert Schadek pushed for in a few meetings a while back that would enable certain kinds of features, like monitoring source files, and Walter agreed it was a good idea. It's one of the motivations behind the AST refactoring project. At any rate, I don't believe this required a DIP.
Jun 12
parent Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Saturday, 13 June 2026 at 02:09:43 UTC, Mike Parker wrote:
 We're moving toward running the compiler as a daemon. This is 
 something Robert Schadek pushed for in a few meetings a while 
 back that would enable certain kinds of features, like 
 monitoring source files, and Walter agreed it was a good idea. 
 It's one of the motivations behind the AST refactoring project.
Wonderful. What a time to be alive!
Jun 23