silverlight 2 coreclr andrew pardoe program manager clr execution engine andrew.pardoe@microsoft.com
Post on 01-Jan-2016
215 Views
Preview:
TRANSCRIPT
Silverlight 2 CoreCLR
Andrew Pardoe
Program Manager
CLR Execution Engine
Andrew.Pardoe@microsoft.com
Why Silverlight?
Rich interactive applicationsWeb deployment gives broad reach
Windows, Mac OS X, LinuxIE, Firefox, Safari, Konquerer
Sandboxing provides security
Productive design and developmentReusable knowledge (XAML & .NET)Best developer tools in the industrySeparate design and development
Non-Windows platforms
Mac OS X 10.4+Silverlight 1.0 supports all hardwareSilverlight 2 supports Intel MacMac is fully supported by Microsoft
Major Linux distributionsMoonlight runtime implemented by MonoFull cooperation of Microsoft
Access to documentation and testsLegal covenant protecting Mono users
Silverlight security
Sandboxed applicationsNo user elevation or security prompts within the browser—just click a URLApplications prevented from doing malicious things
Limited local interactionSafe isolated storageClient based file upload controlsCross domain networking support
Code-behind
Silverlight “code-behind” modelCode lives behind the pageUpdating the code doesn’t change the design
Productive design and developmentReusable knowledge (XAML & .NET)Best developer tools in the industrySeparate design and development
Designers
Designers and developers are different.
Developers
Developers work from the inside outward.
Getting started
What you need
Silverlight 2 Beta 1
NotepadNo SDK required, everything is text
A better option…Silverlight Tools for Visual Studio 2008Expression Blend 2.5 March Preview
Everything you need is onlinehttp://www.silverlight.net
From XAML to Silverlight
From XAML to Silverlight
.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 languagesSL2 DLR adds popular dynamic languages like IronPython and IronRuby
Why CoreCLR?
CoreCLR builds from same source code as the desktop CLR
100% compatible execution environment
Much smaller package4.3 MB download for SL2 Beta 1
What’s different in CoreCLR? We’ll look at the desktop CLR and compare it to CoreCLR
Why CoreCLR?
Overview of Silverlight 2
Browser hosts through ActiveX
Presentation Core
UI CoreJS
Interop
Inputs, Controls,Media, DRM
CoreCLR
BCL
DLR
The CLR is simple, right?
MSIL + Metadata
Write a program in .NETC# source
Runs with Base Class Library
Running code loads the CLR EE
Managed protected environment
Compile to MSIL executable
Layout objects in memory
JIT produces native code
VM & GC
Code + .NET
What's different in CoreCLR?
Small size allows on-demand installFewer scenarios than desktop CLR
Sandboxed codeSmaller Base Class LibraryOnly hosted by ActiveX controls
Supported on Intel Apple Mac OS X
What's the same?
Dynamic Language RuntimeExecution engine
JIT compilerGarbage collectorVirtual machine
New security modelSecurity Transparency replaces Code Access Security
Transparency may be supported in desktop
Not just C# and VB (C++/CLI, F#)AdaCobolEiffelForthFortranNemerleLispPerlPascalmany more
Program in any .NET language
All statically compiled
DLR adds popular web languagesDLR creates MSIL at runtimeBuilt on a message-passing system
Objects respond to messagesBehavior based on language semanticsMessages converted to MSIL
Built on dynamic method dispatch and dynamic type system
Messages are bound to methodsDynamic types are CLR types
Dynamic Languages
DLR Console
DEMO
Local file system access
OpenFileDialog for read-only local file system accessIsolatedStorageFile provides storage
Define the scope with a using directive Exiting scope disposes file objects
Simplified Base Class Library
Web-hosting reduces scenariosClick-time install reduces sizeSimplified BCL is based on .NET CF
Non-generic collections removedLocalization culture information from OSBackgroundWorker for most threading
See BCL team blog for more detailsGuidance available to help port existing .NET code to Silverlight’s smaller BCL
Objects, versioning and binding
Versioning and binding are transparentActiveX host loads CoreCLR, creates appdomain and applies policiesFull access to XAML and HTML DOMs
XAML can be written dynamicallyJavascript objects and DOM elements wrapped in managed wrappers
Appdomains and processes
SL 2 app in separate browser
SL 1.0: XAML and Javascript
Different browsergets new CoreCLR
SL 2 with shared
CoreCLR
Another SL 2 app shares same CoreCLR
Browser tabs share a single CoreCLR
You need a CLR to run managed codeCould use the CLR on Windows……but changing code changes behaviorCoreCLR runs in-process with CLR
Managed browsers can host SLMultiple CoreCLRs in-process100% Silverlight compatibility no matter what CLR is already on your machine
Which CLR runs my code?
CoreCLR and CLR side-by-side
DEMO
Native code generation
Same JIT on Mac and WindowsNo NGen in Silverlight 2
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)
Windows(32-bit)
Platform Adaptation
Layer
Execution engine is the same
Same execution engine as CLRCore functionality: JIT, GCVirtual machine: EH, threading
Simplified security modelCAS is gone!Transparent, Safe Critical and Critical
All user code is transparent
Security Transparency Model
No more evidence, permissions, policy levels or code groupsNo more complicated documentationNo 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 codeIf it’s Safe Critical or Transparent security
Security Transparency exampleWINAPI
CreateFile (Critical code)
creates file without any validation
User code(transparent)wants to write
a file
System.IO.IsolatedStorageFile StreamWriter
(SafeCritical code)verifies the request and calls
Windows API
Silverlight is simple, right?
MSIL + Metadata
Use same .NET skillsC# source
Web has simpler scenarios
Code uses smaller BCL
Same CLR means no surprises
DLR adds new languages
Same CoreCLR on any host
Security Transparency is easy
VM & GC
Code + .NET
Woodgrove Financial
DEMO
Chess: Javascriptvs. CoreCLR
DEMO
Questions?
Q&A
Shawn Farkas’ blog on CLR securityhttp://blogs.msdn.com/shawnfa
Silverlight – Get Startedhttp://silverlight.net/GetStarted
BCL team bloghttp://blogs.msdn.com/bclteam
Resources
Where to find these slideshttp://blogs.msdn.com/apardoe
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
top related