Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of...

27

description

The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future

Transcript of Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of...

Page 1: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.
Page 2: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

.NET Programming Language PragmaticsAndrew PetersMindscape

DEV321

Page 3: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

AgendaThe .NET Language EcosystemLanguage Design SpectrumsA Tour of Language FeaturesInteroperabilityDriving the Future

Page 4: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

.NET Language EcosystemCLR Refresher

Common Type system

Class Loader, GC, JIT, Execution Support

Security

Base Class Libraries

Common Language Runtime

C# VB.NET …

Page 5: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

.NET Language EcosystemStandards based

ECMA/ISO StandardizedCLR + Parts of the BCL + C# languageUp to the 4th edition

Common Type SystemContract for types and interoperabilityRules for wide reachObject-oriented in flavourFunctional + Dynamic possible

Page 6: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

.NET Language EcosystemMulti-language

Version 1.x (2000-03)Focused on statically typed OO languages (C#, VB.NET, Eiffel, C++)

Version 2.0 (2005) Better support for Functional languages (Generics, faster and relaxed delegates)Enabled support for Dynamic Languages (LCG, better delegate support)

Version 3.x (2008)Dynamic languages (DLR)Flexible type systems

Page 7: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

Language Spectrums Design Pressures

ProductivityLine for line: developer productivity

Application paradigm shifts“Cloud” programmingWeb/Rich Client/User ExperienceUnstructured data

Hardware changesConcurrency and Parallelism

Developer happiness

Page 8: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

Language Spectrums Safe vs. Useful

Unsafe Safe

Useful

Not Useful

C#, C++, … V.Next#

Haskell

Page 9: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

Language Spectrums Static to Dynamic

Static (C#, Java)

Dynamic (Python)

Functional (F#,

Haskell)

Page 10: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

Language Feature TourStatic OO Languages

Statically TypedType system is strictly enforced at compile timeTypically strongly typed (adds runtime checks)

Encapsulation and ReuseVisibilityPolymorphismContracts

Problems & MisconceptionsType safety == safe programComplicated program typesContracts must be known at compile timeCan be verbose

Page 11: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

Language Feature TourFunctional Languages

Generally more “safe”Less (or no) side effects

Mathematical roots Interesting Language Features

Higher-order & first-class functionsLazy evaluationConcurrent

Problems & MisconceptionsPoor AdoptionHard – requires mindset shift

Page 12: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

F#

demo

Page 13: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

Language Feature TourDynamic Languages

Flexible type systemsDynamically typedIndispensable for apps with dynamic behavior

Rapid application developmentREPL (Read Evaluate Print Loop)Focus on domain problem, not code

Adapts well to unstructured dataGreat for the “cloud”

Great extensibility experienceAllow scripting of your apps

Page 14: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

Language Feature TourDynamic Languages

Interesting language featuresFunctions as objectsAd-hoc relationships (mixin’s)Duck typingMeta-programming

Problems & MisconceptionsDelays type checking to runtimeeval() is a poor substituteJury is out on “less bugs” argument

Page 15: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

IronPythonIronRuby

demo

Page 16: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

.NET Language EcosystemCLR Refresher

Common Type system

Class Loader, GC, JIT, Execution Support

Security

Base Class Libraries

Common Language Runtime

C# VB.NET …

Page 17: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

.NET Language EcosystemCLR Refresher

Common Type system

Class Loader, GC, JIT, Execution Support

Security

Base Class Libraries

Common Language Runtime

C# VB.NET IronPython

DLR Runtime

Page 18: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

Language Spectrums Static to Dynamic: Hybrid languages

Static

DynamicFunctional

Page 19: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

Language Spectrums Safe vs. Useful

Unsafe Safe

Useful

Not Useful

C#, C++, …

Haskell

STMLINQ

Page 20: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

Driving the FutureVB.NET 9 and C# 3.0

Leverages features from both Dynamic and Functional languages

The Erik Meijer mantra: “Static typing where possible, dynamic typing when needed”“Looks a lot like”: integrating dynamic features in to a static language like C#Great for three-tier

STM (Software Transactional Memory)LINQ: Don’t consolidate, comprehend!

Page 21: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

VB 9

demo

Page 22: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

VB X

Joel Pobar

demo

Page 23: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

ConclusionWe’re seeing a convergence of dynamic and static approaches.Choose the right tool for the jobLearning different languages makes us better

Call to action: Learn a dynamic language

Page 24: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

Resourceshttp://research.microsoft.com/~emeijer/http://www.iunknown.com/http://blogs.msdn.com/joelpob/http://research.microsoft.com/fsharp/fsharp.aspxhttp://www.ironpython.com/

Page 25: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

Evaluation Forms

Page 26: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

Questions?

Page 27: Andrew Peters Mindscape DEV321 The.NET Language Ecosystem Language Design Spectrums A Tour of Language Features Interoperability Driving the Future.

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