silverlight 2 coreclr andrew pardoe program manager clr execution engine [email protected]

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

Upload: madeline-jackson

Post on 01-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

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

Silverlight 2 CoreCLR

Andrew Pardoe

Program Manager

CLR Execution Engine

[email protected]

Page 2: 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

Page 3: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 4: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 5: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 6: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

Designers

Designers and developers are different.

Page 7: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

Developers

Developers work from the inside outward.

Page 8: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

Getting started

Page 9: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 10: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

From XAML to Silverlight

Page 11: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

From XAML to Silverlight

Page 12: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

.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?

Page 13: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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?

Page 14: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

Overview of Silverlight 2

Browser hosts through ActiveX

Presentation Core

UI CoreJS

Interop

Inputs, Controls,Media, DRM

CoreCLR

BCL

DLR

Page 15: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 16: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 17: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 18: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

Not just C# and VB (C++/CLI, F#)AdaCobolEiffelForthFortranNemerleLispPerlPascalmany more

Program in any .NET language

Page 19: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

All statically compiled

Page 20: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 21: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

DLR Console

DEMO

Page 22: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 23: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 24: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 25: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 26: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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?

Page 27: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

CoreCLR and CLR side-by-side

DEMO

Page 28: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

Native code generation

Same JIT on Mac and WindowsNo NGen in Silverlight 2

Page 29: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 30: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 31: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 32: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 33: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

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

Page 34: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

Woodgrove Financial

DEMO

Page 35: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

Chess: Javascriptvs. CoreCLR

DEMO

Page 36: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

Questions?

Q&A

Page 38: Silverlight 2 CoreCLR Andrew Pardoe Program Manager CLR Execution Engine Andrew.Pardoe@microsoft.com

© 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.