Re: .NET 2.0 to be launched on Nov 8



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.
.



Relevant Pages

  • Re: any JIT compilers for Prolog?
    ... to WAM bytecode and saves it in a file.wic ... in it were further compiled to native code (on Sparc ... I wouldn't name the above JIT: it is just a staged compiler whose last ...
    (comp.lang.prolog)
  • Re: Why does activex control run 3x+ faster in vb5 than .net?
    ... Looks like a good interpreter works almost as fast as a bad compiler. ... Native code and MSIL compiled code is not the same thing - Native code can be more or less be directly executed on the CPU while MSIL requires the extra step of gothrough the JIT. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Why does activex control run 3x+ faster in vb5 than .net?
    ... is compiled before it is run for the first time and with JIT ... So the only performance hit JIT is giving, ... Regardless of what you want to say - MSIL is NOT native code. ... There is only a just in time COMPILER that compiles the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Why MC++ is faster then C# ?
    ... If you have specific scenarios that you think are unknown to the JIT team, ... Rememver that the MC++ compiler is very mature, ... performance out of a JIT than "pre"-compiled native code). ... > Pierwszy łyk z pucharu nauk przyrodniczych czyni ateistą, ...
    (microsoft.public.dotnet.framework.performance)
  • Re: fatal error LNK1179
    ... obscure tool-chain bug has a low probability of success in any timeframe. ... >> obscure bug in which the compiler emits two different bodies for the ... >> a single template instantiation. ... information if you have /incremental:yes in your link options. ...
    (microsoft.public.dotnet.languages.vc)