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

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Oct 25 23:50:59 UTC 2021


On Mon, Oct 25, 2021 at 11:34:10PM +0000, Basile B. via Digitalmars-d wrote:
> On Sunday, 24 October 2021 at 20:04:05 UTC, Paul Backus wrote:
[...]
> > I have a shortcut set up in Vim that opens the [dpldocs.info][2]
> > search page with the identifier under the cursor, which works pretty
> > well for the standard library and ok for dub packages, but a
> > language server could probably do a better job.
> > 
> > [2]: http://dpldocs.info/
> 
> I'm thinking to a new design lately.
> 
> The deamon would just keep the ast in sync and when a request is made
> the semantic is run from a particular point. The idea is that there's
> no need to run the sema for everything on each request.
> 
> 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. So you either have to save a pristine copy of it somewhere
in the server, somehow isolate and apply changes to it as you go along,
and re-inject it into DMDFE (which according to Walter doesn't really
improve performance that much), or you have to rewrite large swathes of
the compiler to do its work without mutating the AST.


T

-- 
Never step over a puddle, always step around it. Chances are that whatever made it is still dripping.


More information about the Digitalmars-d mailing list