How big is the DMD back-end?
Don Clugston
dac at nospam.com.au
Wed May 2 02:25:25 PDT 2007
Walter - Could you give us an idea of the relative size of the source
code of DMD's back-end, compared to the front end? How much of it is
optimisation, and how much is code generation?
I'm interested in this because of my work on the BLADE library, which is
essentially a dedicated optimising compiler for array expressions. I've
convinced myself that with mixins, it is possible to do almost as well
as the compiler could. It's not quite as good, because (1) it doesn't
have access to the results of static analysis from the optimisation
step, and (2) if I generate inline asm, it interferes with the
compiler's other optimisations in that function....but it's extremely close.
But just because you can, doesn't mean you should <g>.
Ultimately, the key question I'm interested in is, how difficult is it
to do such things in a library, compared to in the compiler?
If the code length is ten or a hundred times smaller when it's in the
compiler, it doesn't make much sense for me to try to turn it into an
industrial-strength library, and instead, I should try to package it in
a way which would be easiest for you to integrate into DMD. OTOH there
may be parts of the task which are easier to do from the library side.
More information about the Digitalmars-d
mailing list