ASP.NET Dynamic Compilation

  • Thread starter Thread starter Marc
  • Start date Start date
M

Marc

I am studying ASP.NET and have a simple question reading the first lines in
this page:



http://msdn.microsoft.com/en-us/library/ms366723(VS.80).aspx

Are they talking about compilation of C# code to IL code or about
compilation of IL code to machine dependant instruction code?





I've got some trouble with the used terms, I think both (C# -> IL and
IL ->machine code) is called compilation?

Marc Wentink
 
Hi Marc,

yes , you code in any language be in VB.NET or C#.net is compiled into
machine independent language MSIL using the language compilers and the
compiled into machine specific code using the JIT compiler at run time.

Regards,
Manish
www.ComponentOne.com
 
Manish said:
yes , you code in any language be in VB.NET or C#.net is compiled into
machine independent language MSIL using the language compilers and the
compiled into machine specific code using the JIT compiler at run time.

Thanks for your effort Manish, but that unfortunately was not really my
question. I might be unclear what is exactly my question. Let me try again:

Does Dynamic Compilation refer to compiling source code to intermediate
language or does it refer to compiling intermediate language to machine
dependant instructions?
 
Hi Marc

Actually dynamic compilation in this case refers to both compilation
together.
Basically what this means is that you can have .cs (or. vb) files in your
source site.

When you make a request, ASP.NET will compile the .cs first into IL and then
into machine language to emit the required HTML for the client browser.
The conversion from IL to machine is implicit.
 
re:
!> you can have .cs (or. vb) files in your source site

Or both .cs *and* .vb , with a simple configuration in your web.config
plus the creation of a couple of subdirectories under App_Code.



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Juan T. Llibre said:
Or both .cs *and* .vb , with a simple configuration in your web.config
plus the creation of a couple of subdirectories under App_Code.

Yes I did know that, but that's not really relevant for the question.
 
Madhur said:
When you make a request, ASP.NET will compile the .cs first into IL and
then into machine language to emit the required HTML for the client
browser.
The conversion from IL to machine is implicit.

I am confused with the JIT compilation of IL to machine code. The latter
means, as I believe, that for any IL chunk of code, only the parts that are
needed are translated to machine code. So I think ASP.NET wil make a IL dll,
that would be dynamic compilation, and when it uses it, it will translate
only the used parts of the dll to machine code, according to the JIT
principle.

As far as I can remember JIT works that way in both java and .NET.
 
Marc said:
I am confused with the JIT compilation of IL to machine code. The
latter means, as I believe, that for any IL chunk of code, only the
parts that are needed are translated to machine code. So I think
ASP.NET wil make a IL dll, that would be dynamic compilation, and
when it uses it, it will translate only the used parts of the dll to
machine code, according to the JIT principle.

As far as I can remember JIT works that way in both java and .NET.

What you have understood is correct. JIT works both in JAVA and .NET but
there intrinsic implementations are different. JIT is very transparent to
the user in
..NET Framework. So Dynamic compilation essentially means your source
compilation
to IL.

Hope this helps

Madhur
 
Madhur said:
So Dynamic compilation essentially means your source compilation
to IL.

But it has nothing to do with JIT compilation of IL code to machine code
right? That was my confusion. I was reading some stuff and about Dynamic
Compilation and I was thinking are they just meaning JIT or something
totally independant of that, something totally different.
 
Back
Top