Re: Can you write code directly in CIL ???




"Peter Olcott" <olcott@xxxxxxx> wrote in message
news:IEbsf.37965$QW2.18916@xxxxxxxxxxxxx
>
> "Abubakar" <abubakarm@xxxxxxxxx> wrote in message
> news:%23tiR4prCGHA.3820@xxxxxxxxxxxxxxxxxxxxxxx
>> Hi,
>>> Cab you write code directly in the Common Intermediate language? I need
>>> to
>>> optimize a critical real-time function.
>>
>> ofcourse you can, by now you may even have done it. Just write few *.il
>> lines and pass it to ilasm (that comes with the sdk) and you'll get the
>> managed binary.
>>
>> although Nicholas tried explaning. I have just few things to add.
>>
>> 1- If you look at the shared source implementation of .net, ie, SSCLI
>> (aka
>> ROTOR), you wont find a single *.il file that microsoft devs had to write
>> in
>> order to acheive better performance. The max they did to write fast code
>> as
>> a .net code was to write the unsafe C# code (which uses pointers). Beyond
>> that, places that needed to get maximum efficiency like JIT, they used a
>> pure c++ code and in very few places, x86 assembly code was used. I think
>> if
>> those developers could acheive anything significant by writing il
>> directly,
>> they would have done that.
> What I had in mind was to write the best possible code in C++ and have the
> best compiler translate this into assembly language. The best compiler so
> far seems to be Visual C++ 6.0. Some of the optimizations in 7.0 are
> disabled, in particular function inlining. Then I was going to hand tweak
> this generated assembly language. Then as a final step I was going to
> translate this into CIL.
>
>> 2- C# compiler is as clever in generating msil as anyone can possibly
>> get. I
> False assumption when one examines the benchmarks of managed C++ against
> managed C#, Managed C++ does significantly better in at least some cases.
>

Not sure where you get this from? Did you actually run such benchmarks?
I did run many benchmarks, since v1.0 comparing both C# and Managed C++ (and
C++/CLI) and I never saw a delta (yes, for some C# is the winner) larger
than 5%, using v2 they are even smaller.



Willy.


.



Relevant Pages

  • Re: Language design basics
    ... How do you programme a programming language? ... which) to create the first simple C compiler, ... They also have integer instructions add, subtract, multiply, divide. ... FPU handle it by using the appropriate assembly language instructions. ...
    (comp.programming)
  • Re: Is Assembler Language essential in compiler construction?
    ... more interesting and useful than a faked machine language and more ... I taught an undergraduate course on compiler construction where we ... students were able to pick it up quickly. ... together to teach students a specific architecture assembly language, ...
    (comp.compilers)
  • Re: Java or C++?
    ... Fortran vs C on some array benchmarks is probably a good bet. ... compilers often do a lot of platform-specific cache-based optimisation that ... compiler will generate efficient code for you. ... That language isn't C/C++. ...
    (comp.programming)
  • Re: Memory Limit for Visual Studio 2005???
    ... It converts code from one language into native code. ... I already carefully explained in what way it is not a compiler, ... The JIT "compiler" does not translate high level language control flow ... role is much closer to that of an assembly language translator. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is Assembler Language essential in compiler construction?
    ... to implement certain features of your language might involve ... problem with C as portable assembly language. ... structure the C compiler depends on is missing. ...
    (comp.compilers)

Loading