Compilation strategy
Paulo Pinto
pjmlp at progtools.org
Mon Dec 17 12:31:29 PST 2012
Am 16.12.2012 23:32, schrieb Andrej Mitrovic:
> On 12/16/12, Paulo Pinto <pjmlp at progtools.org> wrote:
>> If modules are used correctly, a .di should be created with the public
>> interface and everything else is already in binary format, thus the
>> compiler is not really parsing everything all the time.
>
> A lot of D code tends to be templated code, .di files don't help you
> in that case.
>
Why not?
Ada, Modula-3, Eiffel, ML languages are just a few examples of languages
that support modules and genericity.
So clearly there are some ways of doing it.
Granted, in Ada and Modula-3 case you actually have to define the types
when importing a module, so there is already a difference.
A second issue is that their generic systems are not as powerful as D.
I think that the main issue is that the majority seems to be ok with
having template code in .di files, and that is ok.
But if there was interest, I am sure there could be a way to store the
template information in the compiled module, while exposing the required
type parameters for the template in the .di file, a la Ada.
--
Paulo
More information about the Digitalmars-d
mailing list