Friday, November 14, 2003

More on F#

F# is an implementation of the core of the Caml programming language for the .NET Framework, along with cross-language extensions. The aim is to have it work together seamlessly with C#, Visual Basic, SML.NET and other .NET programming languages. In particular it is the first ML language where all the types and values in an ML program can be accessed from some significant languages (e.g. C#) in a predictable and friendly way.

Purely functional languages like Haskell are excellent within certain niches, but unfortunately some simple programming exercises can quickly turn into problems that require a PhD. to solve. Purely imperative programming languages like C or Pascal do not provide satisfying mechanisms for abstraction or data manipulation. Purely object oriented languages like Smalltalk are excellent for some dynamic applications but do not provide static guarantees. Typed class-based languages like C# and Java contain a very large number of constructs, and it can sometimes be difficult for programmers to choose how to model their problem, and sometimes result in very large amounts of code just to solve quite simple problems. In contrast, languages such as Caml provide a smaller number of simple, orthogonal constructs which work together to allow for succinct yet efficient solutions to programming problems.

F# provides a subset of the OCaml libraries, so you don't have to use .NET libraries if it is not appropriate. It is possible to write large applications that can be cross-compiled as either OCaml bytecode, OCaml native code or F# code, for example, the F# compiler itself is written this way. This lets you reuse the investment you make in the core of a project while letting you write some parts of your application as F# code that makes use of .NET extensions.


Go to Microsoft Research

0 Comments:

Post a Comment

<< Home