Thread overview
DMD Compiler as a Library: A Call to Arms
February 22

For the last few months, Razvan Nitu has been periodically working through a refactoring of the AST nodes in the DMD codebase. This is a necessary step in getting the DMD-as-a-library project closer to the finish line.

It's not hard work, but it is a lot of work. Razvan still has to keep up with his other responsibilities, so he can't work on it full time. Now he's asking for help. You can find the details in his latest blog post:

https://dlang.org/blog/2024/02/22/dmd-compiler-as-a-library-a-call-to-arms/

You do not need to be familiar with the DMD codebase to help out with this. In fact, it's a great way to start getting familiar with it. And this work is impactful. DMD-as-a-library is a priority project for us. The work being done here will be beneficial not only for third-party tools that would like to make use of the compiler's AST, but also for potential enhancements to the utility of the compiler itself, such as having it run as a daemon with a built-in LSP server.

Once you've read the blog post, you can find more details in the updated contributor guidelines (also linked in the blog post):

https://github.com/dlang/dmd/blob/master/CONTRIBUTING.md#refactoring-the-dmd-ast

Thanks in advance to everyone who steps up to help with this.

February 22
Now on front page of HackerNews!

https://news.ycombinator.com/news
February 24
In response to this, I thought well this is annoying work, why can't we automate it?

So I did automate a little bit of it exploratory work.

I used dustmite to minify the TODO modules to know what is required to make the parser compile.

The scripts I used are all here, along with a utility program.

Note: if you are doing this work, make sure to copy dmd's source into imports and then delete the modules that you want to have minified from it. But it is best to do them one at a time.

https://gist.github.com/rikkimax/c9a65e82b9cbec60bbd93c5a0d14e827