|
|
|
|
|
by jbevain
3216 days ago
|
|
Fun fact, the Mono Linker project started 10 years ago during the second edition of the Google Summer of Code! It was originally used to reshape the entire Mono class library into a subset to expose the Silverlight class library API surface for Moonlight. It was then used to link iOS and Android applications in MonoTouch and Mono for Android, and Xamarin continued to use and improve it. The Mono Linker has an open architecture making it reasonably easy to customize how it processes code , and detect patterns specific to each platform to link them away. Xamarin added linker steps to do more than tree-shaking, and remove dead code inside methods. For instance: if (TargetPlatform.Architecture == Architecture.X64) {
// ..
}
The entire if body can be removed if the linker knows that TargetPlatform.Architecture will not be X64.And now, it's the base for the .NET Core linker. Quite a journey! |
|