D Language Foundation October/November 2023 Planning Updates
Mike Parker
aldacron at gmail.com
Mon Mar 4 11:20:50 UTC 2024
## October
We had no regular planning sessions in October. Instead, there
were two workgroup meetings focused on DMD as a library. These
took place after the monthly meeting and involved several people
who were stakeholders, were interested in the project, or had
some level of experience with it. The invitation list included
Dennis Korpel, Jan Jurzitza (WebFreak), Prajwal S N, Razvan Nitu,
Ali Çehreli, Luís Ferreira, Martin Kinkelin, and Walter Bright.
The main focus of these meetings was a proposal Razvan had
regarding the possibility of overriding AST Nodes, something
[he'd brought up in our September
meeting](https://forum.dlang.org/thread/hetwfhikjqwzlvywmyzc@forum.dlang.org). His idea was to enable it via mixins. Walter was reluctant to take that approach and suggested AST nodes should just be simple classes with fields and helper methods. That approach would simplify how AST families are created, but wouldn't fix the underlying issue of being unable to override a node's behavior. (Also see [Razvan's DConf '23 talk on the topic](https://youtu.be/eKT3MYpRgYA).)
In the end, they agreed to refactor the AST implementation by
pulling all semantic routines and fields out of the AST nodes so
that `ASTBase` will only contain imports of AST nodes as opposed
to the duplicate implementations it contains now. Once this is
complete, they'll revisit Razvan's idea about the mixins.
Razvan has since gotten started on this project. You can [track
its progress in our project
tracker](https://github.com/orgs/dlang/projects/41/views/1). He
recently [published a blog
post](https://dlang.org/blog/2024/02/22/dmd-compiler-as-a-library-a-call-to-arms/) as a call to arms seeking assistance. A handful of people have stepped up, but there's still a lot of work. Anyone looking to make some impactful contributions should read the blog post and [the relevant section of the contributor guide](https://github.com/dlang/dmd/blob/master/CONTRIBUTING.md#refactoring-the-dmd-ast) to learn how to help out.
## November
We had one planning session in November. It was held the week
before our monthly meeting. The main points of discussion were
details about the Bugzilla to GitHub migration and more
implementation details for DMD as a library.
For the former, Robert had already migrated the Visual D issues
and wanted feedback on the order in which to migrate the
remaining projects. Everyone agreed he should go from the project
with the lowest issue count to the highest. We also discussed
some details about dlang-bot, how to handle attachments, and some
more implementation details.
The other issue was regarding `extern(C++)` classes in DMD. These
are `extern(C++)` so that they're available to LDC, GDC, and any
other future tools and compilers that need to integrate the D
compiler into a C++ codebase. However, this had caused problems
for people using DMD as a library in practice. For example,
forgetting that the class is `extern(C++)` when subclassing it;
this caused problems when trying to use features unavailable for
`extern(C++)`, e.g., dynamic arrays. There was a workaround for
that particular case, but a new one had popped up when the
overriding class was templated and was instantiated with, e.g., a
dynamic array type.
Razvan expected this would continue to be an annoying problem and
was looking for ideas to solve it. We discussed the possibility
of making the DMD as a library classes `extern(D)` instead.
Ultimately, the consensus was that though the visitor classes
could be made such, there was no simple way to do it for the AST
nodes. We have more important issues than this to focus on right
now.
More information about the Digitalmars-d-announce
mailing list