Monday, 9 October 2017

A simple Concestor dictionary

The F# Journal just published an article:
"This article describes the natural extension of our Concestor data structure to purely functional dictionaries, equivalent to the built-in F# `Map`. As for sets, we demonstrate substantial performance gains both in microbenchmarks as well as a simple dictionary data compressor..."
If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Sunday, 8 October 2017

What are the advantages of F# over C#

I just stumbled upon this old Stack Overflow post of mine which has been deleted:

The main advantage of F# over C# is much lower development costs (once your developers are familiar with F#, which will probably only take a few weeks).

From my personal experience I would estimate the productivity boost (= drop in development cost) to be 2-10×. This is strongly dependent upon the application, of course. The best cases for F# are applications requiring dense algorithmics (i.e. hard problems) or DSL implementations. The worse cases for F# are primarily where other languages have better tooling, e.g. GUI designer, WSDL code generator.

I consulted for a London-based company in the finance sector for 15 months and, amongst other things:


  • Implemented in F# in 4 hours a feature that had been scheduled to take 3 months of development in C++.
  • Built in F# in 3 months a server with 100x higher throughput, 100x lower latency and 10x better scalability (number of simultaneous client connections) than their legacy C++.
  • They were training around a dozen F# developers when I left.


I am currently consulting for one of the world's largest insurance companies and my predecessor developed an entire pension quote calculator (typically scheduled to take 300-400 man days) entirely in F# in under 100 days with no prior F# experience at all. Performance is 10× better than the C++ that it replaces because the new code avoids unnecessary copying and exploits multicore parallelism. Part of my job here will be to give basic F# training to around 20 people and bring a few people up to expert level.

The Concestor Set

The F# Journal just published an article:
"A set is an abstract data structure that stores its elements without duplicates and permits efficient insertion, removal and search. The most popular concrete implementation of a set is the hash table but this is an inherently mutable collection. Purely functional sets, including the `Set` collection provided by F#, are based upon balanced trees. This article looks at the design and implementation of a new purely functional set that has very different performance characteristics and, in particular, is much faster in some circumstances..."
If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Tuesday, 3 October 2017

Creating a new term-rewrite language

The F# Journal just published an article:
"This article walks through the design and implementation of a simple but remarkably powerful new programming language that uses term rewriting as an evaluation model and, consequently, is well suited to computer algebra..."
If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Friday, 22 September 2017

Struct tuples

The F# Journal just published an article:
"Almost 10 years ago our own HLVM project demonstrated the potential of struct tuples, showcasing huge performance improvements mainly by alleviating stress on the garbage collector. The latest version of F# in Visual Studio 2017 introduces a new feature called struct tuples that allows tuples to be unboxed. This article takes a look at the characteristics of struct tuples in all of the contexts where one might expect observable differences: generic functions, keys in dictionaries, generation survivors, write barriers and multicore paralellism..."
If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Thursday, 21 September 2017

Automating a human compiler: part 2

The F# Journal just published an article:
"This series of articles describe our most successful F# project to date. Years later, the solution we implemented in F# still has billions of dollars worth of trade going through it every year and continues to save our client around a million dollars per month. This article describes the first stage of our project: the rapid development of a demo version of our graphical domain-specific language, a business rules engine..."
If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Wednesday, 20 September 2017

Automating a human compiler: part 1

The F# Journal just published an article:
"This series of articles describe our most successful F# project to date. Years later, the solution we implemented in F# still has billions of dollars worth of trade going through it every year and continues to save our client around a million dollars per month. This article provides an overview of the problem we found and the characteristics of our solution that made it so successful..."
If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!