F Sharp programming language
From Free net encyclopedia
Current revision
F# (pronounced F sharp) is a mixed functional and object oriented programming language for the Microsoft .NET platform. A strength of F# is its setting within .NET. A key design aim is seamless .NET interoperability, both via direct use of .NET APIs from F# and authorship of natural .NET components in F#. Consequently, the main F# libraries are the .NET libraries themselves (e.g. DirectX, Windows Forms, and ASP.NET, as well as alternatives like Gtk#). A Visual Studio plugin provides a graphical development environment, including features such as background type-checking with feedback under the mouse, which is extremely helpful for those unfamiliar with type inference.
F# was developed by Don Syme at Microsoft Research, and has a core language that is similar to that of the Caml language (itself a member of the ML programming language family).
F# also provides a standard library of its own, designed to be largely compatible with the OCaml standard library. Since the two languages also share a common language subset, it can thus be quite practical to compile a single codebase with both. This enables core Caml code to be ported to the .NET world, and core F# code to run with OCaml. Maintaining this basic compatibility is one of the primary goals of the project.
As a research project, F# demonstrates how .NET enables interoperability between different programming paradigms. It showcases a set of extensions to .NET's intermediate language IL, called ILX, which demonstrate how a strict curried functional language may be compiled efficiently.
As of February 2006, F# was in the beta stage of development.
An example follows:
open System.Windows.Forms let form = new Form() do form.Visible <- true do form.TopMost <- true do form.Text <- "Welcome to F#" let x = 3 + (4 * 5) do form.Text <- (if x = 23 then "Correct!" else "incorrect")