Jump to content

F Sharp (programming language): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Jdh30 (talk | contribs)
Requestion (talk | contribs)
rm ffconsultancy.com linkspam by User talk:Jdh30
Line 52: Line 52:
* [http://strangelights.com/fsharp/Wiki/default.aspx F# Wiki]
* [http://strangelights.com/fsharp/Wiki/default.aspx F# Wiki]
* [http://grammerjack.spaces.live.com/blog/cns!F2629C772A178A7C!156.entry How to Write XNA Game Studio Express Games with F#]
* [http://grammerjack.spaces.live.com/blog/cns!F2629C772A178A7C!156.entry How to Write XNA Game Studio Express Games with F#]
* [http://www.ffconsultancy.com/dotnet/fsharp/ F# Demos and Tutorials]


{{DotNET}}
{{DotNET}}

Revision as of 06:03, 13 May 2007

#

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.

Version 1.9.1.9 was released on May 1, 2007.

Applications

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.

Examples

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.

See also

Books

Three books on F# are due to be published this year, including the first formal description of the language by its creator.