Subject: F#
From: "Scott Williams" <[email-masked]>
To: <[email-masked]>
Date: Wed, 29 May 2002 09:28:59 -0700

Paul, I just saw this, and I think you and I were talking about using
ML.  Let me know if we need to follow-up on this further.
 
Scott
 
  _____  

F#

    <http://research.microsoft.com/projects/ilx/absil.htm>   
<http://research.microsoft.com/projects/ilx/ilx.htm> 

Sections 

Up <http://research.microsoft.com/projects/ilx/index.htm> 
F# FAQ <http://research.microsoft.com/projects/ilx/fsharp-faq.htm> 
About F# <http://research.microsoft.com/projects/ilx/fsharp-ack.htm> 
Download F#
<http://research.microsoft.com/projects/ilx/fsharp-release.htm> 
F# Manual <http://research.microsoft.com/projects/ilx/fsharp-manual.htm>

F# Compared
<http://research.microsoft.com/projects/ilx/fsharp-language-compare.htm>

F# Tool Support
<http://research.microsoft.com/projects/ilx/fsharp-ergonomics.htm> 
F# Performance
<http://research.microsoft.com/projects/ilx/fsharp-perf.htm>  

Announcements 

A presentation on F#
<http://research.microsoft.com/projects/ilx/Fsharp-v6.ppt>  is now
available (April 2002)

Coming soon: The First F# Language Release
<http://research.microsoft.com/projects/ilx/fsharp.htm>  (April 2002)

A new version of the ILX reference manual
<http://research.microsoft.com/projects/ilx/ilx-ref.doc>  is available.
This is considerably updated from previous versions (January 2002)

Version 0.5 of the AbsIL/ILX SDK is now available
<http://research.microsoft.com/downloads> .(April 2002)

 

	F# is a mixed functional/imperative programming language based
on the design of the functional language Caml <http://caml.inria.fr>
and the .NET language C#.

Combining the speed, safety and productivity of ML and Caml with the
libraries, tools and cross-language working of .NET

Mixed functional/imperative programming is a fantastic paradigm for many
programming tasks.  Languages such as OCaml and Standard ML provide
excellent general purpose programming languages suited to
medium-advanced programmers who want simple yet highly expressive tools
that boost their productivity, primarily by reducing the error rate,
increasing their productivity through type inference, and basically
letting them focus on the difficult parts of their applications.

You can access hundreds of .NET libraries using 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.

The aim of F# is to have a mixed functional-  imperative language that
works together seamlessly with C# and other .NET languages.

Purely functional languages like Haskell are excellent within certain
niches, but many 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 an implementation of a subset of the OCaml libraries as well
as the ability to access .NET libraries.  Using the .NET libraries is
optional.

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. 

The following links will let you learn more about F#:

 	 Basic programming in F#
<http://research.microsoft.com/projects/ilx/fsharp-manual.htm> 

	 Using C# and other .NET libraries from F#
<http://research.microsoft.com/projects/ilx/fsharp-manual-import-interop
.htm> 

	 Using F# libraries from C#
<http://research.microsoft.com/projects/ilx/fsharp-manual-export-interop
.htm> 

	 Using the F# library

	 To access .NET constructs, see the extra language features
supported in this release
<http://research.microsoft.com/projects/ilx/fsharp-manual-extras.htm> .

	 Learn how to write high-performance
<http://research.microsoft.com/projects/ilx/fsharp-perf.htm>  F# code

 F# also provides a simple, familiar set of tools:

	 A simple command line compiler, supporting separate
compilation, debug information and optimization.

	 F# supports features that are often missing from ML
implementations such as Unicode strings and dynamic linking.  It also
supports reflection to a limited degree, though only via .NET libraries.

	 Tool support is strong when combined with tools from the
(freely available) .NET Framework and/or Microsoft's Visual Studio.  For
example the DbgClr.EXE tool in the .NET Framework SDK gives you a
graphical debugger for F#.

F# is, as far as I know, the first ML compiler to have good
binary-compatibility and versioning properties, e.g.

	 You can build DLLs (many ML compilers do not allow this)

	 There is full fidelity between F# code in a DLL and F# code
that calls the DLL (i.e. you can use F# constructs across the DLL
boundary without any problems);

	 You can add a value to a module and the binaries produced are
compatible.  

	 You can modify the internals of a module and the binaries will
remain comaptible.  The binary compatibility properties deteriorate if
cross-module optimization is used).  

F# also happens to be the first released .NET language that is able to
produce Generic IL <http://research.microsoft.com/projects/clrgen> , and
the compiler was really designed with this target language in mind.
However the compiler can also produce standard .NET binaries, which is
just as well because there is no publicly available release of a .NET
Common Language Runtime for .NET that supports generics. 

Design-wise, F# is essentially a .NET implementation of the core of the
OCaml programming language, with some minor design changes.  The design
extends the core OCaml language by making some guarantees about how ML
constructs appear to .NET languages and by allowing the programmer to
access .NET libraries, primarily via an extended "." notation (e.g.
"val.ToString()" to call a .NET method).  For a full feature comparison
see the following pages:

	 Compare F#, SML and OCaml as languages
<http://research.microsoft.com/projects/ilx/fsharp-language-compare.htm>
..

	 Compare these as programming environments
<http://research.microsoft.com/projects/ilx/fsharp-ergonomics.htm> ,
i.e. including debugging, compiling etc.

	 Compare F# and C#
<http://research.microsoft.com/projects/ilx/fsharp-csharp-java.htm>