F Sharp programming language

From Wikipedia, the free encyclopedia

The correct title of this article is F# programming language. The substitution or omission of a # sign is because of technical restrictions.

F# (pronounced F sharp) is a functional and object oriented programming language for the Microsoft .NET platform. It is typesafe, efficient, functional, object-oriented and type-inferred. 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# is developed by Microsoft Research, and has a core language that is similar to that of the Caml language: both are members 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 June 2006, F# was in the beta stage of development.

Contents

The F# programming language has many applications ranging from scripting to cross-platform application development.

The properties of the F# language and environment make it an ideal platform for scientific computing, filling the gap between low-level but high-performance numerical languages like Fortran and high-level but slow languages like Mathematica. F# provides the performance of a compiled language (typically between that of C and Java) with the sophisticated language features of high-level languages, including safety, static typing, pattern matching, views, higher-order functions and currying.

The F# environment includes the ability to run interactive sessions, allowing users to run pieces of code at will, collecting and analysing the results without having to compile whole programs. Moreover, visualizations can be spawned from interactive sessions, giving F# the essential functionality of many expensive technical computing environments.

F# also provides easy access to a foreign function interface, allowing libraries such as LAPACK and FFTW to be used with only a small amount of binding code.

A very small sample follows:

open System.Windows.Forms
let form = new Form(Visible=true, TopMost=true, Text="Welcome to F#")

let x = 3 + (4 * 5)
do form.Text <- (if x = 23 then "Correct!" else "incorrect")

F# is compatible with the XNA Game Studio Express product, which permits construction of games for Windows and for the Xbox 360.


Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.