Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Getting Started with F# Web Development


Published on

Many of the features provided by F# lend themselves well to web development. In this talk, we will quickly go over some of the basics of the F# language, then dive into four quick ways to get started developing web application in F#. By the end, we will have built an F# and C# Silverlight application, an F# only Silverlight application, an F# and C# ASP.NET MVC 2 web application, and a web application with a platform called WebSharper.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Getting Started with F# Web Development

  1. 1. Getting Started with F# Web Development <br />October 21, 2010<br />1<br />
  2. 2. Daniel MohlC# MVP and F# Insider<br />October 21, 2010<br />2<br /><br /><br /><br />
  3. 3. What Are We Doing?<br />Why F#?<br />F# Primer/Review<br />F#/C# Silverlight Example<br />F# Silverlight Example<br />F#/C# ASP.NET MVC 2 Example<br />WebSharper Example<br />What Wasn’t Covered?<br />Wrap it Up<br />October 21, 2010<br />3<br />
  4. 4. Why F#?<br />Simple Code to Solve Complex Problems<br />Terse Yet Readable<br />Less Errors<br />Features Not In Other Mainstream Languages<br />Staying Ahead of the Competition<br />October 21, 2010<br />4<br />
  5. 5. Why F# for Web Dev?<br />Asynchronous Workflows and Reactive Programming<br />F#/JavaScript Commonalities<br />Easier to support next generation web development <br />Silverlight<br />HTML5 (Web Sockets, Canvas) <br />Twitter Feed Sample (Reactive Programming)<br />Web Socket Example<br />Canvas Example<br />October 21, 2010<br />5<br />
  6. 6. F# Primer/Review<br />Whitespace Matters<br />The let Keyword<br />Pattern Matching<br />More During the Demos<br />October 21, 2010<br />6<br />
  7. 7. Whitespace Matters<br />October 21, 2010<br />7<br />//F#<br />open System<br />let doSomethingval = <br />val + val<br />Console.WriteLine<br /> (doSomething 1)<br />//C#<br />using System;<br />namespace ConsoleApplication1<br />{<br />class Program<br />{<br />static intdoSomething(intval)<br />{<br />return val + val;<br />}<br />static void Main(string[] args)<br />{<br />Console.WriteLine(<br />doSomething(1)); <br />}<br />}<br />}<br />
  8. 8. The let Keyword<br />October 21, 2010<br />8<br />//F#<br />open System<br />let val2 = 1<br />let doSomethingval = <br />val + val2<br />Console.WriteLine<br /> (doSomething 1)<br />//C#<br />using System;<br />namespace ConsoleApplication1<br />{ <br />class Program<br />{<br /> static int val2 = 1;<br />static intdoSomething(intval)<br />{<br />return val+ val2;<br />}<br />static void Main(string[] args)<br />{<br />Console.WriteLine(<br />doSomething(1)); <br />}<br />}<br />}<br />
  9. 9. Pattern Matching<br />October 21, 2010<br />9<br />Kind of like a switch/case statement, but so much more!<br />
  10. 10. F#/C# Silverlight Example<br /><br />October 21, 2010<br />10<br />
  11. 11. F# Silverlight Example<br /><br />October 21, 2010<br />11<br />
  12. 12. F#/C# ASP.NET MVC2 Example<br /><br />October 21, 2010<br />12<br />
  13. 13. WebSharper Example<br /><br />October 21, 2010<br />13<br />
  14. 14. What Wasn’t Covered?<br />October 21, 2010<br />14<br />Lots of F# Features<br />Other F# Web Frameworks<br />Bistro<br />Suave<br />Frank and Frack<br />
  15. 15. More Information<br />October 21, 2010<br />15<br />Books -<br />F# MSDN -<br />Blogs<br />Twitter<br />Ask – F# has the greatest community around<br />
  16. 16. Daniel MohlC# MVP and F# Insider<br />October 21, 2010<br />16<br /><br /><br /><br />