Welcome, Guest. Please Login
Algorithmic Trading Forum
 
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Functional programming languages (Read 53469 times)
Baltar
Newbie
*
Offline



Posts: 11
Tokyo
Gender: male
Functional programming languages
07/06/08 at 19:07:17
 
Here's an interesting alternative to the usual set of imperative languages.  Jane Street Capital use a functional programming language for all their development.  They are using OCaml.  See the following paper:

Adventures of a functional programmer on Wall Street
www.janestcapital.com/yaron_minsky-cufp_2006.pdf
Back to top
 
 
  IP Logged
Co0olCat
Forum Moderator
*****
Offline



Posts: 128

Gender: male
Re: Functional programming languages
Reply #1 - 07/06/08 at 19:51:59
 
Hi Baltar,

It is interesting presentation.
There is intriguing aspect, which I think answers most of the questions: they are looking for people able to program in OCaml. After 3 years since the presentation was written I do not see that OCaml is dominating language (Is it?).
As for me, I am reluctant to spend time to learn it since fast code I will produce with C/C++. Any statistical and econometric procedures I will find in R and unwrap them to use in my code.
So the question is... why this relatively new language is better? Do we invent bike again?
Comments...


Regards,
T.  :)
Back to top
 
 

"Yesterday is history. Tomorrow is a mystery. But today is a gift, and that is why it's called the present."
WWW timuryusupov   IP Logged
Baltar
Newbie
*
Offline



Posts: 11
Tokyo
Gender: male
Re: Functional programming languages
Reply #2 - 07/07/08 at 01:49:35
 
Co0olCat wrote on 07/06/08 at 19:51:59:
Hi Baltar,

It is interesting presentation.
There is intriguing aspect, which I think answers most of the questions: they are looking for people able to program in OCaml.


Now the good people come to them.  It seems like a gamble though.  

Quote:
After 3 years since the presentation was written I do not see that OCaml is dominating language (Is it?).


Much of the hard-core functional programming focus seems to be on Haskell these days.  

Quote:
As for me, I am reluctant to spend time to learn it since fast code I will produce with C/C++. Any statistical and econometric procedures I will find in R and unwrap them to use in my code.
So the question is... why this relatively new language is better? Do we invent bike again?


Its always good to use the most suitable language for the problem domain (and even alternate languages for sub-domains).  Pure, functional languages fit into the implementation domain somewhere, but I'm not sure where. (Personally, I can't program in OCaml either and use C++ and Python, but its interesting to see that some company uses an alternative to the traditional languages.)

Back to top
 
 
  IP Logged
Algo Designer
Forum Administrator
*****
Offline

Nihil desperandum

Posts: 182
Sydney
Gender: male
Re: Functional programming languages
Reply #3 - 07/08/08 at 13:54:59
 
IMHO, both functional and imperative programming models can happily co-exist even in the context of the same strategy. The latter can be nicely layered with the "quant core" (signal generator or whatever it might be) implemented in the functional language. The order placement optimisation, on the other hand, requires state. This is where the imperative approach comes in handy. I am hypothesizing here.

In my practical experience, the usage of functional language did not go beyond prototyping. I have always found it convenient to "port" solutions to a more traditional language (Java in my case) and optimise things for performance where needed. This is just my personal preference.

Back to top
 
 

"Success is the sum of small efforts, repeated day in and day out..."
  IP Logged
Miles Sabin
Newbie
*
Offline

I like this forum!

Posts: 1

Re: Functional programming languages
Reply #4 - 07/08/08 at 16:36:27
 
If you're stuck with targeting the JVM or the CLR then you might be interested in taking a look at Scala (an object-functional language which interoperates extremely well with Java, http://www.scala-lang.org/) or F#(a close relative of OCaml which targets the CLR and I believe interoperates reasonably well with other CLR languages, http://research.microsoft.com/fsharp/fsharp.aspx).
Back to top
 
 
  IP Logged
qroach
Full Member
***
Offline



Posts: 102
London
Gender: male
Re: Functional programming languages
Reply #5 - 07/11/08 at 17:41:40
 
Functional languages have some advantages over imperative ones. At the moment, the argument goes like this.
1) Imperative languages continue borrowing from functional languages whenever they meet some problems. Examples are Template metaprogramming in C++ (Generics in C#/Java to some extend), lambda-calculus (closures in various languages). So, why not use functional languages all along then?

2) Writing code is difficult, learning curve is steep. But the code produced is less buggy. It is very often the case in Haskell that once it compiles - it has no bugs.

3) Multi-core, Multi-processor architectures are becoming cheaper, stronger and more accessible. Writing multi-threaded program even on single CPU machine is hard in general. Parallelizing algorithms is hard too. Programs written in functional languages are easily parallelizable. The closest alternative to Haskell-style parallelization in C++ is openPM.
Back to top
 
 
  IP Logged
Z
Newbie
*
Offline

Reality is not your
friend.

