WebSharper makes it easy to ..

Compile F# to JavaScript

type Person =
  { Name: string; Age: int }

[<JavaScript>]
let DisplayName p =
  JavaScript.Alert("Person: " + p.Name)
    

Write F# that intuitively compiles to JavaScript. Using F# gives you type safety, type inference, code completion, and a ready library with helpful data structures and algorithms.

Call the server seamlessly

[<Remote>]
let AddPerson p = Db.Person.Add(p)

[<JavaScript>]
let Test () =
    AddPerson {
        Name = "Alyssa P. Hacker"
        Age = 29
    }
    

AJAX has never been simpler. Run F# code on both the server and the client, making interop as simple as calling a method.

Collect user input

Formlet.Do {
  let! name =
    Input ""
    |> Enhance.WithTextLabel "Name"
  let! age =
    Input ""
    |> Formlet.Map int
    |> Enhance.WithTextLabel "Age"
  return AddPerson {Name = name; Age = age}
}
|> Enhance.WithSubmitAndResetButtons
|> Formlet.Render

Use formlets to declaratively construct interactive client-side forms and wizards with input validation and other goodness.

Go mobile

Create ready Android and Windows Phone 7 applications using HTML5/JavaScript technology exposed entirely through F#. Easily connect mobile devices to a server-side app for inter-device communication and cloud data storage.

Integrate

Use jQuery, Ext JS, Kendo UI, Protovis and many more rich UI technologies with code completion in F#.

Compose sitelets

let HomePage =
  Template "HomePage" <| fun ctx ->
  [
    Div [Text "HOME"]
    UL [
      LI ["Blog1" => ctx.Link(Blog 1)]
      LI ["Blog2" => ctx.Link(Blog 2)]
    ]
  ]

On the server side, use WebSharper sitelets, a handy abstraction for composable website components. Sitelets are MVC done right, featuring first-class actions and type-safe cross-links.

Learn more