Choosing Quantitative Finance Libraries for F#
Summary
The discussion asks whether F# has an established standard library for quantitative finance and what kinds of financial work such a library supports. The answers report no broadly accepted, comprehensive F#-specific package, while pointing to a varied ecosystem of commercial and open-source tools. Since F# runs on .NET, developers can also call libraries written for other .NET languages, and may be able to connect to tools such as QuantLib or use vendor-provided wrappers.
The replies emphasize that available tools cover different needs and that a library choice depends on the task. They mention derivatives pricing and quantitative modeling as areas where F# support may be limited, and suggest that practical trading systems often need in-house extensions. Some claims are personal opinions about language adoption and ecosystem prospects, rather than comparative benchmarks. The document gives no systematic feature survey, performance results, or validated list of recommended libraries.
Key ideas
- The discussion identifies no widely agreed, comprehensive quantitative finance library built specifically for F#.
- F# can use libraries available across the .NET ecosystem, including through language wrappers.
- Library suitability depends on the financial modeling task and the required functionality.
- Trading strategies may require in-house extensions beyond general-purpose libraries.
- Opinions about F# adoption in finance are not supported by performance comparisons in the discussion.
Tags
Full text
# What is the industry standard Quant Finance modeling library for F# # What is the industry standard Quant Finance modeling library for F# If it exists, has been agreed on, and F# programmers have used it extensively, I would like to know what is the industry standard Quant Finance library for F#. What typical finance scenario(s) have you had success with for this library? ## Answer by Phillip Trelford (score 6, accepted) https://quant.stackexchange.com/a/7094 I'm not aware of an industry-standard Quant Finance library in the F# space, but there are plenty of high-quality commercial and open source alternatives. See the F# Software Foundation's Math Stacks page. F# is used in a wide range of finance scenarios.You can read some experience reports from the F# Software Foundation home page. ## Answer by Matt Wolf (score 6) https://quant.stackexchange.com/a/7092 - In my opinion F# will never ever take off in ways C++ or C# has become popular. There are way too many competitive functional languages out there and if you program functionally why would you ever want to lock yourself into a MS product, at least that is an argument I have heard multiple times. - There is no comprehensive F# library out there right now that tackles derivatives pricing algorithms or quantitative methods applied to financial modeling, period. - I highly recommend you to look at C++ libraries and some C# libraries (which perform more and more closely to their C++ brothers, throughput and latency wise). There is just not enough support for functional language libraries in the broader finance community yet, and to be honest I do not think there will ever be sufficient interest in order to make it worthwhile to run a whole architecture on a functional language. The reason I say that is because I already see lots of effort put in by MS and other vendors to open up C++ and especially C# more and more to handle work loads that were the core domain of functional languages before. Examples that show how C# (.Net) really pushes onto the turf of other competing languages: Actor model (and IPC communication) State machine compile time creation (async, await type concurrent programming) want static typing? check; strong typing? check; dynamic typing? check; object type inference? check tpl dataflow, concurrent data flow processing complex event processing (MS has its own product out there that tightly integrates with .Net and got pretty good reviews) A lot of that stuff was previously the domain of Haskell or Erlang, not so anymore. ## Answer by SRKX (score 3) https://quant.stackexchange.com/a/7088 F# is a relatively recent programming language: it was only included with Visual Studio since the 2010 version. Therefore, there is little chance that programmers had the time to agree on a common library, especially given the fact that Quantitative Finance is a broad field and hence different libraries might be better in specific areas. I still think the question deserves an answer because F# is being more and more used in Quantitative Finance and I guess programmers in the field will start wondering about a reference library in the future. First of all, it is important to remember that F# is part of the .Net framework. Hence, you have to keep in my that any library being used nowadays in another language of the framework (I'm especially thinking about C#) can be used from F#. For example, as mentioned by phi, you will be able to use Quantlib. The thing is, to be able to leverage the advantage of the functional programming paradigm which is the main advantage of F#, you would have to create a wrapper around a library that hasn't been done especially for that language. Some of the existing libraries, such as NAG, are starting to make F# wrappers so there is a good chance that more wrappers will be available in the future. Finally, let's just say again that in order to make profitable strategies, you will not be able to solely rely on available libraries, you will have to implement extensions in-house. ## Answer by zuiqo (score 0) https://quant.stackexchange.com/a/7086 Unfortunately, the most there is seems to be the C++ QuantLib. I am not overly familiar with F#, but i assume there is a way to access C++ libraries. Its documentation is pretty much nonexistent, however Mark Joshi has published a very good book on Design Patterns with C++, which will help you get started. You may be able to utilize the methods from QL in your system, but implement your own code in F#, but that heavily depends on your usage scenario (maybe you could elaborate on that a bit more?). Another way would be to write most of your system in C++ (or anything else, Java or Python offer decent implementations of QL) and only write only some modules in F#, depending on your needs. This, however, can quickly become a huge mess, and needs to be planned carefully. Weight the advantages of using an at least commonly used library. On a different note, Microsoft has a case study on F# in banking, but unfortunately they do not answer your question, however it may serve you as a resource for further research: http://www.microsoft.com/casestudies/Case_Study_Detail.aspx?casestudyid=4000006794
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.