If you could make any changes to D, what would they look like?

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Oct 26 02:28:40 UTC 2021


On Tue, Oct 26, 2021 at 01:01:04AM +0000, Basile B. via Digitalmars-d wrote:
> On Monday, 25 October 2021 at 23:50:59 UTC, H. S. Teoh wrote:
> > On Mon, Oct 25, 2021 at 11:34:10PM +0000, Basile B. via Digitalmars-d
> > wrote:
[...]
> > > We only need to have the AST up to date, undecorate it when a file
> > > changes, redecorate it when request are made. And important, only
> > > redecorate from what's asked.
> > 
> > The problem with this is that the current DMDFE mutates the AST as
> > it goes along.
> 
> yeah indeed, aka lowerings...

But the thing is, lowerings don't *have* to be implemented as AST
mutations. They can be a side-branch of the AST node for example. Or
just translate to pure IR along with the rest of the code, then
transformed as IR without touching the AST. It's more efficient (and
less bug-prone) to transform IR than to meddle with the AST anyway.


T

-- 
Тише едешь, дальше будешь.


More information about the Digitalmars-d mailing list