Dela via


MIX09: Inside Microsoft Silverlight

This is a look at the CoreCLR, which is what Silverlight runs on.

Session abstract: See how the CLR team slimmed down the size of the runtime into a small, zippy download, the Core CLR, yet kept the experience .NET developers have come to love.

Presenter: Brandon Bray, Senior Program Manager Lead, CLR Team

Video and PPT

21:58

  • Agenda
    • Why use .NET with Silverlight?
    • Slimming down the desktop CLR
    • New features for Core CLR
    • Future Investments
  • Why use .NET with Silverlight?
    • strong developer community
    • tool ecosystem can be reused
    • .NET features
      • AppDomains, security verification, partial trust, strong type safety
    • So, why not use .NET instead?
      • .NET 3.5 is large, nearly 200MB
      • Not everywhere yet
  • .NET Architecture
    • supports many scenarios
  • Applying the RIA Scenario
    • CoreCLR will focus on fewer scenarios
    • Goal: Build CoreCLR/CLR from same code
    • The RIA scenario
      • Only considers end-user code as partial trust
      • Don’t need all interop features
      • Versioning model can be simpler
      • CoreCLR will be activated through a host
  • Silverlight Architecture
    • fewer scenarios, keep the essentials
    • From the previous CLR slide, now missing NGEN and profiling
    • CoreCLR reduced to around 2MB
  • Slimming down the Desktop CLR
    • The Small Base Class Library
      • CoreCLR includes a subset of the BCL called Small BCL
      • Built from same source as BCL
      • Some features of BCL become more prominent (e.g. IsolatedStorage – better enforcement of quota mgmt)
      • Other parts of Silverlight not part of CoreCLR: agcore.dll (presentation layer), npctrl.dll (Silverlight host)
      • Files
        • coreclr.dll – JIT and other runtime components
        • mscorlib.dll
        • mscorrc.dll
        • System.dll
        • System.Core.dll
        • System.Net.dll
        • System.RuntimeSerialization.dll
        • System.ServiceModel.dll
        • System.ServiceModel.Web.dll
        • System.XML.dll
    • The Core CLR Security Model
      • Code running atop Silverlight is sandboxed
      • Silverlight assemblies are trusted through the CoreCLR hosting API’s
      • SecurityCritical Code – doing things that are fully trusted, or trust anyone that calls you
      • SafeCritical code – plays the bridge, should always validate inputs
      • Transparent Code – lives outside of Silverlight framework, can call any other Transparent code or SafeCritical code
    • Transparent Libraries (14:42)
      • Desktop framework has other libraries lke LINQ and DLR
      • these are delivered as transparent libraries included in the application download
      • Additional UI controls from Silverlight SDK are also transparent libraries
    • Other CLR Features (15:33)
      • CoreCLR is tuned for interactive applications
      • Slimming down by removing options
        • JIT – minimally optimized code to improve start-up time
        • Garbage Collection – only interactive client mode
          • although 2 different ones for regular framework
        • Reflection – no support for modules
      • Rely on underlying system
        • Globablization – string tables supplied by Windows of MacOS
          • learning being taken to next desktop framework version
  • New Features for Core CLR (17:11)
    • Side by Side
      • CoreCLR and CLR need to co-exist
        • CoreCLR focuses on RIA scenarios
        • CLR still supports multiple scenarios
        • Need to be able to load both into same process, and this comes up occassionally, like during exceptions
      • Silverlight does not need CLR installed
    • Cross Platform Support
      • Silverlight is largely built atop CoreCLR
        • supporting new platforms is simpler
      • CoreCLR is one code page
        • additional O/S supported with a PAL
        • refer to writings on Rotor to see how this is built into CLR principles
        • Helpful that this is all bases on x86
  • Future Investments (18:56)
    • Features coming back to desktop in CLR4
      • in-process SxS support
      • Simplified security model (much better than CAS)
    • CoreCLR will focus on feature parity with desktop CLR
      • exposing profiling API’s
      • investing in code quality and performance
    • It’s not just about Silverlight
  • Resources (20:17)