Bay NET Aug 19 2009 presentation ppt
-
Upload
art-scott -
Category
Technology
-
view
836 -
download
2
description
Transcript of Bay NET Aug 19 2009 presentation ppt
How F#, Many/Multi-How F#, Many/Multi-Core, Core, andand, ,
Parallel Parallel and and Concurrent Concurrent Changed My World Changed My World
or or Learning to have FUN with Learning to have FUN with
F#F#byby
Art ScottArt ScottArtist SemasiographologistArtist Semasiographologist
Bay .NET trailer using Windows Moviemaker
The Multi-Core RevolutionLoop’n Luca Lollapalooza
Loop’n Mix: Luca Bolognese Interview andDjango Reinhardt The World Is Waiting For The Sunrise
The Engelbart Mural... 40th anniversary celebrations of Douglas C. Engelbart's "Mother of All Demos", ... traces the evolution of culture and technology from 1925 to present, from the perspective of the life of Doug Engelbart, inventor of the computer mouse and other technological breakthroughs that changed the world.
http://www.engelbartmural.com/F#
F#F# & Many/Multi-Core & Many/Multi-Core ChallengesChallenges
YouYou Professional -- Work SolutionsProfessional -- Work Solutions Personal -- Home EnjoymentPersonal -- Home Enjoyment
Everyone elseEveryone else SoftwareSoftware
Microsoft, Oracle/Sun, IBM, Google, et alMicrosoft, Oracle/Sun, IBM, Google, et al Systems ProvidersSystems Providers
Devices: DT, Laptop, Palm Top, Mobile, Devices: DT, Laptop, Palm Top, Mobile, Game, etc.Game, etc.
ChipsChips Intel, AMD, IBM, ARM, ...Intel, AMD, IBM, ARM, ...
F#F# & &
Many/Multi-Core Many/Multi-Core OpportunitiesOpportunities
YouYou Professional DevelopmentProfessional Development FUNFUN
1. A (really) quick review of some F#
history,2. a bit more on the
state of the F# art, and
3. a few forward looking F#
observations.
1. A (really) quick review of
some F# history
F#: Influences
F#
Similar core language
Similar objectmodel
F# Roadmap F# Roadmap HistoryHistory
• Improvements to the F# research release
April 2008
Microsoft Research
refresh release
• Broadly improved VS 2008 integration
• Simplifications in language and libraries
Just Released
September 2008 CTP
• Full product-quality release• Fully stable and supported
language• Aligned with future VS releases
2009
Supported Release
2. a bit more on the 2. a bit more on the
state of the state of the F#F# art art
F# ResourcesF# Resources• On the Web:
• http://fsharp.net
• Check for status of Second Editions
The Path to Mastering F#
Topic
Scoping and “let”
Tuples
Pattern Matching
Working with Functions
Sequences, Lists, Options
Records and Unions
Basic Imperative Programming
Basic Objects and Types
The F# Libraries
Advanced Functional/Imperative
Advanced Functional/OO
Language Oriented Programming
Parallel and Asynchronous
F#Succinct, Expressive, Functional
The F# TeamMicrosoft Developer DivisionMicrosoft Researchhttp://www.infoq.com/presentations/F-Sharp-Basics-
Don-Syme
Code!
//F#open Systemlet a = 2Console.WriteLine a
//C#using System;
namespace ConsoleApplication1{ class Program { static int a() { return 2; } static void Main(string[] args) { Console.WriteLine(a);
} }}
More Noise Than Signal!
Pleasure
type Command = Command of (Rover -> unit)
let BreakCommand = Command(fun rover -> rover.Accelerate(-
1.0))
let TurnLeftCommand = Command(fun rover -> rover.Rotate(-
5.0<degs>))
Pain abstract class Command { public virtual void Execute(); } abstract class MarsRoverCommand : Command { protected MarsRover Rover { get; private set; } public MarsRoverCommand(MarsRover rover) { this.Rover = rover; } } class BreakCommand : MarsRoverCommand { public BreakCommand(MarsRover rover) : base(rover) { } public override void Execute() { Rover.Rotate(-5.0); } } class TurnLeftCommand : MarsRoverCommand { public TurnLeftCommand(MarsRover rover) : base(rover) { } public override void Execute() { Rover.Rotate(-5.0); } }
The Path to Mastering F#
Topic
Scoping and “let”
Tuples
Pattern Matching
Working with Functions
Sequences, Lists, Options
Records and Unions
Basic Imperative Programming
Basic Objects and Types
The F# Libraries
Advanced Functional/Imperative
Advanced Functional/OO
Language Oriented Programming
Parallel and Asynchronous
http://fsharpsamples.codeplex.com/
http://nholmes.wordpress.com/2008/02/15/wpf-with-f-not-a-happy-mix/#comment-54
http://through-the-interface.typepad.com/through_the_interface/2009/02/importing-and-pixelizing-images-inside-autocad-using-f.html
F# - An Introduction Under an Application of Quantitative Finance
Christopher J. Barwick
a.k.a. optionsScalper
http://www.jjbresearch.org.acs/blogs/optionsScalper
Affiliated with:
www.ironwake.com
www.syslogicinc.com
http://www.wi-ineta.org
JJB Research
Purpose
To provide a sample perspective on the use of technology in capital markets.
To apply a few common techniques in capital markets to everyday situations.
To use .NET to implement these ideas and in particular to leverage F# as the language for mathematics computation.
FUFUNN
MANY/MULTI-MANY/MULTI-CORECORE
FF##
Parallel Parallel ConcurrentConcurrent
LANGUAGLANGUAGEE
MACHINEMACHINELANGUAGLANGUAGEE
MACHINEMACHINELANGUAGLANGUAGEELANGUAGLANGUAGEE
MACHINEMACHINELANGUAGLANGUAGEE
MACHINEMACHINELANGUAGLANGUAGEE
MACHINEMACHINE
Millennial Hot Millennial Hot TopicTopic
F# & Many/Multi-F# & Many/Multi-CoreCore
Technical & BusinessTechnical & BusinessChallenges & Challenges & OpportunitiesOpportunities
Hubble’s Eye ViewHubble’s Eye ViewElectron’s Eye ViewElectron’s Eye View
MachineMachine
I/O and compute intensive programs
Image oriented access and processing operations are often both compute and I/O intensive.
Nov 17 - 19 PDC09 LA CCNov 17 - 19 PDC09 LA CC
Patterns of Parallel Programming Richard Ciapala, , Ade Miller, ,
Herb Sutter, , Stephen Toub The The transitiontransition from single-core to from single-core to
multi-core technology is multi-core technology is altering altering computing as we know itcomputing as we know it, , enabling increased productivity, enabling increased productivity, powerful energy-efficient powerful energy-efficient performance, and leading-edge performance, and leading-edge advanced …advanced …
Nov 17 - 19 PDC09 LA CCNov 17 - 19 PDC09 LA CC
The State of Parallel Programming Burton Smith Burton Smith Parallel programming has been Parallel programming has been
more difficult than it needs to be, more difficult than it needs to be, perhaps because its tools have been perhaps because its tools have been treated as an “add-on” to serial treated as an “add-on” to serial programming. The objectives of programming. The objectives of composability and productivity …composability and productivity …
Nov 17 - 19 PDC09 LA CCNov 17 - 19 PDC09 LA CC Manycore and the Microsoft .NET Framework Manycore and the Microsoft .NET Framework
4: A Match Made in Microsoft Visual Studio 4: A Match Made in Microsoft Visual Studio 20102010
Stephen ToubStephen Toub The Microsoft .NET Framework 4 and Visual The Microsoft .NET Framework 4 and Visual
Studio 2010 include new technologies for Studio 2010 include new technologies for expressing, debugging, and tuning parallelism expressing, debugging, and tuning parallelism in managed applications. Dive into key areas of in managed applications. Dive into key areas of support, including the new support, including the new System.Threading.Tasks and System.Threading.Tasks and System.Collections.Concurrent namespaces, System.Collections.Concurrent namespaces, cutting-edge concurrency views in the Visual cutting-edge concurrency views in the Visual Studio profiler, and debugger tool windows for Studio profiler, and debugger tool windows for analyzing the state of concurrent code.analyzing the state of concurrent code.
Effective Concurrency: Design for Effective Concurrency: Design for Manycore SystemsManycore Systems
August 11August 11, 2009 by Herb Sutter , 2009 by Herb Sutter
Why worry about “manycore” Why worry about “manycore” todaytoday??
……building a typical mainstream application right building a typical mainstream application right now? …, "many-core" systems still feel fairly now? …, "many-core" systems still feel fairly remote, not an immediate issue to think about as remote, not an immediate issue to think about as developers are working on their current product.developers are working on their current product.
… … why it’s time right now for most of us to think why it’s time right now for most of us to think about systems with lots of cores. about systems with lots of cores.
In short: In short: SoftwareSoftware is the (only) is the (only) gating factorgating factor; as that gate falls, ; as that gate falls, hardware parallelism is coming more hardware parallelism is coming more and sooner than many people yet and sooner than many people yet believe. …believe. …
The Problem with Threads, Edward A. Lee
Intel, for example, has embarked on an active campaign to get leading computer science academic programs to put more emphasis on multi-threaded programming.
If they are successful, and the next generation of programmers makes more intensive use of multithreading, then the next generation of computers will become nearly
unusable. EECS Department, University of California, BerkeleyTechnical Report No. UCB/EECS-2006-1, January 10,
2006http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-1.pdfThreads are a seemingly straightforward adaptation of the dominant sequential model of computation to concurrent systems. Languages require little or no syntactic changes to support threads, and operating systems and architectures have evolved to efficiently support them.
F# Async/Parallel
In Praise of Immutability
• Immutable objects can be relied upon
• Immutable objects can transfer between threads
• Immutable objects can be aliased safely
• Immutable objects lead to (different) optimization opportunities
The Solution
• Good Architecture• Know your techniques• Know your requirements• Know your limits (CPU, disk, network, latency)
• Translate Good Architecture into Good Code with F#• A great platform• A massive increase in isolation and immutability• A massive reduction in mutation
In parallel programming,
F# is a power tool
for good architects and good developers
Immutability the norm…
Values may not be
changed
Data is immutable by
default
Not Mutate
Copy & Update
An Introduction To Microsoft F#
Luca BolognesePrincipal Languages PMMicrosoft Corporation
TL11
Luca Bolognese’s Blog
All functional languages are enjoying a renaissance of sort (Erlang anyone?).
A strong reason is the multicore revolutionrevolution that is upon us.
Functional languages, with their lack of side effects, are good for parallelization.
Also, with LINQ we brought functional concepts in a mainstream programming language. We made them a bit more familiar to people.
When you put all these things together you get a lollapalooza effect.
• Sunday, November 09, 2008 9:33 AM by lucabol
The F# language
Tomáš PetříčekMicrosoft C# MVP
http://www.tomasp.net
Why inventing another language?
• Programs today are hard to parallelize– Using threads leads to nondeterministic behavior
• Some ideas are difficult to express– Declarative programming is easier to understand
• In OOP you can easily write reusable type– But writing reusable function/algorithm isn’t that simple
• Sometimes you need to target multiple “runtimes”– For example CLR, SQL and JavaScript hosted in browser– In F# it is possible to “compile” F# code to other languages
F#F# F# - SuccinctF# - Succinct
F# - F# -
ExpressiveExpressive F# - Efficient F# - Efficient F# - Functional Programming F# - Functional Programming
for .NET for .NET
LANGUAGELANGUAGE
MACHINEMACHINE
My focusMy focusOpportunity, the EYES Opportunity, the EYES
have ithave it6.3 B Couch Potatoes = 12.6 B 6.3 B Couch Potatoes = 12.6 B
EyesEyes
MadAve – home of world class MadAve – home of world class SemasiographologistsSemasiographologists
CaT: Creativity and Technology CaT: Creativity and Technology
diverse group of thinkers and diverse group of thinkers and doers pushing boundaries in doers pushing boundaries in
the digital realmthe digital realm
http://creativity-online.com/news/were-coming-europe-cat-london-on-november-19/138096
adPredict Eye Catching
Current Top 10 1.World Wildlife Fund (7) 2.Batman (6.8) 3.Coca-Cola (6.8) 4.Nike Classic (6.8) 5.BMW (6.8)
The SIGGRAPH Art ShowSince the earliest SIGGRAPH conferences, an essential part of our community has been those artists and researchers who use the computer as part of their creative process.
International International Computer Art Computer Art
ForumForum
John Whitney Sr.John Whitney Sr.
Duane PalykaDuane Palyka StrokeDanceStrokeDance
use my software to “jam” with dancers and actors in the same way as musicians do—in a creative performance setting.
Alvy Ray SmithAlvy Ray Smith
Norman Courtney - Glass Art Norman Courtney - Glass Art Nagare (Flow)Nagare (Flow), 1998, cast , 1998, cast glass public artwork is in the Centennial Center lobby, glass public artwork is in the Centennial Center lobby, Kent, WA. It features a Kent, WA. It features a "parquet deformation""parquet deformation" of tiles of tiles that change horizontally ever so slightly while that change horizontally ever so slightly while maintaining perfect fit - a melody of crystalline music. maintaining perfect fit - a melody of crystalline music. Alvy supplied the geometry for this piece.Alvy supplied the geometry for this piece.
Computer Graphics and Computer Graphics and Geometric Ornamental DesignGeometric Ornamental Design
Craig S. Kaplan. PhD thesis, 2002Craig S. Kaplan. PhD thesis, 2002
InfluencesInfluences
Stan Brakhage , manyStan Brakhage , many Ricky Leacock, Woodstock w/ D.A. Ricky Leacock, Woodstock w/ D.A.
PennebakerPennebaker Steve Coons, Ivan Sutherland’s Steve Coons, Ivan Sutherland’s
dissertation advisordissertation advisor MC Escher, Walt Disney, ...MC Escher, Walt Disney, ...
LANGUAGELANGUAGE
SemasiographicSemasiographic writing represents “meanings”writing represents “meanings” semasiographic systems are independent semasiographic systems are independent
graphic languages not tied to any one graphic languages not tied to any one spoken languagespoken language
GlottographicGlottographic writing represents “sounds” writing represents “sounds” glottographic systems use visible marks to glottographic systems use visible marks to
represent elements of a specific spoken represent elements of a specific spoken languagelanguage
MachineMachine
LANGUAGELANGUAGE
MACHINEMACHINE
FUNCTIONALFUNCTIONAL
MANY/MULTI-COREMANY/MULTI-CORE
"... As with the invention of writing (or even "... As with the invention of writing (or even language) itself, the language) itself, the deep integration of deep integration of motion pictures and computationmotion pictures and computation will bring will bring about entirely new possibilities for human about entirely new possibilities for human expression and communication. ...“expression and communication. ...“
Today we are constantly reading images and image Today we are constantly reading images and image sequences, but we write very little. Future computational sequences, but we write very little. Future computational semasiographicsemasiographic technology has the possibility of technology has the possibility of initiating a initiating a revolutionrevolution in the development of in the development of semasiographicsemasiographic writing systems by making it far easier writing systems by making it far easier to write to write semasiographicsemasiographic motion pictures. motion pictures.
see ref. :see ref. :http://slcreativity.org/wiki/index.php?http://slcreativity.org/wiki/index.php?title=Garage_cinema_and_the_future_media_technology_by_title=Garage_cinema_and_the_future_media_technology_by_Marc_DavisMarc_Davis
The first two levels of Geoffrey The first two levels of Geoffrey Sampson’s taxonomy of writing Sampson’s taxonomy of writing systems divides writing systems divides writing systems into systems into semasiographicsemasiographic which represents “which represents “meaningsmeanings” ” (from the Greek semasi (from the Greek semasi “meaning”), and glottographic “meaning”), and glottographic which represents “sounds” which represents “sounds” (from the Greek glotto “tongue” (from the Greek glotto “tongue” or “language”).or “language”).
Current video editing technology Current video editing technology is like word processing with is like word processing with bitmaps. …bitmaps. …
Just as we often find it hard to Just as we often find it hard to imagine our own civilization imagine our own civilization before the advent of widespread before the advent of widespread literacy in the 17th and 18th literacy in the 17th and 18th centuries, in the next century our centuries, in the next century our descendants will find it hard to descendants will find it hard to understand that while everyone understand that while everyone watched movies, videos, and TV, watched movies, videos, and TV, so few had the tools to make so few had the tools to make them. them.
FUNCTIONALFUNCTIONAL
Say WHAT you want to doSay WHAT you want to do Domain Specific LanguagesDomain Specific Languages
LANGUAGELANGUAGE
MACHINEMACHINE
F#F#
PARALLEL PARALLEL CONCURRENTCONCURRENT
The development of a The development of a computational computational semasiographic writing semasiographic writing enabling us to use enabling us to use computational videocomputational video as a as a mother tongue.mother tongue.
How can video be used functionally, How can video be used functionally, how can we program it and program how can we program it and program with it? How can we use its ability to with it? How can we use its ability to record and construct events in the record and construct events in the world in a way analogous to how world in a way analogous to how computational writing captures computational writing captures processes as objects and uses them to processes as objects and uses them to build new processes? build new processes?
As with the invention of writing (or As with the invention of writing (or even language) itself, the deep even language) itself, the deep integration of motion pictures and integration of motion pictures and computation will bring about entirely computation will bring about entirely new possibilities for human new possibilities for human expression and communication. expression and communication.
ALTHOUGH WE ARE LIVING IN THE ALTHOUGH WE ARE LIVING IN THE “COMPUTER AGE,” THE FULL “COMPUTER AGE,” THE FULL IMPLICATIONS of computational ideas have IMPLICATIONS of computational ideas have not been realized in our century. We are at the not been realized in our century. We are at the early apparatus phase of computational early apparatus phase of computational development—the profound ideas of development—the profound ideas of computation have not yet affected all other computation have not yet affected all other fields of human inquiry, fields of human inquiry, especially our especially our thinking about mediathinking about media. As computational . As computational ideas transform our thinking about media, new ideas transform our thinking about media, new apparatuses and new ideas will emerge that apparatuses and new ideas will emerge that will change our relationships to media and to will change our relationships to media and to each other. The ways we create, communicate, each other. The ways we create, communicate, and play will become computationally and play will become computationally revisioned, transforming us in the process.revisioned, transforming us in the process.
F#F# High signal to noiseHigh signal to noise Don Syme's WebLog on the F# Language and Related Don Syme's WebLog on the F# Language and Related
TopicsTopics An Introduction to Microsoft F# | pdc2008 | Channel 9An Introduction to Microsoft F# | pdc2008 | Channel 9 ““let” #1, “|>” #2 -- now you know 2/3 of let” #1, “|>” #2 -- now you know 2/3 of
F#F# ““fun” #3 -- 3 keywords -- 90% of your codefun” #3 -- 3 keywords -- 90% of your code First Class .NET Language as of VS 2010First Class .NET Language as of VS 2010 Multi-Paradigm = pragmatic:Multi-Paradigm = pragmatic:
FUNctionalFUNctional Object OrientedObject Oriented ImperativeImperative
3. and a few forward looking3. and a few forward looking
F#F# observations observations
F# Roadmap TodayF# Roadmap Today• CodeCast Episode 32:
Roadmap for VB, C#, and F# with Luca Bolognese
Friday, July 17, 2009
• VS 2010• additional library functions (e.g.
Array.Parallel.map) available with .NET 4.0/Visual Studio 2010 Beta1
VS2010 Almost
Released
Soon
• PDC09 LA CC• Co-Evolution• AXUM, ... Stay tuned
2010, 2011 and Beyond
??
Interview
Don Syme BlogDon Syme Blog
custom numeric type literals, ... custom numeric type literals, ... interoperate nicely interoperate nicely with the BigInteger type on .NET 4.0with the BigInteger type on .NET 4.0, ,
... improved aspects of .NET interoperability ... ... improved aspects of .NET interoperability ... smoother calling of .NET param array methodssmoother calling of .NET param array methods. .
... support for ... support for units-of-measureunits-of-measure with integer types, with integer types, e.g. to qualify integer types by annotations such as e.g. to qualify integer types by annotations such as <Pixels> or <Clicks>. <Pixels> or <Clicks>.
focusing on the focusing on the performance of F# language performance of F# language constructsconstructs ... ... performance improvements to F# performance improvements to F# sequence expressionssequence expressions, …, …
F# classes have compact representationsF# classes have compact representations, and that , and that some other constructs such as F# members taking some other constructs such as F# members taking arguments in curried form are compiled more arguments in curried form are compiled more efficiently. ... detail in the detailed release notes.efficiently. ... detail in the detailed release notes.
The Co-Evolution The Co-Evolution Roadmap Roadmap
for VB, C#, and F# for VB, C#, and F# with Luca Bolognesewith Luca Bolognese
Friday, July 17, 2009 Friday, July 17, 2009 CodeCast Episode 32: CodeCast Episode 32:
... in the guest interview, ... Luca Bolognese ... in the guest interview, ... Luca Bolognese who is the group program manager at who is the group program manager at Microsoft on the Visual Studio languages Microsoft on the Visual Studio languages team. Luca talks about the roadmap for team. Luca talks about the roadmap for co-co-evolutionevolution of VB, C# -- and, F# (@34:50) of VB, C# -- and, F# (@34:50) languages beyond Visual Studio 2010.languages beyond Visual Studio 2010.
F#F# Co-Evolution Co-Evolution ROADMAPROADMAP
F#F# .NET 4.NET 4 WPFWPF
DX, XNADX, XNA Silverlight, Expression, XAMLSilverlight, Expression, XAML Azure, LINQ, PLINQAzure, LINQ, PLINQ AXUMAXUM
MSDN Parallel MSDN Parallel Computing Developer Computing Developer
CenterCenter
Hello Axumites!Hello Axumites! ... Awesome ... Awesome
Microsoft ResearchMicrosoft Research
Dryad/DryadLINQ and Project Dryad/DryadLINQ and Project Trident Released Trident Released
There has been a lot of talk going around There has been a lot of talk going around involving the Microsoft Worldwide involving the Microsoft Worldwide Partner Conference 2009, but another Partner Conference 2009, but another event, largely overshadowed, was the event, largely overshadowed, was the 10th annual Microsoft Research Faculty 10th annual Microsoft Research Faculty Summit. two tools to help transform Summit. two tools to help transform research in the academic world, Project research in the academic world, Project Trident and Dryad with DryadLINQ,Trident and Dryad with DryadLINQ,
PARALLEL PARALLEL CONCURRENTCONCURRENT
Today’s challengeToday’s challengeHow we think about:How we think about:
The siliconThe siliconThe softwareThe softwareThe applicationsThe applications
byby
Art ScottArt ScottArtist Artist
SemasiographologistSemasiographologist
FUFUNN
MANY/MULTI-MANY/MULTI-CORECORE
FF##
Parallel Parallel ConcurrentConcurrent
LANGUAGLANGUAGEE
MACHINEMACHINELANGUAGLANGUAGEE
MACHINEMACHINELANGUAGLANGUAGEELANGUAGLANGUAGEE
MACHINEMACHINELANGUAGLANGUAGEE
MACHINEMACHINELANGUAGLANGUAGEE
MACHINEMACHINE
AcknowledgementsAcknowledgements
Dr. Don Syme – The Don of F#Dr. Don Syme – The Don of F# Dr. Jon Harrop – F# Tilings ArticleDr. Jon Harrop – F# Tilings Article
http://www.ffconsultancy.com/products/http://www.ffconsultancy.com/products/fsharp_journal/fsharp_journal/
Robert Pickering, and other F# authorsRobert Pickering, and other F# authors All the F# Web Sites and their authorsAll the F# Web Sites and their authors All revisions and errors are obviously All revisions and errors are obviously
mine alone.mine alone.
Thank you for coming. Thank you for coming.
Have Have F#F#UN!UN! Contact meContact me
““art(( at )) semasiographic.com” – art(( at )) semasiographic.com” – New.New.
““art_scott (( at )) msn.com” – Long art_scott (( at )) msn.com” – Long time.time.
http://semasiographic.blogspot.com/ http://semasiographic.blogspot.com/ http://tesselate.spaces.live.com/blog/ http://tesselate.spaces.live.com/blog/