Tech for devs, F#

1,220 views

Published on

Introduction to functional languages and F# for developers. Used for the presentation of the same name to the Vermont Code Camp 2 at the University of Vermont on Sept. 11, 2010 at 12:30 PM.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,220
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
19
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Tech for devs, F#

  1. 1. Tech for Devs:Introduction to F#<br />Rob Rohr<br />12:30 - 1:30<br />Sep 11, 2010<br />Kalkin Hall<br />University of Vermont<br />
  2. 2. Functional Programming<br />Emphasize application of functions over mutation of state (imperative programming style)<br />
  3. 3. Um. Yeah. What?<br />Functional<br />fun inc x => x + 1<br />Imperative<br />x = x + 1<br />
  4. 4. Important differences<br />Academics – especially mathematicians - love functional programming!<br />Type safety through inference<br />Lack of side effects<br />
  5. 5. Heh! What is it good for?<br />Mathematical modeling<br />Programming languages<br /><ul><li>i.e., DSLs</li></ul>List processing<br />Parallel programming<br />Concise code, fewer bugs<br />!(“Absolutely nothing?”)<br />
  6. 6. Popular functional programming languages<br />Erlang<br />Lisp<br />Scheme<br />Haskell<br />OCaml/ML<br />F#<br />
  7. 7. Why F#, then?<br />Superset of OCaml<br />Full access to .NET<br />Object Oriented<br />First class tools<br />Units!<br />Y!<br />
  8. 8. DEMO<br />Working with F#<br /> in Visual Studio<br />
  9. 9. Important: Let<br />Let keyword<br /><ul><li>Not assignment
  10. 10. Binds value to symbol
  11. 11. Immutable</li></li></ul><li>Important: |><br />Pipeline operator ( |> )<br />Feed results of one function into input of next<br />Takes advantage of easy composition of functions<br />Removes many possible errors<br />
  12. 12. Important: fun<br />Define a function in line<br />Anonymous function<br />Lambda expression!<br />
  13. 13. F# Powerpack<br />http://fsharppowerpack.codeplex.com/<br />Matrix library<br />FsLexx & FsYacc<br />LINQ in F#<br />HTML Docs from F# code<br />HashMultiMap<br />SI Units of Measure<br />
  14. 14. Parallelizable!<br />How do I parallelize my map/reduce/fold code?<br />Seq.map -> Seq.pmap<br />etc.<br />
  15. 15. Availability<br />YOU MAY ALREADY HAVE IT Included in Visual Studio 2010<br />OR, FOR FREE, <br />Can install VS2010 Shell with August release of F# 2.0<br />Can install VS2008 Shell with August release of F# 2.0<br />Can install F# 2.0 for Mono/Mac/Linux/Windows<br />http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/release.aspx<br />
  16. 16. Resources<br />F# Developer Centerhttp://fsharp.net<br />Parallel Sampleshttp://tomasp.net/blog/fsharp-parallel-samples.aspx<br />Chris Smith bloghttp://blogs.msdn.com/b/chrsmith/<br />Luca Bolognese bloghttp://lucabolognese.wordpress.com/<br />
  17. 17. More Resources<br />F# at Microsoft Researchhttp://research.microsoft.com/en-us/um/cambridge/projects/fsharp/<br />Don Syme’s bloghttp://blogs.msdn.com/b/dsyme/<br />Luke Hoban’s bloghttp://blogs.msdn.com/b/lukeh/<br />
  18. 18. Contact me:<br />Rob RohrSchool of Business AdminUniversity of Vermont230 Kalkin HallBurlington, VT 05405-0157robert.rohr@uvm.edu@rob_rohr<br />

×