Posts: 8
London
Gender: male
Re: Functional programming languages
Reply #6 - 07/31/08 at 06:03:53
 
I've used Haskell back in my uni days. I also heard a lot of good things about Erlang. Would love to code the "business-logic" side of things in a functional language. Alas, there are many, many reasons why this is unlikely to happen any time soon.
Back to top
 
 
  IP Logged
stargrazer
Newbie
*
Offline

I like this forum!

Posts: 7

Re: Functional programming languages
Reply #7 - 10/05/08 at 12:57:55
 
Co0olCat wrote on 07/06/08 at 19:51:59:
As for me, I am reluctant to spend time to learn it since fast code I will produce with C/C++.


Boost [1]is a popular C++ Library.  Within it are a number of add-ons providing functional programming ability to the multi-paradigm programing language C++.  One of the newest arrivals is Phoenix.  [2].  One add-on which has been around for a while is Lamba.  [3]

[1]  http://www.boost.org/doc/libs/1_36_0/libs/libraries.htm#Function-objects
[2]  http://www.boost.org/doc/libs/1_36_0/libs/spirit/phoenix/doc/html/index.html
[3]  http://www.boost.org/doc/libs/1_36_0/doc/html/lambda.html


Back to top
 
 
  IP Logged
Lucky711
Newbie
*
Offline

I like this forum!

Posts: 1

Re: Functional programming languages
Reply #8 - 04/07/09 at 03:51:58
 
I've been using / learning Scala and am quite impressed so far...  That it is so workable with Java is a huge plus for it as well.
Back to top
 
 
  IP Logged
Sergei Drannikov
Newbie
*
Offline

I like this forum!

Posts: 1

Re: Functional programming languages
Reply #9 - 04/07/09 at 06:56:47
 
I believe that Scala is a very likely candidate for being the 'next-gen' language for the JVM platform. Its benefits include being full blown OOP (even more so than Java in a sense), full blown FP, static typing (though having many benefits of dynamic typing by employing very careful and intelligent trade-offs), 100 % compatibility with JVM, to name just a few. It's perfectly suitable for financial institutions having large investments in Java IMHO.

Same things can be said for F# on .NET platform.
Back to top
 
 
  IP Logged
Alexander Temerev
Newbie
*
Offline

Mercata facti
consequens

Posts: 4
Geneva, Switzerland
Gender: male
Re: Functional programming languages
Reply #10 - 04/07/09 at 10:39:57
 
I've considered using OCaml myself for future projects. It differs from other functional languages because it's FAST. It is probably the only functional programming language that can match C/C++ in speed (and get things done with much more clear and concise code — if you know how FP).

Scala is good as well and it is fully interoperable with Java. However, Scala's performance is not that good...
Back to top
 
 
Alexander Temerev temerev   IP Logged
qroach
Full Member
***
Offline



Posts: 102
London
Gender: male
Re: Functional programming languages
Reply #11 - 04/07/09 at 12:37:40
 
I have been in one company on interview some time ago and they use Scala for Monte-Carlo option pricing. They proudly stated that they haven't noticed any particular problems with speed.

Talking to other companies I also noticed that all Java-shops end up having a grid of computers (may be just a few PCs, or 30-40-100s).

It might be the case that C++ might suddenly half-die, given some imperfections accumulated over time. It just needs a final blow.

Discaimer: I am C++ programmer myself for 10+ years and would rather it doesn't die soon, but I have always been impressed with functional languages (since may be 1st year of uni).
Back to top
 
 
  IP Logged
Algo Designer
Forum Administrator
*****
Offline

Nihil desperandum

Posts: 182
Sydney
Gender: male
Re: Functional programming languages
Reply #12 - 04/07/09 at 12:41:33
 
Scala is certainly a very elegant language, but I also heard that it is still not on par with Java performance-wise. I am wondering if any members of this forum implemented a trading strategy in the former.

I should take a look at OCaml...
Back to top
 
 

"Success is the sum of small efforts, repeated day in and day out..."
  IP Logged
Algo Designer
Forum Administrator
*****
Offline

Nihil desperandum

Posts: 182
Sydney
Gender: male
Re: Functional programming languages
Reply #13 - 04/07/09 at 13:02:14
 
qroach wrote on 04/07/09 at 12:37:40:
...
It might be the case that C++ might suddenly half-die, given some imperfections accumulated over time. It just needs a final blow.

Discaimer: I am C++ programmer myself for 10+ years and would rather it doesn't die soon, but I have always been impressed with functional languages (since may be 1st year of uni).


As much as I like C, I perceive C++ as a syntactical Frankenstein. It will last for a while though. I have progressively migrated most of my work to Java over the last 9 years.

Disclaimer: I have been programming in C/C++ since I was a teenager (it's scary to put the number of years...) and Java since 1997. Although I have always liked functional languages, I have never used them in production applications, only in throw-away prototypes.
Back to top
 
 

"Success is the sum of small efforts, repeated day in and day out..."
  IP Logged
Pages: 1
Send Topic Print