The D Language Foundation's monthly meeting for February 2024
took place on Friday the 9th. It lasted around an hour.
Razvan was the only member who sent in any agenda items before
the meeting.
## The Attendees
The following people attended:
* Paul Backus
* Walter Bright
* Iain Buclaw
* Ali Çehreli
* Jonathan M. Davis
* Martin Kinkelin
* Dennis Korpel
* Mathais Lang
* Átila Neves
* Razvan Nitu
* Mike Parker
* Robert Schadek
* Steven Schveighoffer
* Adam Wilson
## The Summary
Before getting to the first agenda item, I updated everyone on
DConf planning. Symmetry had recently finalized the contract with
Brightspace, our event planner. I was waiting for confirmation
that Brightspace had signed the venue contract before making the
initial announcement.
Next, I told everyone that [the first video in the revival of the
Community Conversations series](https://youtu.be/XpPV5OBJEvg) had
gone pretty well. I thought Martin had done an excellent job.
Since Razvan and I had already discussed his participation, I
asked if he was willing to do the next one. [He
accepted](https://youtu.be/Wndz2hLpbdM).
I then asked for a volunteer for the March episode. No one
stepped forward, so Walter suggested I just pick somebody. I said
I'd allow time for a volunteer to email me, but I'd pick if no
one stepped forward. (In the end, I asked Dennis, [and he
accepted](https://youtu.be/KxlY2ZQpiuI) )
### Item 1: DRuntime hook implementation for array literals
Razvan summarized an issue that Teodor Dutu had encountered in
his project to replace DRuntime hooks with templates.
Specifically, the approach he'd been taking to lowering, handling
it during expression semantic and storing the lowering in an
expression node, wasn't possible with `ArrayLiteralExp` because
of the way the compiler handled it. (Rather than summarize
Razvan's summary here, I'll point you to [Teodor's forum
post](https://forum.dlang.org/thread/ykojheyrmrmpxgjfc...@forum.dlang.org), which Razvan linked in the meeting chat, if you want the details).
Other hooks had a similar issue. The solution Razvan and Teodor
had discussed was to save pointers to the expressions that needed
lowering in an array or a list, and then just do the lowering
after semantic. This would also allow them to get rid of the
fields they'd been using in the AST nodes to store the lowerings.
Martin noted that Iain had proposed that approach in past
discussions about lowering. The main reason they'd gone with
fields in the AST nodes was that post-semantic lowering caused a
performance problem with the CTFE engine. Using the fields was
just simpler. That was why these AST nodes with the lowering
fields still existed.
Razvan said that what he was proposing wouldn't affect CTFE. The
main problem with Iain's proposed approach was that it required
another pass on the AST. But what he and Teodor were proposing
would avoid that, since they were going to globally store
pointers to the expressions that needed lowering.
Martin said he supposed it was an optimization thing, then. We'd
have to see if the cache would pay off or if there would still be
a performance hit. He then recalled another issue with Iain's
proposal, which was that in some cases when outputting the AST
nodes, you didn't want to see the lowering, for example, when
generating C and C++ headers or DI files. He had no idea how to
proceed, but it seemed we were reaching the limitations of the
lowering field.
Razvan said they did have workarounds for this, but they made the
code uglier. The new approach would be much cleaner.
Walter noted that he'd recently run into a problem where DRuntime
was calling an array constructor, and that was removed and
replaced with a template in the semantic pass. Then the inliner
tried to generate more cases that needed to be converted from an
array constructor to the template, and the back end would just
fail because it couldn't call the array constructor anymore. So
he'd added code to the inliner to prevent it from inlining code
that would cause another runtime hook to be generated.
So he thought re-engineering when the runtime hooks get lowered
was a good idea. Right now, it was ad hoc and causing problems.
Razvan said that the new hooks were being lowered during
semantic, but the old hooks were lowered after semantic during
the IR generation. Since they'd been implementing the new hooks
incrementally, they currently had both old and new hooks in the
code. When they finished, they wanted them all in one place, and
Razvan thought doing it after semantic was best.
Walter said another problem was that CTFE would be faced with a
lowered array constructor, so he'd had to put in code to unwind
the constructor in CTFE. So when to do the lowerings was a
problem. Doing them as a separate pass might be the only
solution. He asked what some of the new lowerings should be.
Razvan said that they'd just been picking the ones the IR