Web Programming with F#

F# is excellent for building scalable, robust web solutions:

  • Fast and Scalable - F# is much faster than NodeJS, Python, PHP and Ruby
  • Succinct - F# is concise, readable and type-safe, for fast development of robust web solutions
  • Asynchronous - F# provides asynchronous programming to simplify scalable client-server programming
  • Interoperable - F# interoperates seamlessly with languages such as C#, JavaScript and TypeScript
  • JavaScript-ready - F# is JavaScript-ready through WebSharper and FunScript
  • Open-source and Cross-platform - Like all good web tools!

Building Web Applications:

Some specific options for web application development are:

  • WebSharper - Allows end-to-end web applications with both client and server developed in F#.

    WebSharper includes TypeScript interoperability, mobile web apps, getting started material, templates and much more.

  • ASP.NET MVC - A widely used open source web framework from Microsoft.

    Views are implemented in HTML with some C#. Models and controllers are implemented in F#.

    The F#/C# Web Templates (Visual Studio, ASP.NET MVC 4)
    include templates for ASP.NET MVC 4 (ASPX/Razor) and Single Page Applications with Backbone.js or Knockout.js.

    The F#/C# ASP.NET MVC 3 Templates include templates for ASP.NET MVC 3 (ASPX/Razor). The F#/C# Web Templates (MonoDevelop, ASP.NET MVC 4) are a similar se of cross-platform templates for MonoDevelop.

  • FunScript - An F# to JavaScript converter with TypeScript interoperability.

  • PicoMvc is a micro framework for F# web programming.

Building Server-Side Web APIs:

F# shines in the area of Web API development through frameworks like ServiceStack, ASP.NET Web API, Frank and NancyFx.

Hosting

Common hosting options are:

Scaling to the Cloud

The Cloud Programming section contains more details on cloud programming with F#. Some specific resources related to web programming are:

Unit Testing Libraries

It is common to create a suite of unit tests when building web solutions. A list of open source libraries that assist with unit testing is available here:

Here are a few Visual Studio 2012 project templates available for building unit tests:

Books

Several books have been written that include information on building web applications with F#:

Presentations

There are several presentations and tutorials available that include information on build web applications with F#:

Silverlight Applications:

For those still using Silverlight, you can use F# to build Silverlight projects in whole or in part. Some resources are: