際際滷

際際滷Share a Scribd company logo
温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙
Presentation Agenda
1. Motivation&history

2. FeaturesofF#language

3. Abilitiesoffunctionalprogramming

4. F#codeexamples

              F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙  RadekM鱈ka   2
What is F# About?
 NewfunctionallanguagefromMicrosoft

 WhyisMicrosoftinvestinginfunctional
  programming?




                F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙  RadekM鱈ka   3
What is F# About?
 NewfunctionallanguagefromMicrosoft

 WhyisMicrosoftinvestinginfunctional
  programming?
     Powerfullanguage
     Simplicity
     Programmersproductivity
     Scalability

                  F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙  RadekM鱈ka   4
What is F# About?
 F#ismultiparadigm.NETlanguage
   Functional programming
   Objectorientedprogramming
   Imperativeprogramming

   .NET>builtonCLI

   Staticallytypedlanguage

                 F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙  RadekM鱈ka   5
About History
 Projectsince2002atMicrosoftResearch

 January2008 firstCTP

 FullsupportinVisualStudio2010




                F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙  RadekM鱈ka   6
Functional Programming
 SAYINGWHATRATHERTHANHOW
   how=imperativeway
   what=declarativeway(betterreadable)


 Immutability

 Parallel&async.programming(scalability)

                 F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙  RadekM鱈ka   7
Functional Languages
 Expressiblelanguages
 Butwhy?
     Easytesting
     Scalability
     Processinglargesetsofdata
     Effectiveness


 F#,C#,Haskel,Erlang,Scala,Lisp
                   F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙  RadekM鱈ka   8
Code
//F#                            //C#
open System                     using System;
let a = 2
                                namespace ConsoleApplication1
Console.WriteLine a
                                {
                                  class Program
                                  {
                                    static int a()
                                    {
                                        return 2;
                                    }
                                    static void Main(string[] args)
                                    {
                                        Console.WriteLine(a);
                                    }
       MoreNoise                }
       ThanSignal!             }

                      F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙  RadekM鱈ka   9
酷#油永鉛艶温壊顎姻艶                                                C#Pain
                                                           abstractclassCommand
typeCommand=Commandof(Rover>unit)                  {
                                                               publicvirtualvoidExecute();
                                                           }
letBreakCommand     =                                    abstractclassMarsRoverCommand :Command
    Command(funrover>rover.Accelerate(1.0))           {
                                                               protectedMarsRover Rover{get;priv
letTurnLeftCommand =
    Command(funrover>rover.Rotate(5.0<degs>))               publicMarsRoverCommand(MarsRover rov
                                                                 {
                                                                     this.Rover =rover;
                                                                 }
                                                           }
                                                           classBreakCommand :MarsRoverCommand
                                                           {
                                                               publicBreakCommand(MarsRover rover)
                                                                   :base(rover)
                                                               {
                                                               }
                                                               publicoverridevoidExecute()
                                                               {
                                                                   Rover.Rotate(5.0);
                                                               }
                                                           }
                                                          classTurnLeftCommand :MarsRoverCommand
                                                           {
                              F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙  RadekM鱈ka                      10
Summary
 F#ismultiparadigmlanguage,mainlyfunctional

      Powerful
      Flexiblesyntax
      Shorter&elegantcode
      Increaseproductivity
      Parallel&async.programming= extremelyeasy




                     F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙  RadekM鱈ka   11
Sources
                             http://www.fsharp.net




   RealWorldFunctionalProgramming                  ProgrammingF#(ChrisSmith)
    (TomasPetricek,JohnSkeet)



                             F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙  RadekM鱈ka                 12
Questions


 F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙  RadekM鱈ka   13
The End


 RadekM鱈ka
 radek@radekmika.cz

More Related Content

Microsoft F# and functional programming

  • 2. Presentation Agenda 1. Motivation&history 2. FeaturesofF#language 3. Abilitiesoffunctionalprogramming 4. F#codeexamples F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙 RadekM鱈ka 2
  • 3. What is F# About? NewfunctionallanguagefromMicrosoft WhyisMicrosoftinvestinginfunctional programming? F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙 RadekM鱈ka 3
  • 4. What is F# About? NewfunctionallanguagefromMicrosoft WhyisMicrosoftinvestinginfunctional programming? Powerfullanguage Simplicity Programmersproductivity Scalability F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙 RadekM鱈ka 4
  • 5. What is F# About? F#ismultiparadigm.NETlanguage Functional programming Objectorientedprogramming Imperativeprogramming .NET>builtonCLI Staticallytypedlanguage F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙 RadekM鱈ka 5
  • 6. About History Projectsince2002atMicrosoftResearch January2008 firstCTP FullsupportinVisualStudio2010 F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙 RadekM鱈ka 6
  • 7. Functional Programming SAYINGWHATRATHERTHANHOW how=imperativeway what=declarativeway(betterreadable) Immutability Parallel&async.programming(scalability) F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙 RadekM鱈ka 7
  • 8. Functional Languages Expressiblelanguages Butwhy? Easytesting Scalability Processinglargesetsofdata Effectiveness F#,C#,Haskel,Erlang,Scala,Lisp F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙 RadekM鱈ka 8
  • 9. Code //F# //C# open System using System; let a = 2 namespace ConsoleApplication1 Console.WriteLine a { class Program { static int a() { return 2; } static void Main(string[] args) { Console.WriteLine(a); } MoreNoise } ThanSignal! } F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙 RadekM鱈ka 9
  • 10. 酷#油永鉛艶温壊顎姻艶 C#Pain abstractclassCommand typeCommand=Commandof(Rover>unit) { publicvirtualvoidExecute(); } letBreakCommand = abstractclassMarsRoverCommand :Command Command(funrover>rover.Accelerate(1.0)) { protectedMarsRover Rover{get;priv letTurnLeftCommand = Command(funrover>rover.Rotate(5.0<degs>)) publicMarsRoverCommand(MarsRover rov { this.Rover =rover; } } classBreakCommand :MarsRoverCommand { publicBreakCommand(MarsRover rover) :base(rover) { } publicoverridevoidExecute() { Rover.Rotate(5.0); } } classTurnLeftCommand :MarsRoverCommand { F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙 RadekM鱈ka 10
  • 11. Summary F#ismultiparadigmlanguage,mainlyfunctional Powerful Flexiblesyntax Shorter&elegantcode Increaseproductivity Parallel&async.programming= extremelyeasy F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙 RadekM鱈ka 11
  • 12. Sources http://www.fsharp.net RealWorldFunctionalProgramming ProgrammingF#(ChrisSmith) (TomasPetricek,JohnSkeet) F#温稼糸油韓顎稼界岳庄看稼温鉛油沿姻看乙姻温馨馨庄稼乙 RadekM鱈ka 12
  • 14. The End RadekM鱈ka radek@radekmika.cz