Re: .NET 2.0 to be launched on Nov 8
- From: Marco van de Voort <marcov@xxxxxxxx>
- Date: 21 Jun 2005 12:03:39 -0700
On 2005-06-21, Craig Stuntz [TeamB] <craig_stuntz@xxxxxxxxxxxxx> wrote:
> Marco van de Voort wrote:
>
>> There has to be. Native Delphi has no JIT to generate the
>> instantiations on the fly.
>
> You don't need a JIT to make generics work any more than you need a
> JIT to make virtual methods work. Look at Eiffel, for example.
See all my Ada remarks in the thread. Exactly the same.
So please read the thread. You can't do anything with templates in
intermediate form in _final_ native code.
In .NET, the JIT instantiates them for you, but who does this for native code?
The _compiler_ has to.
Anyway, here is a summary:
For *native* code in a halfwhat decent language (excluding C++ with its
deranged imports system),
1) when compiling a template in a module it is transformed to some
intermediate parsed form, and stored in the non-code part of your compiled
module. (which is roughly the .dcu minus what would be stored in a .obj)
2) when instantiating a template, you generate code for it when compiling
the module. Preferably somehow in a global namespace (for point 3).
3) To avoid unnecessary bloat, the linker must somehow remove duplicate
code generations for the same instantiation. The key for uniqueness is
then the combination of the _qualified_ template type and the instantiation
type.
(3) is e.g. a problem of FPC, since, contrary to Borland, the linker is out
of the compiler writers control (since it is GNU LD). However maybe it is
possible to tap into LD functionality for C++ for the same case.
.
- Follow-Ups:
- Re: .NET 2.0 to be launched on Nov 8
- From: Rudy Velthuis [TeamB]
- Re: .NET 2.0 to be launched on Nov 8
- From: Craig Stuntz [TeamB]
- Re: .NET 2.0 to be launched on Nov 8
- References:
- .NET 2.0 to be launched on Nov 8
- From: Paras Kafley
- Re: .NET 2.0 to be launched on Nov 8
- From: Tom Reiertsen
- Re: .NET 2.0 to be launched on Nov 8
- From: Jeroen Vandezande
- Re: .NET 2.0 to be launched on Nov 8
- From: Captain Jake
- Re: .NET 2.0 to be launched on Nov 8
- From: Rudy Velthuis [TeamB]
- Re: .NET 2.0 to be launched on Nov 8
- From: Marco van de Voort
- Re: .NET 2.0 to be launched on Nov 8
- From: Rudy Velthuis [TeamB]
- Re: .NET 2.0 to be launched on Nov 8
- From: Marco van de Voort
- Re: .NET 2.0 to be launched on Nov 8
- From: Jeroen Vandezande
- Re: .NET 2.0 to be launched on Nov 8
- From: Marco van de Voort
- Re: .NET 2.0 to be launched on Nov 8
- From: Rudy Velthuis [TeamB]
- Re: .NET 2.0 to be launched on Nov 8
- From: Marco van de Voort
- Re: .NET 2.0 to be launched on Nov 8
- From: Craig Stuntz [TeamB]
- .NET 2.0 to be launched on Nov 8
- Prev by Date: Close in a FormShow possible??
- Next by Date: Re: .NET 2.0 to be launched on Nov 8
- Previous by thread: Re: .NET 2.0 to be launched on Nov 8
- Next by thread: Re: .NET 2.0 to be launched on Nov 8
- Index(es):
Relevant Pages
|