Yes. Indeed the presence of more then one (unlimited amount) of
back-ends would require the front-end to be very carefully designed
and bug-free. And this will force the front-end to be a separate tool,
which will generate a standardized semantically tagged AST, which in
turn can be used by any back-end (DMC, GCC, LLVM, maybe even VC++ ...)
to generate code or any development tool (automatic build system,
editors, automatic code analyzers, ...).

It's not only about frontend/backend separation.
The frontend needs to be fully modular. Some applications might not even wish to build up a full AST (like TCC and GCC) while others like refactoring tools need highly detailed information about the original source code. So for example the parser must not directly build an AST, but rather take an interface with ActOnForeachStmt like methods.


I think having an official reference front-end like that is much
better, then having an official reference compiler, since it gives a
lot more flexibility, while it doesn't complicate anything.

Yep, reusability.

It seems, like all the D's remarkable parse-ability is currently being
wasted, since DMD's buggy front-end is indeed the ONLY existing D
parser (i don't take into account the non-working ones, like Dil).

What about dil's parser isn't working?
I thought it was pretty complete.

Reply via email to