The F#.NET Journal

Subscribe to the F#.NET Journal today and read our growing repository of fascinating articles on the F# programming language from Microsoft:

  • Watch tutorial videos to get to grips with the development environment quickly and easily.
  • Learn how to create stunning visualizations from the F# interactive mode.
  • Study the complete source code of working programs.
  • Use our source code starter packs to kick off your own projects.
  • Cut-n-paste any or all of the F# code from the journal into your own work at no extra cost!

All included when you subscribe to the F# Journal for as little as £8.25 per month.

1 Year Subscription

All existing articles and 24 new articles

6 Month Subscription

All existing articles and 12 new articles

3 Month Subscription

All existing articles and 6 new articles

Group subscriptions and Site Licences

Get up to 65% off! Read more...

Special Offers

Buy 1 year subscriptions to the OCaml and F#.NET Journals and get 25% off!

+ =

For a limited time only, buy a year subscription to the F#.NET Journal and the F# for Numerics and F# for Visualization libraries and get 25% off!

+ + =

Testimonials

"THANKS for all of your great work!" - Don Brady, Comintel Inc.

"The journal articles are excellent." - Burt Jurgens, Critical Path Software

"Thanks for your great magazine. I'm enjoying the articles." - Enrique Nell

"I'm very impressed. I found the tail recursion optimization stuff very interesting." - Granville Barnett

"I am enjoying the F# journal articles and really looking forward to seeing the book F# for Scientists" - Paul Harrington, D E Shaw & Co.

"I am particularly impressed by the wide range of content and the depth of the articles." - Dr Colin Frayn, Cercia Ltd.

"... it's the material that really shines. Recommended reading for all F# / C# 3 neophytes" - Tom Kirby-Green.

Free articles

The following article is available for free to non-subscribers:

  • Introducing the F# programming language (April 2007)

    "Microsoft's F# programming language is a functional language for the .NET framework that was originally developed at Microsoft Research Cambridge by Don Syme. In October 2007, the senior vice president of the developer division at Microsoft announced that F# was being officially productized to become a fully supported .NET language and professional developers were hired to create a team of around ten people to build the product version. In September 2008, Microsoft released the first Community Technology Preview (CTP), an official beta release, of the F# distribution. In December 2008, Microsoft announced that the success of this CTP had encouraged them to escalate F# and it will now be shipped as one of the core languages in Visual Studio 2010, alongside C++, C# 4.0 and VB..."

If you would like to see articles on a particular topic then please register on-line and let us know.

Subscribers may access the archives to read all published articles.

Contents

