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




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

> would recommend that start analysing the output of the C# compiler by
> looking at the generated msil using ildasm (or your fav il disassembler) and
> really see if you could have written a better msil.
> 3- I heard somebody mention that there are indeed some msil instructions
> that C# compiler doesnt use. If by using those instructions more fast code
> could be produced than maybe you have a chance. But I would not count on
> this one.
>
> regards,
>
> Ab.
> http://joehacker.blogspot.com
>
> "Peter Olcott" <olcott@xxxxxxx> wrote in message
> news:7t%rf.37887$QW2.9998@xxxxxxxxxxxxx
>> Cab you write code directly in the Common Intermediate language? I need to
>> optimize a critical real-time function.
>>
>>
>
>


.



Relevant Pages

  • Re: Error message about my user defined type
    ... the type lib delivers to the compiler all necessary information ... COM programming all day long. ... wide available to any programming language who wants to use them. ... CLR and the MSIL. ...
    (microsoft.public.vb.general.discussion)
  • Re: Error message about my user defined type
    ... write a compiler that allow a true VB7 to run on the .Net platform ... > COM programming all day long. ... > wide available to any programming language who wants to use them. ... > other than using the CLR and the MSIL. ...
    (microsoft.public.vb.general.discussion)
  • Re: Can you write code directly in CIL ???
    ... > Cab you write code directly in the Common Intermediate language? ... > optimize a critical real-time function. ... 2- C# compiler is as clever in generating msil as anyone can possibly get. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Create own compiler
    ... You 'd have to learn Intermediate Language Assembly language first, ... building a compiler is very hard. ... information, you could check out the dotGnu and mono projects on linux, or ... I want to create a compiler to compile this and convert into MSIL. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: "STL from the Ground Up"
    ... high-level intermediate language than can interoperate with many other ... If your language lacks expressive features then you cannot write code ... memory management in comparison. ... Mostly because type errors mean that the programmer and compiler disagree ...
    (comp.programming)