Click to See Complete Forum and Search --> : Excited about VC++ .NET, better than C#?
ADSOFT
July 25th, 2004, 10:25 PM
Is it true that C# can't compile down to unmanaged code.
I read somewhere today that you need to license the CLR if you want to run a .NET app at this time. Is that true??
Another questiong, is it true that VC++ .NET is the only tool that can develop UNMANAGED code from the .NET family???
If both are true, .Net has a way to go before it replaces VC++, NOT many computers have the CLR runtime on them. :)
KevinHall
July 25th, 2004, 11:37 PM
I don't believe one has to license the CLR. I do know that all the .NET stuff is being standardized. Initially by ECMA, with plans for a later ISO standardization.
C++ is not the only way to develop unmanaged code. C# can import unmanaged code that has a "C callabe interface" (i.e. 'extern "C"').
Visual C++ is not the only compiler to support .NET. Borland has (or soon will have) a .NET compiler. Also, there are free C# compilers. Mono is one of these and also compiles C# code for Linux and OS X. (Granted, Mono isn't as robust as VS.NET).
So, yes, .NET was developed primarily by MS, and b/c of this MS will have the best support for it. But MS has learned the necessity of standardization (i.e. more people will develop with .NET (VS.NET) once they believe that .NET will really be portable.
- Kevin
ADSOFT
July 26th, 2004, 01:12 AM
What I was getting at is that Visual C++ .NET can compile down to native code AND can also use the .NET FRAMEWORK , i.e, WINFORMS. .. so you can basically be developing for .NET and in the mean time compile down to native code. .... ??? but I thought that C# could do that too: Java can compile down to native code
So my question was, Can you compile the .NET FRAMEWORK code down to native code.
What I'm confused about is the dependency on the JIT, I thought that C# promised the the developer had the chose of compiling down to native code.
What I want to do is develp some .NET stuff but compile it down to native code and bypass the need for the JIT.
I want to get some .NET FRAMEWORK experience but not be dependent on the JIT.
I know there is a JIT for WINOWS 98, but it would be cool if you could do some .NET and compile it down to WINDOWS 95 or at least be JIT indepent??
KevinHall
July 26th, 2004, 01:33 AM
I believe that with Visual C++.NET, there is really no JIT, just startup-compilation. In other words, the compilation takes place at application startup not at runtime. This results in a slower application startup, but the application code itself runs rather quickly (almost as quickly as native C++ code).
I don't know about compiling to native code. There is likely still dependence on the .NET framework, and I honestly don't know how that would work itself out with native code compilation.
ADSOFT
July 26th, 2004, 02:15 AM
I just got my Visual Studio .NET package and I will be starting on VC++ .NET and C# .NET in the next couple of days.
But I think the answere lies in figuring out what this switch does
csc /target:winexe in.cs
that is the command to compile a C# program and generate windows executable.??? I think that means that the code will be JIT independent?
there must be a simular switch for VC++ .NET ?
.. do a search on 'css/target:winexe' many interesting things come up.
DNA5122
August 3rd, 2004, 12:52 PM
doesn't that switch just mean that its going to be an exe rather than a dll or whatnot? I was under the impression (just guessing haven't read this anywhere) that exes must have a small amount of native code in the beginning that tells the JIT compiler to convert the rest of the exe into native code. How could you get an exe file to run without some native code at the startup?
Andreas Masur
August 3rd, 2004, 02:05 PM
Is it true that C# can't compile down to unmanaged code.
Well...what do you mean with compile down to unmanaged code? In general C# requires the .NET framework in order to run, however, you can of course use unmangaged code inside your C# application (as mentioned).
I read somewhere today that you need to license the CLR if you want to run a .NET app at this time. Is that true??
There is no need to license the framework...it comes with XP automatically and can be downloaded freely at Microsoft...
Another questiong, is it true that VC++ .NET is the only tool that can develop UNMANAGED code from the .NET family???
Yes...Visual C++ .NET is the only language that can produce native code (in other words code, that does not require the .NET framework).
If both are true, .Net has a way to go before it replaces VC++, NOT many computers have the CLR runtime on them. :)
Well...every new computer coming with Windows XP will... :cool:
Andreas Masur
August 3rd, 2004, 02:09 PM
C++ is not the only way to develop unmanaged code. C# can import unmanaged code that has a "C callabe interface" (i.e. 'extern "C"').
Although being true....in order to run a C# application one would need the framework (for the managed code)... :cool:
Also, there are free C# compilers. Mono is one of these and also compiles C# code for Linux and OS X. (Granted, Mono isn't as robust as VS.NET).
Well...Mono does actually not provide an IDE...however, I am not sure whether you meant that while comparing it with VS .NET...
Andreas Masur
August 3rd, 2004, 02:13 PM
What I was getting at is that Visual C++ .NET can compile down to native code AND can also use the .NET FRAMEWORK , i.e, WINFORMS. .. so you can basically be developing for .NET and in the mean time compile down to native code. .... ??? but I thought that C# could do that too: Java can compile down to native code
Well...with Visual C++ .NET you basically have two choices....either go the unmanaged or managed route...the former one will not use anything from the .NET framework though...in other words no WinForms etc. As of now....I would not know of any way to compile C# down to native code...without having the framework....maybe the misunderstanding is there...it will be compiled to native code if you run the application...
So my question was, Can you compile the .NET FRAMEWORK code down to native code.
Yes...this is done while running the application...
What I want to do is develp some .NET stuff but compile it down to native code and bypass the need for the JIT.
Well...that is currently not possible....i order to run applications using features from the .NET framework you have to have the framework installed on the target system.
Andreas Masur
August 3rd, 2004, 02:18 PM
I believe that with Visual C++.NET, there is really no JIT, just startup-compilation. In other words, the compilation takes place at application startup not at runtime. This results in a slower application startup, but the application code itself runs rather quickly (almost as quickly as native C++ code).
Yes...that is correct...at startup the code will be compiled by the common language runtime to the actual machine code.... :cool:
Andreas Masur
August 3rd, 2004, 02:51 PM
csc /target:winexe in.cs
that is the command to compile a C# program and generate windows executable.??? I think that means that the code will be JIT independent?
Well...this actually only states the type of the application that will be created...
exe -> Console executable (default)
winexe -> Windows executable
library -> Library
module -> Module that can be added to an assembly
However, it does not have influence on the framework itself... :cool:
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.