Chapter 2. Dissecting F# Origins and Design

This chapter reviews F# features from the historical perspective tracking them back to origins where possible. The review covers:

  • F# evolvement timeline
  • Predecessor inherited language features
  • .NET imposed language features
  • Intrinsic F# language features

Although F# is a functional-first programming language, at the same time, you should not forget that it is a multi-paradigm tool that allows paradigms to be combined if required. Another important aspect you should keep in mind is that F# is designed for a .NET platform, so certain language facilities are shaped by underlying implementation mechanisms and interoperability requirements. The goal of this chapter is to dissect the language into components in a way that allows you to grasp the origins and the logic behind a contemporary F# design.

The evolvement of F#

Press began mentioning (http://developers.slashdot.org/story/02/06/08/0324233/f---a-new-net-language) the F# programming language in the Summer of 2002 as a research project at Microsoft Research Cambridge (http://research.microsoft.com/en-us/labs/cambridge/) aiming to create a dialect of OCaml language (https://ocaml.org/) running on top of the .NET platform. Computer scientist Don Syme (http://research.microsoft.com/en-us/people/dsyme/) was in charge of design and the first implementation.

Predecessors

The F# project of Microsoft Research Cambridge didn't come from scratch. F# belongs to ML (https://en.wikipedia.org/wiki/ML_(programming language)) programming language family. It predecessors are Standard ML (https://en.wikipedia.org/wiki/Standard_ML) and OCaml. Moreover, F# initially had a twin project at Microsoft Research Cambridge named SML.NET, which aimed at bringing Standard  ML (SML) to the .NET platform.

F# Version 1

The first release took place in December of 2004, labelled as a Microsoft Research project. This means that at that time, it didn't have the status of a Microsoft product, although it was providing integration with Visual Studio 2003 and Visual Studio 2005 Beta.

F# Version 1.1

Released in October 2005, this version is signified by bringing its object-oriented features to the language. It represents the milestone where F# had turned into a genuinely multi-paradigm language.

"The major addition to the F# language itself in this release is what we're calling the "F# Object and Encapsulation Extensions". This combines what I've found to be the best features of the .NET object oriented paradigm with the functional programming model that lies at the core of F#. This means that F# has become a mixed functional/imperative/object-oriented programming language."Don Syme (http://blogs.msdn.com/b/dsyme/archive/2005/08/24/455403.aspx) in his blog on August 23, 2005.

Another feature that makes version 1.1 ponderous is introducing of F# Interactive, also known as FSI, the tool providing F# scripting capabilities and the manner of code development by frequenting REPL along the course. This release was suitable for use within the final version of Visual Studio 2005.

After the version 1.1 milestone, the language continued to have frequent releases and introduce new major features. On October 17, 2007, Microsoft Corp officially declared a transition of F# from research to product development organization, aiming to productize F# into another first class programming language on the .NET platform fully integrated into Visual Studio. Following another year of intensive work, in December 2008 came the announcement of F# to be shipped as the integral part of Visual Studio 2010.

F# Version 2

In February 2010, it was announced that the version of F# to be included into Visual Studio 2010 will be incremented to 2.0. Shortly afterwards, in April 2010, F# 2.0 was released, indeed, as part of Visual Studio 2010 and also as the matching installation for Visual Studio 2008 and standalone compiler for other platforms. The F# version 2.0 milestone reflects almost 5 years of F# 1.x evolvement, which has added to object-oriented facilities on top of its functional programming base such major language features as active patterns, sequence expressions, asynchronous and parallel computations, and significant library refinements. Also, it worth noting that integration with Visual Studio provided developers using F# on Microsoft platform with world class tooling such as, debugging, IntelliSense, and the project system. At this point, F# 2.0 is completely ready for enterprise software development.

Also, F# version 2.0 delineates the stage of language evolvement that is usually recognized as full-fledged F# in comparison with primordial versions that lack some core features.

F# Version 3

Another intensive year and a half of F# evolvement brought to life a preview version of F# 3.0 in the September of 2011. This version proclaimed targeting information-rich programming.

"A growing trend in both the theory and practice of programming is the interaction between programming and rich information spaces. From databases to web services to the semantic web to cloud-based data, the need to integrate programming with heterogeneous, connected, richly structured, streaming and evolving information sources is ever-increasing. Most modern applications incorporate one or more external information sources as integral components. Providing strongly typed access to these sources is a key consideration for strongly-typed programming languages, to insure low impedance mismatch in information access."Technical Report MSR-TR-2012-101 of Microsoft Research (http://research.microsoft.com/apps/pubs/?id=173076).

With this goal, the language acquires query expressions, an incredibly powerful mechanism of type providers along with numerous reference implementations of type providers for major enterprise information exchange technologies. It took another year for F# 3.0 to get released as part of Visual Studio 2012 in September 2012.

The following year, 2013, signified an explosive burst of activity around F#, indicating that the language reached some critical mass. Xamarin (https://xamarin.com) announced support for F#, reaching multiplatform mobile development, and multiple break-through developments took place in the fields of machine learning, cloud programming, finance time series, numeric libraries, and type providers.

This period also signifies strong cross-platform open engineering community effort, factually turning F# into an open source cross-platform shared implementation not fundamentally dependent on Microsoft anymore. The Microsoft affiliation with F# got limited to Visual F#, also known as The F# Tools for Visual Studio, and even in this space, Microsoft turned to enabling community contributions and open engineering.

F# Version 4

Announced in late 2014, F# 4.0 provided some new capabilities: type constructors were turned into first-class functions, mutable values could be captured by closures, and there were high-dimensional arrays, slicing syntax for lists, normalized collections in core run-time libraries, among others.

Getting you equipped with the vision of more than a dozen years of the language's exciting historical evolution, I now turn to the dissection of language features. In this chapter, these features are to be outlined only briefly, postponing the complete details of idiomatic usage to later chapters.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset