On Tuesday, 22 May 2012 at 16:03:49 UTC, Dmitry Olshansky wrote:
In my mind it's encountered rather soon:
lex/scan -> postprocess (may be combined with lex) -> populate
symbol tables (ditto - with next step/previous step) -> parse
to AST -> ...
That symbol table should contain all of the rich hierarchy of
modules. That is the actual compiler is able to have a single
stack of scopes that it pushes/pops as it processes code. Your
DCT on the other hand should have all of local scopes (of every
entity) at once.
It may be possible to simulate it with some deal of laziness,
but I guess keeping the whole symbol table is the easiest and
the fastest way still.
And likely the only feasible in D. It doesn't support lazy
evaluation for immutable data structures, and immutability is
necessary for most use cases.
Watch out for some mind-bending data structures :)
Do you mean not to overcomplicate? Or use classic data
structures? Or something else?
So far I think immutable red-black trees will be central in DCT
architecture, as well as some others.