• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Functional Languages

I am not sure about these: OCaml, Haskell, F#,

However, either one of these may be supported by .NET If this is the case you could easily interface with stored .NET/CLR/CLS routines coded in C++/VB at the firms that implement the more popular languages.

So really, you need a list of interoperable languages within the .NET framework. If OCaml, Haskell, F# is on the list you are in luck.
 
Regarding which one is supported by .net, F# is a microsoft product built on top of .NET, so obviously it's got that going for it. There's one catch: AFAIK it's a beta product from their research group, so there's no guarantee that is going to see a commercial release. I'm not aware of .NET implementations for other languages, but that doesn't mean they don't exist.

Also, as far as the ability of languages running on .NET to easily integrate to microsoft's c++/vb... that is true only for code that has been ported to the .net framework itself; e.g. VB.NET code or VC++ using "managed code." Lots of places which are "Microsoft shops" still use the old VB6 or VC++ without the .NET framework.

As far as which one may catch on in the finance industry, I'm speaking from pure ignorance. But as a long-time software developer, I can say with absolute confidence, that if you pick OCaml, then F# will take off in adoption, and that if you learn F#, then your next job will have absolutely no use for it. ;-) Etc., etc. Personally, I'd rather not learn yet another language "just in case." OTOH if you've never used a functional language it's good to have working knowledge of at least one, just because gives you a different way to think about problems. So from that point of view, you can pick any of them and benefit.
 
Is MATLAB a functional language as it does not modify variable inside a function?
Does any other institute apart from Jane Street use a functional language like OCAML?
 
Is MATLAB a functional language as it does not modify variable inside a function?
Does any other institute apart from Jane Street use a functional language like OCAML?

Pass-by-value a functional language does not make. I haven't used matlab lately, but my recollection is that it doesn't do list transformations nor function composition and lambda functions. Those are necessary components of functional languages.

R is very functional, which has brought my great joy of late.
 
Is anybody using functional languages (OCaml, Haskell, F#, List or anything in between) in finance? Does anybody knows about it?

I know Jane Street Capital (Jane Street Capital, LLC and http://cufp.galois.com/slides/2006/YaronMinsky.pdf) uses OCaml for almost everything which is really interesting but I would like to know if there is any other places that take advantage of functional language.

When the Baruch crew attended the information session at Credit Suisse not so long ago, one of the quants we talked to mentioned that they use F#.
 
While Janes Street is unique in using functional language firm-wide, there are many small units in firms that decide what they use independently.
That means there are numerous places where these languages are used and we just have no way to know about it.
What the group you work with use is more relevant that what the firm is known for using.
 
I've been looking around for some information on the same subject. I came across a good blog that has a few interesting posts:

Chris Donnan : Programming - Brooklyn Style functional programming

You'll notice the link to a recorded presentation about Jane Street and OCaml given at CMU. Great video by the way, I highly recommend it.

I wouldn't be surprised to see functional languages take root in the financial industry as their performance creeps closer to Java/C#...
 
Looking at the site right now and it looks very interesting.

I wouldn't be surprised to see functional languages take root in the financial industry as their performance creeps closer to Java/C#
Correction: Ocaml is known to blow by C# and Java. It's speed is comparable to C/C++. Haskell could be as fast as C/C++ if you know what you are doing.

The interesting thing about functional programming nowadays is that there are new languages working on Top of the JVM (Scala, Clojure, etc) which which theoretically should run as fast as Java.
 
Correction: Ocaml is known to blow by C# and Java. It's speed is comparable to C/C++. Haskell could be as fast as C/C++ if you know what you are doing.

That's news to me! Do you have any resources such as academic publications or benchmark studies about the performance of Ocaml or Haskell?

Do you have a preference of either language? I'm very interested in taking some free time to learn one.
 
The first thing that comes to mind is:

http://shootout.alioth.debian.org/

The aforementioned blog has a link to this too.

Ocaml vs. C++
OCaml benchmarks | x64 Ubuntu : Intel quad-core Computer Language Benchmarks Game

Haskell vs. C++
Haskell GHC benchmarks | x64 Ubuntu : Intel quad-core Computer Language Benchmarks Game

Both Functional Languages are close in terms of performance and memory usage, but definitely slower than C++. I'm interested to see what can be done with Haskell or Ocaml if "you know what you're doing"...
 
Look at the tests. There are specific tests where the Ocaml and Haskell are better than C/C++. Those are very particular examples. You also need to look at your hardware and the problem at hand. For instance, there are was no thread support in OCaml (maybe there is now).

There are problems that are better suited to functional languages and some others that are better suited for imperative languages. Also, functional languages tend to be more expressive so there is less code to write and maintain while keeping the code clear. These are all tradeoffs and there is no silver bullet.

There is a link somewhere on the web with a graphical representation of the results from the "shootout". That will give you a better picture. I have it somewhere. I will post it as soon as I find it.
 
I don't have as much experience with Ocaml or Haskell as I would like to have.

I did some Ocaml at some point in my life but I haven't used it recently. I would like to learn Haskell since there is a huge community out there (look at http://hackage.haskell.org/packages/hackage.html ).

Regarding your last question, it is hard to say. It depends on what you are trying to accomplish.
 
Logic programming

My two cents...

Although not a language per se. Some of te rule specification scripts on the CEP space out there use prolog "like" syntax. Which is not functional programming, but is not imperative either!

C++:
rule LongBBANDUSDJPY

	salience -500
	no-loop
	when
		TickIndex(assetName=="USDJPY", $current_tick : last_tick_id, $last_tick_id : previous_tick_id)
		
		$tick : Tick($id : id == $current_tick, $PRICE : price, $timeStampAttr : timeStampAttr) 
		$last_tick : Tick(id == $last_tick_id, $LAST_PRICE : price) 											 
		$LBBAND_20 : TechnicalIndicator (		
                                        assetName == "USDJPY", 
					indicatorName == "LBBAND", 
					indicatorPeriod ==  0.00020s, 
					id == $ti_index_LBBAND_20.previous_indicator_id, 
					$LAST_LBBAND_20 : value)
		
		eval( $PRICE <  $LBBAND_20 )
	then
		new OpenPosition("LongBBANDUSDJPY", "USDJPY", $id, "GO LONG", $timeStampAttr, $PRICE).execute();
end

About functional. I used scheme a wild ago for some AI work and is very intuitive for traversing trees so is fast at the development level, but execution wise it was still slower than c/c++.
 
Back
Top