Beyond the veil: What's after type functions

Jacob Carlborg doob at me.com
Sat Jan 9 20:21:41 UTC 2021


On 2021-01-07 15:05, Ola Fosheim Grøstad wrote:

> But you are able to traverse the whole external AST tree?

Yes.

> So you maintain what is equivalent of a virtual AST? Kinda like React 
> does with a virtual DOM?
> 
> That's ok if only the virtual AST changes, then you can propagate 
> changes to the real AST. UNLESS the compiler is caching information in 
> other structures... At that point things get really hairy.
> 
> But how to detect changes in the real AST, if the compiler modifies it?
> 
> You need to add a tracking mechanism, dirty-marking or some such.

I haven't thought of that.

I have not been able to come up with any other way to expose the AST at 
least. Otherwise I think there would need to be some significant changes 
to how CTFE works in the compiler.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list