.NET Programming Language PragmaticsAndrew PetersMindscape
DEV321
AgendaThe .NET Language EcosystemLanguage Design SpectrumsA Tour of Language FeaturesInteroperabilityDriving 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 …
.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
.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
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
Language Spectrums Safe vs. Useful
Unsafe Safe
Useful
Not Useful
C#, C++, … V.Next#
Haskell
Language Spectrums Static to Dynamic
Static (C#, Java)
Dynamic (Python)
Functional (F#,
Haskell)
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
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
F#
demo
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
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
IronPythonIronRuby
demo
.NET Language EcosystemCLR Refresher
Common Type system
Class Loader, GC, JIT, Execution Support
Security
Base Class Libraries
Common Language Runtime
C# VB.NET …
.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
Language Spectrums Static to Dynamic: Hybrid languages
Static
DynamicFunctional
Language Spectrums Safe vs. Useful
Unsafe Safe
Useful
Not Useful
C#, C++, …
Haskell
STMLINQ
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!
VB 9
demo
VB X
Joel Pobar
demo
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
Resourceshttp://research.microsoft.com/~emeijer/http://www.iunknown.com/http://blogs.msdn.com/joelpob/http://research.microsoft.com/fsharp/fsharp.aspxhttp://www.ironpython.com/
Evaluation Forms
Questions?
© 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.