The following articles are currently available only to subscribers:

  1. How to Leverage Pattern Matching (16th April 2007)

    "Compared to conventional programming languages, F# takes dynamic dispatch to a whole new level using an approach called pattern matching. This article guides the reader through the fundamental concepts that underpin pattern matching before providing some examples demonstrating the power of pattern matching in general programming..."

  2. The Essence of Functional Programming (30th April 2007)

    "F# is fundamentally a functional programming language and the use of functions instead of objects often leads to shorter and clearer code. Indeed, many of the benefits of functional programming are already known to OO programmers in the form of design patterns..."

  3. F# Development in Visual Studio 2005 (14th May 2007)

    "The F# distribution includes extensions to Microsoft Visual Studio that provide a rich development environment for F# programmers. In this article, we shall describe how this development environment can be setup and used to make development as easy and productive as possible..."

    This article contains a 5 minute tutorial video demonstrating F# development inside Visual Studio 2005.

  4. Objects and Augmentations in F# (31st May 2007)

    "In addition to functional programming, the F# language also offers object-oriented programming (OOP) in harmony with the .NET platform. The F# language takes powerful OOP concepts from C# and supplements them with elegant functional constructs. The result combines the best aspects of functional and object-oriented programming..."

  5. Using the built-in Data Structures (15th June 2007)

    "The .NET framework provides a wide variety of mutable data structures and the F# standard library supplements these with several immutable data structures that provide elegant functional interfaces. This article describes many of the built-in data structures, how they are used and when they are most applicable..."

  6. Designing and implementing a Sudoku Solver (30th June 2007)

    "This article walks through the design and implementation of a complete GUI application for solving Sudoku puzzles. This is perhaps the smallest interesting GUI application that demonstrates many different advantages of the F# programming language, including functional programming and .NET interoperability..."

    Download and play the demo (requires .NET 2.0 or later)

  7. Introduction to Threading (15th July 2007)

    "The .NET platform provides parallel execution of code through multithreading. A thread is an independent execution path, able to run simultaneously with other threads. This article describes the fundamentals of .NET threading and how this functionality can be leveraged elegantly by F# programs..."

  8. Introduction to DirectX (31st July 2007)

    "The .NET platform contains library interfaces to almost all of the functionality bundled with the Windows platform. Hardware-accelerated graphics are no exception and Managed DirectX (MDX) for .NET provides a high-level and type-safe interface to the DirectX API..."

  9. Exploiting Tail Recursion (16th August 2007)

    "Recursion is essential to functional programming and practical use of functional programming languages and a functional style requires the ability to write recursive functions that do not consume stack space. Function calls that require no stack space are called tail calls. This article describes the use of tail calls to write robust and efficient tail recursive functions in F#..."

  10. Combinator Heaven (1st September 2007)

    "The ability to write higher-order functions that compose other functions in interesting ways is one of the most powerful forms of abstraction provided by the functional programming paradigm. Such functions are known as combinators . This article describes the basic concepts behind combinators with a variety of examples to demonstrate how practically useful this form of functional abstraction can be..."

  11. A simple FFT implementation (18th September 2007)

    "Writing an implementation of the Fourier transform is an excellent lesson in algorithm design and optimization. Moreover, the Fourier transform is one of the most essential tools in numerical computing, with applications ranging from spectral analysis to the multiplication of large integers. This article describes the design and implementation of a simple but efficient FFT..."

  12. Parsing text with Lex and Yacc (30th September 2007)

    "The tool stack bundled with the F# distribution includes fslex and fsyacc tools that help in the construction of parsers. The ability to parse data in different formats is often very useful, particularly when translating between representations. This article introduces the concepts of lex and yacc-based parsing and describes how these tools may be used to construct robust and efficient parsers quickly and easily..."

  13. Balanced binary search trees (16th October 2007)

    "Functional programming languages like F# excel at handling immutable data structures. In the interests of efficiency, such data structures are typically based upon trees rather than hash tables. Key benefits include the ability to express algorithms elegantly using a declarative style and the inherent thread safety of immutable data structures makes them ideal for concurrent programming. This article describes the design and implementation of a basic balanced binary search tree data structure similar to that of the built-in Set module..."

  14. Optimizing a simple bytecode interpreter (31st October 2007)

    "Interpreter and compiler writing is the bread and butter of the ML family of languages and F# is no exception. This article describes the design, implementation and optimization of an interpreter for a simple bytecode language..."

  15. Sequence expressions and comprehensions (16th November 2007)

    "The .NET framework provides a powerful generic interface called IEnumerable that allows containers to be treated as arbitrary sequences. The approach is now widely used in C# but F# takes IEnumerable to a new level with its Seq data structure. This article describes abstract sequences in F#, the comprehension syntaxes provided by F# to make their construction simpler and clearer and practical applications of sequences with several examples..."

  16. Parser combinators (30th November 2007)

    "Certain applications are extremely well suited to functional programming and parsing is one of them. Specifically, the ability to write functional combinators that allow parsers for everything from integers up to symbolic expressions to be composed is more general and provides more opportunity for code reuse than the use of conventional parser generators such as fslex and fsyacc. This article explains how parser combinators may be designed and implemented in F#, using the standard example of a calculator..."

  17. Quick introduction to web services and databases (20th December 2007)

    "The F# programming language combines the expressive power of a modern functional programming language with the comprehensive libraries provided by the .NET framework. This article provides a quick introduction to two of the most widely used aspects of the .NET framework: web services and databases..."

  18. Language-oriented programming: The Term-level Interpreter (31st December 2007)

    "Modern software is using a wider variety of languages than ever before. The ability to parse and interpret these languages is of growing importance. Fortunately, F# inherits incredibly powerful constructs for parsing and interpreting other languages from its predecessors. This article explains how the power of F# can be harnessed to write a complete term-level interpreter for a programming language in only a tiny amount of F# code..."

  19. Implementing a simple Ray Tracer (16th January 2008)

    "Ray tracing is a simple but powerful approach to photorealistic rendering and implementing a ray tracer is an excellent way to learn a programming language and, in particular, to learn about graphics and optimization in the context of numerical algorithms. This article walks through the design and implementation of a basic ray tracer that ray traces a scene in a Windows Forms application that provides the user with rendering options via a menu and real-time incremental update..."

  20. Factoring numerical methods using combinators (31st January 2008)

    "The benefits of functional programming in certain areas like parsers and compilers are well known but functional programming can also be extremely beneficial in many other areas including numerical computation and technical computing. This articles shows how common functional constructs can be used to implement some numerical methods and even complete working programs much more quickly and easily. The clarity of the resulting implementations is remarkable thanks, in particular, to the use of combinators..."

  21. Graph plotting with Windows Presentation Foundation (16th February 2008)

    "The advent of the .NET Framework 3.0 brings an exciting new technology to the Windows platform for the first time: hardware-accelerated vector graphics as part of Windows Presentation Foundation. This part of Microsoft's standard library allows programmers to define resolution-independent vector graphics in the form of arbitrary paths and shapes and visualize them in an interactive GUI. This article describes how these features can be used in F# programs and builds a simple graph plotter as an example..."

  22. Embedding XNA in Windows Forms (29th February 2008)

    "Microsoft's XNA library is conventionally used for whole-screen games programming but related GUI applications such as level editors can often benefit from the ability to reuse the same XNA-based rendering code in a Windows Forms application. This article describes how an XNA-based Windows Forms control can be written in F#, allowing XNA to be used in an ordinary Windows application..."

  23. Numerical Libraries: special functions, interpolation and random numbers (16th March 2008)

    "The F# programming language provides an excellent foundation for technical computing on the Windows platform thanks to its high-performance interactive sessions and integrated support for mathematical types. This article is our first look at numerical libraries, both free and commercial, and describes the implementation quality and easy of use of these libraries in the context of special functions, interpolation and random numbers..."

  24. Reducing development costs with Static Typing (31st March 2008)

    "The F# language arms programmers with the most sophisticated static type system of any mainstream programming language. This static type system can be used to remove large classes of common bugs that are otherwise tedious or impossible to track down, drastically reducing software development costs. However, learning how and when to leverage such a type system is an art that requires significant effort to learn. This article describes idiomatic F# style and a variety of techniques that can be used to leverage the static type system in order to catch errors earlier and more easily..."

  25. Numerical Libraries: linear algebra and spectral methods (16th April 2008)

    "This article revisits the subject of numerical libraries for .NET, this time in the context of linear algebra and spectral methods. Specifically, the use and performance of various free and commercial numerical libraries are examined for the computation of eigenvalues and Fourier transforms. This includes a complete 1D FFT interface for F# to the excellent FFTW library..."

  26. Surviving in the multicore era with Microsoft's ParallelFX (30th April 2008)

    "As the world transitions to multicore desktop computers over the next few years it is essential that software evolves to take advantage of this new dimension in processing power by exposing parallelism. Any software products that fail to evolve will suffer catastrophic losses in sales. The F# programming language uniquely combines natural parallelism at the language level with state-of-the-art capability at the implementation level thanks to its .NET foundation. Microsoft's new Task Parallel Library (TPL) is the keystone in building parallel F# programs and this article explains how this is done using Microsoft's latest Community Technology Preview (CTP) of the TPL..."

  27. Porting and optimizing the SciMark2 benchmark (15th May 2008)

    "The SciMark2 benchmark is a suite of numerical algorithms that were originally collated into a benchmark for scientific computing on the Java platform. Porting this benchmark to F# provides an excellent tutorial on the implementation of efficient numerical algorithms and the existing C# implementation of this benchmark can be used for comparison. The results illustrate the strengths and weaknesses of the current F# implementation in terms of performance..."

  28. Scalable distributed parallelism with MPI.NET (31st May 2008)

    "High-performance programs are often run on clusters of machines and the Message Passing Interface (MPI) is the defacto standard for inter-process communication for this kind of distributed parallelism. This article demonstrates just how easily existing .NET libraries can be used to parallelize F# programs across clusters of machines using MPI..."

  29. Real-time Finite Element Materials simulation (15th June 2008)

    "Finite Element Materials simulations (FEMs) model a continuous volume of material by breaking it down into a discrete representation with many finite parts. This article describes a simple but fun program that simulates the dynamics of a 2D system of particles and springs in real-time. The program includes an interactive GUI visualization based upon Windows Presentation Foundation..."

    Download and play the demo (requires .NET 3.0 or later)

  30. Interoperating with native code from F# (30th June 2008)

    "Although the F# programming language offers many improvements over older languages such as unmanaged C, C++ and Fortran the need to interoperate with native code can still arise. The two most important uses for native code interoperability are performance and legacy. This article describes how native code can be invoked from F# programs, including essential design advice for building robust interfaces in this otherwise error-prone task..."

  31. Mathematica interoperability (16th July 2008)

    "The Mathematica integrated technical computing environment from Wolfram Research is an incredibly powerful cross platform development environment, language and enormous standard library specifically designed for technical computing. Mathematica's .NET-Link technology is designed to allow Mathematica programs to interoperate with .NET languages such as C#. This article examines the hugely productive marriage of the F# programming language with Mathematica and demonstrates how Mathematica can be controlled entirely from F# programs, allowing Mathematica's awesome functionality to be tapped from a much higher performance and more scalable language..."

  32. Implementing XML-RPC clients and servers (31st July 2008)

    "XML-RPC is a protocol for remote procedure calls that is built upon the XML format. Method calls are packaged up by the client as an XML request sent via HTTP to the server whereupon action is taken and a response is packaged up and returned in the same way. This article demonstrates how elegantly F# programs can handle XML data using combinators and describes how a complete client-server pair using XML-RPC can be designed and built from scratch using only a small amount of library code and the .NET framework..."

  33. Language oriented programming: Term Rewriting (16th August 2008)

    "An interesting and powerful alternative to the conventional term-level interpreter is called term rewriting. Rather than reducing expressions down to values, term rewriting simply evaluates expressions by performing substitutions and the result of each substitution is another expression. This approach is particularly well suited to computer algebra systems such as Mathematica but is also an underappreciated alternative to dynamically-typed programming languages that can integrate useful features like pattern matching and make techniques like partial specialization far easier. This article describes how a simple term rewriter can be constructed in the F# programming language..."

  34. Run-time code generation using System.Reflection.Emit (31st August 2008)

    "The .NET platform represents a radical departure from the previous generation of native-code compiled languages. Whereas languages such as C++ and Fortran have distinct compilation and execution phases, the .NET platform deliberately blurs this distinction with run-time compilation of a distributable platform-independent Common Intermediate Language (CIL). This article examines the use of run-time code generation from F# using the System.Reflection.Emit namespace to implement a compiler for a simple bytecode language..."

  35. Named and Optional arguments (16th September 2008)

    "The F# programming language provides a variety of useful features that are not found in many other functional programming languages. This is why F# is widely accepted as a functional language for practical use. Named and optional arguments are two related features that can be used to great effect in simplifying interfaces. This article introduces the syntax required to define and use both named and optional arguments in F# and describes some pedagogical uses of these features, with references to existing libraries, as well as examining some of the problems often encountered by programmers using these features..."

  36. Concurrent web crawling using asynchronous workflows (30th September 2008)

    "Web-enabled technology is now ubiquitous and of huge commercial value. These kinds of programs share two common characteristics: they send information over the internet and they perform tasks concurrently. This article is the first in a series to examine the use of the F# programming language in the growing area of concurrent web programming and, in particular, covers the currently-experimental support for asynchronous workflows..."

  37. Triangulated Irregular Networks (TINs) (16th October 2008)

    "Adaptive subdivision is a hot topic in computer graphics and forms the foundation of many state-of-the-art algorithms for large scale visualization used for everything from scientific visualization of huge data sets to game graphics that immerse players in expansive virtual worlds. This article describes one of the most popular approaches for the adaptive subdivision of 3D meshes and implements a capable plotting algorithm with real-time visualization using Windows Presentation Foundation showcasing how this simple algorithm works and can be used to solve many different problems..."

  38. Low-level optimization tips and tricks: part 1 (31st October 2008)

    "The F# programming language is a fantastic tool for technical computing because it combines easy interactive high-level programming with excellent performance and multicore capability. This makes it feasible to solve a wide variety of problems without having to drop to low-level languages like C for performance. This article describes some of the low-level optimizations that underpin the ability to write performant F# programs by leveraging knowledge about the F# compiler as well as the few situations where F# is currently unable to provide competitive performance..."

  39. Windows Presentation Foundation: basic controls (16th November 2008)

    "Microsoft's new Windows Presentation Foundation (WPF) is the next generation of graphical user interface technology, facilitating rich interactive content that is seamlessly integrated with related technologies. This article is the first in a series examining how WPF can be used from the F# programming language. We begin with an overview of WPF and describe the kinds of GUI applications that will benefit the most from using F# before surveying the basic GUI elements provided by WPF..."

  40. Beginner's XNA tutorial (30th November 2008)

    "Microsoft's XNA framework is a .NET library intended primarily for games programming that superceded Managed Direct X (MDX). XNA provides a safer, higher-level design that still exposes low-level graphics capabilities in order to provide the best possible performance for graphics-intensive software from a managed language. This article describes everything required to get rendering using the XNA framework with F#, from the most primitive built in effects to custom shader programs..."

  41. Reflection and run-time types (16th December 2008)

    "The common language run-time (CLR) provides functionality known as reflection that allows programs to create instances of types dynamically, bind types to existing objects and lookup the type of a given object. The F# programming language maps conventional ML type system constructs (tuples, records and variants) onto .NET classes and augments the reflection capabilities of .NET with functions to interrogate F# types. This article describes the reflection capabilities of F# and provides several example applications demonstrating the use of reflection in F# programs..."

  42. Solving the Traveling Salesman problem using Simulated Annealing (31st December 2008)

    "Finding global minima of an arbitrary function is a significantly more challenging problem than local function minimization and has many practical applications from the simulation of molecules to the design of printed circuit board layouts. Several different global function minimization algorithms exist, many of which make repeated use of local function-minimization algorithms. This article describes a simple and elegant solution to the traveling salesman problem that uses the simulated annealing approach to global function minimization. The results are visualized in real time using Windows Presentation Foundation..."

  43. Simulating smoke in real-time using fluid dynamics (16th January 2009)

    "In scientific computing, the task of simulating fluid flow accurately by solving the Navier-Stokes equation is notoriously difficult. However, it is possible to compute numerical approximations quickly enough that fluids dynamics may be simulated in real time. This article describes a simple fluid dynamics simulator that uses Microsoft's Task Parallel Library (TPL) to parallelize the computationally intensive operations and uses Windows Presentation Foundation to visualize the results in real time..."

  44. Emergent behaviour: flocking boids (31st January 2009)

    "Artificial life became a popular topic in the 1980s. In particular, with the discovery that simple rules defining the behaviour of individuals could give rise to sophisticated behaviour of groups of individuals. This unexpected result was described as "emergent behaviour" and one of the most famous examples was a computer program called "Boids" that used only three simple rules to govern the dynamics of individuals but produced remarkably realistic flocking behaviour of the population as a whole. This article describes an interactive boids simulator with a graphical user interface implemented using Windows Presentation Foundation..."

  45. Low-level optimization tips and tricks: part 2 (15th February 2009)

    "The F# programming language is a fantastic tool for technical computing because it combines easy interactive high-level programming with excellent performance and multicore capability. This makes it feasible to solve a wide variety of problems without having to drop to low-level languages like C for performance. This article describes garbage collection friendliness, data structure specialization, efficient loops and the use of structs to avoid boxing..."

  46. Working with Regular Expressions (28th February 2009)

    "Regular expressions are a domain-specific language for pattern matching over sequences of characters. This functionality provides a concise and efficient way to dissect strings and, consequently, is used in many forms of string processing including the definition of lexers. This article describes how .NET's support for regular expressions can be used to manpulate strings easily and efficiently from the F# programming language..."

  47. Units of Measure (15th March 2009)

    "The F# programming language is the first mainstream language in the world to offer statically type checked units of measure. This advanced feature is easy to use and checks the dimensional consistency of programs that manipulate physical quantities. This article introduces units of measure in the F# programming language with the basic constructs, the built-in measures provided with F#, several worked examples of units of measure in action and, finally, a discussion of the caveats of this exciting new language feature..."

  48. Aperiodic Tilings (31st March 2009)

    "Many sets of polygons can be used to tile an infinite 2D plane. The term "aperiodic tilings" is used informally to refer to tilings that are not periodic. Such tilings are not only of mathematical and scientific interest because they give rise to unexpected diffraction patterns when they appear in quasicrystalline materials but also because they are often beautiful and, consequently, have been used in ornamental decorations for centuries. This article describes a simple program that visualizes tilings using Windows Presentation Foundation where the tilings are described using generic rewrite rules implemented in terms of a .NET interface..."

  49. Lempel-Ziv-Welch data compression (15th April 2009)

    "LZW is a simple and effective dictionary-based data compression algorithm originally published in 1984 and subsequently used in several prominent places including the GIF image format. This article describes simple purely functional implementations of the compression and corresponding decompression algorithms before examining the translation and optimization of these algorithms into longer but more efficient imperative equivalents. In particular, F#'s sequence expressions are used extensively to create on-the-fly compressors and decompressors ideal for stream processing..."

  50. Purely functional data structures: streams and batched queues (30th April 2009)

    "This article is the first in a series describing the design and implementation of some very useful purely functional data structures. Lazy evaluation, lazy streams and batched queues are described in detail. In particular, new .NET interfaces, classes and objects are used factor the implementations of the data structure and various built-in interfaces are implemented in order to support equality, comparison and hashing of these new data structures..."

  51. Purely functional data structures: real-time queues and catenable lists (15th May 2009)

    "This is the second article in a series describing the design and implementation of some purely functional data structures. Real-time queues and catenable lists that provide reliable O(1) time complexity operations are described in detail. In particular, laziness is used to ensure that operations are performed efficiently even when the data structures are used persistently. This culminates in the creation of some useful new data structure implementations..."

  52. Visualizing linear algebra: Singular Value Decomposition (31st May 2009)

    "Singular Value Decomposition (SVD) is an important algorithm from linear algebra that decomposes a matrix into the product of three simpler matrices. The resulting decomposition has several applications. This article describes the design and implementation of an F# program that computes the SVD of an image and uses it to create a lossy compression algorithm with controllable quality. This involves numerical methods for computing the eigenvalues of real symmetric matrices and interactive visualization of the result as a standalone Windows Presentation Foundation application..."

    Download and play the demo (requires .NET 3.0 or later)

To receive notifications as new articles are published, please subscribe to our F# News blog feed available from this page.

Forthcoming articles

The following articles are coming soon:

  • Advanced topics in parallelism
  • Introduction to asynchronous workflows
  • Improving maintainability using higher-order functions
  • Factory pattern in functional programming
  • Dynamic programming in F#
  • Overview of Windows Forms programming
  • Excel automation
  • Implementing a scene graph library
  • Spawning 3D visualizations
  • Rigid body simulation
  • High-performance F#
  • Working with .NET streams
  • Working with XML
  • Metaprogramming
  • Matlab automation
  • Real-time data capture and visualization
  • Rendering whole planets
  • Implementing .NET libraries in F#
  • Parsing text with FParsec

(Note: We are not VAT registered and, therefore, cannot provide VAT receipts)

Mastercard VISA VISA Delta VISA Electron VISA Purchasing JCB Solo Switch