Does Mono Implement CLR? Or At Least Some Unmanaged InternalCall? Or Nothing?
Asked Answered
A

1

2

We know that C# uses unmanaged code like P/Invoke or CLR implemented code like InternalCall. What I want to know is does mono it self implements a complete CLR or just some unmanaged code or nothing? I can use .Net Reflactor or ILSpy to view managed assembly, but some times due to performance issues I need to know how does CLR implement some unmanaged code. Like: How does System.String.get_lenght() do? Any one can answer questions above or some infomation about this is welcomed. Thanks.

Aker answered 17/2, 2012 at 1:44 Comment(5)
It implements the CLR. Looking at the code is not an issue, Mono is Open Source.Synergism
@Hans : I just got the mono code. Is it possible to ask which directory should I look into?Aker
Yes, reflector works on mono assemblies, they are the same binary format ( which is the whole idea really ).Foetation
Mono's System.String is implemented here: github.com/mono/mono/blob/master/mcs/class/corlib/System/… - the Length property is not an icall.Ga
Is it more correct to say Mono implements the CLI, than it implements the CLR?Chain
S
4

Yes, mono does implement the whole CLR, so if you looked at its code, you would find the implementation of methods like String.get_Length().

But Mono is a different implementation than the Microsoft CLR. What that means is if you look up the code for String.get_Length() in Mono then the Microsoft CLR could have completely different way of doing the same thing.

Another option is looking at Shared Source Common Language Infrastructure. It's from Microsoft and it's probably more similar to their implementation of CLR than Mono, but it still isn't the same. And the newest available version corresponds to .Net 2.0.

Senskell answered 17/2, 2012 at 1:59 Comment(4)
I know that mono is not Microsoft. But a reference is way much better than nothing. I'm searching the mono code, still looking for it.Aker
Will the upcoming .Net core 1.0 use Mono underneath for its CLR related job?Aleasealeatory
Nitpick: Should your second reference to String.get_lenght() actually be String.get_Length()? If no, can you please explain why?Luhe
@Luhe Yeah, fixed. Thanks.Senskell

© 2022 - 2024 — McMap. All rights reserved.