This document summarizes a presentation on getting started with F# web development. It introduces F# and why it is suitable for web development. It then provides examples of using F# with Silverlight, ASP.NET MVC, and WebSharper. It also provides an F# primer and overview of features not covered in the presentation like other F# web frameworks. Contact information is given for following up on more information about F# and web development.
2. Daniel MohlC# MVP and F# Insider October 21, 2010 2 dmohl@yahoo.com www.twitter.com/dmohl blog.danielmohl.com
3. What Are We Doing? Why F#? F# Primer/Review F#/C# Silverlight Example F# Silverlight Example F#/C# ASP.NET MVC 2 Example WebSharper Example What Wasn’t Covered? Wrap it Up October 21, 2010 3
4. Why F#? Simple Code to Solve Complex Problems Terse Yet Readable Less Errors Features Not In Other Mainstream Languages Staying Ahead of the Competition October 21, 2010 4
5. Why F# for Web Dev? Asynchronous Workflows and Reactive Programming F#/JavaScript Commonalities Easier to support next generation web development Silverlight HTML5 (Web Sockets, Canvas) Twitter Feed Sample (Reactive Programming) Web Socket Example Canvas Example October 21, 2010 5
6. F# Primer/Review Whitespace Matters The let Keyword Pattern Matching More During the Demos October 21, 2010 6
7. Whitespace Matters October 21, 2010 7 //F# open System let doSomethingval = val + val Console.WriteLine (doSomething 1) //C# using System; namespace ConsoleApplication1 { class Program { static intdoSomething(intval) { return val + val; } static void Main(string[] args) { Console.WriteLine( doSomething(1)); } } }
8. The let Keyword October 21, 2010 8 //F# open System let val2 = 1 let doSomethingval = val + val2 Console.WriteLine (doSomething 1) //C# using System; namespace ConsoleApplication1 { class Program { static int val2 = 1; static intdoSomething(intval) { return val+ val2; } static void Main(string[] args) { Console.WriteLine( doSomething(1)); } } }
14. What Wasn’t Covered? October 21, 2010 14 Lots of F# Features Other F# Web Frameworks Bistro Suave Frank and Frack
15. More Information October 21, 2010 15 Books - http://msdn.microsoft.com/en-us/fsharp/gg262865.aspx F# MSDN - http://msdn.microsoft.com/en-us/fsharp/gg262865.aspx Blogs Twitter Ask – F# has the greatest community around
16. Daniel MohlC# MVP and F# Insider October 21, 2010 16 dmohl@yahoo.com www.twitter.com/dmohl blog.danielmohl.com