Compilation strategy

Paulo Pinto pjmlp at progtools.org
Mon Dec 17 15:15:37 PST 2012


Am 17.12.2012 23:23, schrieb Walter Bright:
> On 12/17/2012 2:08 PM, Dmitry Olshansky wrote:
>> I really loved the way Turbo Pascal units were made. I wish D go the same
>> route.  Object files would then be looked at as minimal and stupid
>> variation of
>> module where symbols are identified by mangling (not plain meta data
>> as (would
>> be) in module) and no source for templates is emitted.
>> +1
>
> I'll bite. How is this superior to D's system? I have never used TP.
>

Just explaining the TP way, not doing comparisons.

Each unit (module) is a single file and contains all declarations, there 
is a separation between the public and implementation part.

Multiple units can be circular dependent, if they depend between each 
other on the implementation part.

The compiler and IDE are able to extract all the necessary information 
from a unit file, thus making a single file all that is required for 
making the compiler happy and avoiding synchronization errors.

Like any language using modules, the compiler is pretty fast and uses an
included linker optimized for the information stored in the units.

Besides the IDE, there are command line utilities that dump the public 
information of a given unit, as a way for programmers to read the 
available exported API.

Basically not much different from what Java and .NET do, but with a 
language that by default uses native compilation tooling.

--
Paulo






More information about the Digitalmars-d mailing list