1 / 38

Silverlight 2 CoreCLR

Silverlight 2 CoreCLR. Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com. Why Silverlight?. Rich interactive applications Web deployment gives broad reach Windows, Mac OS X, Linux IE, Firefox, Safari, Konquerer Sandboxing provides security

lanai
Download Presentation

Silverlight 2 CoreCLR

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

  2. Why Silverlight? • Rich interactive applications • Web deployment gives broad reach • Windows, Mac OS X, Linux • IE, Firefox, Safari, Konquerer • Sandboxing provides security • Productive design and development • Reusable knowledge (XAML & .NET) • Best developer tools in the industry • Separate design and development

  3. Non-Windows platforms • Mac OS X 10.4+ • Silverlight 1.0 supports all hardware • Silverlight 2 supports Intel Mac • Mac is fully supported by Microsoft • Major Linux distributions • Moonlight runtime implemented by Mono • Full cooperation of Microsoft • Access to documentation and tests • Legal covenant protecting Mono users

  4. Silverlight security • Sandboxed applications • No user elevation or security prompts within the browser—just click a URL • Applications prevented from doing malicious things • Limited local interaction • Safe isolated storage • Client based file upload controls • Cross domain networking support

  5. Code-behind • Silverlight “code-behind” model • Code lives behind the page • Updating the code doesn’t change the design • Productive design and development • Reusable knowledge (XAML & .NET) • Best developer tools in the industry • Separate design and development

  6. Designers Designers and developers are different.

  7. Developers Developers work from the inside outward.

  8. Getting started

  9. What you need • Silverlight 2 Beta 1 • Notepad • No SDK required, everything is text • A better option… • Silverlight Tools for Visual Studio 2008 • Expression Blend 2.5 March Preview • Everything you need is online • http://www.silverlight.net

  10. From XAML to Silverlight

  11. From XAML to Silverlight

  12. Why CoreCLR? • .NET is a desktop technology. Why use it on the web? • Developers, developers, developers! • Performance and expressiveness • Silverlight lets you use what you already know • C#, VB, JScript—Silverlight CoreCLR supports all .NET languages • SL2 DLR adds popular dynamic languages like IronPython and IronRuby

  13. Why CoreCLR? • CoreCLR builds from same source code as the desktop CLR • 100% compatible execution environment • Much smaller package • 4.3 MB download for SL2 Beta 1 • What’s different in CoreCLR? • We’ll look at the desktop CLR and compare it to CoreCLR

  14. Overview of Silverlight 2 Browser hosts through ActiveX Presentation Core CoreCLR UI Core JS Interop DLR Inputs, Controls,Media, DRM BCL

  15. The CLR is simple, right? Write a program in .NET C# source Compile to MSIL executable Runs with Base Class Library MSIL + Metadata Running code loads the CLR EE Layout objects in memory Code + .NET JIT produces native code Managed protected environment VM & GC

  16. What's different in CoreCLR? • Small size allows on-demand install • Fewer scenarios than desktop CLR • Sandboxed code • Smaller Base Class Library • Only hosted by ActiveX controls • Supported on Intel Apple Mac OS X

  17. What's the same? • Dynamic Language Runtime • Execution engine • JIT compiler • Garbage collector • Virtual machine • New security model • Security Transparency replaces Code Access Security • Transparency may be supported in desktop

  18. Program in any .NET language • Not just C# and VB (C++/CLI, F#) • Ada • Cobol • Eiffel • Forth • Fortran • Nemerle • Lisp • Perl • Pascal • many more

  19. All statically compiled

  20. Dynamic Languages • DLR adds popular web languages • DLR creates MSIL at runtime • Built on a message-passing system • Objects respond to messages • Behavior based on language semantics • Messages converted to MSIL • Built on dynamic method dispatch and dynamic type system • Messages are bound to methods • Dynamic types are CLR types

  21. demo DLRConsole

  22. Local file system access • OpenFileDialogfor read-only local file system access • IsolatedStorageFile provides storage • Define the scope with a using directive • Exiting scope disposes file objects

  23. Simplified Base Class Library • Web-hosting reduces scenarios • Click-time install reduces size • Simplified BCL is based on .NET CF • Non-generic collections removed • Localization culture information from OS • BackgroundWorkerfor most threading • See BCL team blog for more details • Guidance available to help port existing .NET code to Silverlight’s smaller BCL

  24. Objects, versioning and binding • Versioning and binding are transparent • ActiveX host loads CoreCLR, creates appdomain and applies policies • Full access to XAML and HTML DOMs • XAML can be written dynamically • Javascript objects and DOM elements wrapped in managed wrappers

  25. Appdomains and processes SL 1.0: XAML and Javascript SL 2 with shared CoreCLR SL 2 app in separate browser Another SL2 app shares same CoreCLR Different browser gets new CoreCLR Browser tabs share a single CoreCLR

  26. Which CLR runs my code? • You need a CLR to run managed code • Could use the CLR on Windows… • …but changing code changes behavior • CoreCLR runs in-process with CLR • Managed browsers can host SL • Multiple CoreCLRs in-process • 100% Silverlight compatibility no matter what CLR is already on your machine

  27. demo CoreCLRand CLRside-by-side

  28. Native code generation • Same JIT on Mac and Windows • No NGen in Silverlight 2

  29. Intel Mac support • CoreCLR runs on Mac OS X 10.4+ • Only supported on Intel Macs CoreCLR, Base Class Libraries and other platform assemblies Mac OS X 10.4+(Intel) Platform Adaptation Layer Windows(32-bit)

  30. Execution engine is the same • Same execution engine as CLR • Core functionality: JIT, GC • Virtual machine: EH, threading • Simplified security model • CAS is gone! • Transparent, Safe Critical and Critical • All user code is transparent

  31. Security Transparency Model • No more evidence, permissions, policy levels or code groups • No more complicated documentation • No more stackwalks for code access - • Transparent code can call public methods, use public types and override methods… • If it’s platform or same application’s code • If it’s Safe Critical or Transparent security

  32. Security Transparency example WINAPI CreateFile (Critical code) creates file without any validation User code (transparent) wants to write a file System.IO.IsolatedStorageFileStreamWriter(SafeCritical code) verifies the request and calls Windows API

  33. Silverlight is simple, right? Use same .NET skills C# source DLR adds new languages Web has simpler scenarios MSIL + Metadata Code uses smaller BCL Same CoreCLR on any host Code + .NET Security Transparency is easy Same CLR means no surprises VM & GC

  34. demo Woodgrove Financial

  35. demo Chess: Javascript vs. CoreCLR

  36. Q&A Questions?

  37. Shawn Farkas’ blog on CLR security http://blogs.msdn.com/shawnfa BCL team bloghttp://blogs.msdn.com/bclteam Silverlight – Get Started http://silverlight.net/GetStarted Where to find these slides http://blogs.msdn.com/apardoe Resources

More Related