How to develop a programming language adapted to financial instruments?

I work in a finance boutique.

We thought about developing a language for describing financial entities associated with financial markets.

It will be used primarily as a scripting language to replace many processes in spreadsheets and VBA macros.

It should be simple, and in fact, it can invoke various C ++ and C # libraries behind the scenes. It should allow users to abstractly abstract objects that can represent time series (intraday and daily).

It should be fully debugged when the user has a problem, we should be able to execute C ++ / C # code and reproduce the errors. Ideally, it should be run through some mechanism in Excel and return the results to Excel. (unfortunately, almost every person working in the field of finance uses Excel)

If you needed to complete this task, how would you do it?

Do you want to use functional syntax?

Would you develop some scripting language that will be interpreted or you compile it in another language (for example, convert scripts to C ++ or C #)?

I have not found a single open source project for this kind of development, but is there any commercial product that uses this syntax?

EDIT: I read all of your answers, but I will wait more time to select an answer. They are all very helpful opinions though!

EDIT2: I have designated High-Performance Mark as a solution. All your answers are very useful, and I modified them all. He was one of the first answers, and his answer is rather perceptive to us.

+6
finance quantitative-finance computational-finance quantitative
source share
9 answers

I suggest you focus on developing a rich set of classes in your preferred OO language (C # or C ++, although I suspect that it’s easier for you to integrate the former with Excel). This will give you your language to describe financial companies associated with financial markets . When you do this, you should consider whether to continue porting these classes to any specific domain language or just posting them in your user community.

I suspect that your domain has some insurmountable complexity and that the intermediate DSL should be (almost) as complex as your set of classes, and therefore you have little to do by creating it.

Another approach would be to integrate Excel with Mathematica, for which Wolfram creates some kind of toolkit. I have no experience with this, but Mathematica is definitely suitable for any calculations you need to do.

Hi

+10
source share

I would wrap the C ++ libraries in Python.

I would define a package of free classes, which - in essence - was my domain specific language.

I would use the Python language directly based on these two basics. I would not invent my own new syntax. The world does not need another syntax; we have syntax and grammar sufficient for parsing, enough to last until the end of time.

Do you want to use functional syntax? Python has functionality. If you are careful with your Python class design, you can achieve a pure functional style.

Ideally, it should be run through some mechanism in Excel and return the results to Excel.

Since the Python interpreter can be embedded in a C ++ (or C #) application, you can easily create an Excel API. From Excel to the new language, do as little as possible in the C ++ API to trigger Python functionality.

By the way, your Resolver One contest. This is what they do.

+5
source share

ResolverOne ( http://www.resolversystems.com/products/resolver-one/ ) is a combination of Excel and Python. Have you thought about using this?

+3
source share

I would recommend using R.

+3
source share

Another view that uses C #.

Since you already have a powerful general-purpose functional programming tool that your users are familiar with and bought in Excel form, I would like to build a solution around this. You still get the opportunity to use other third-party add-ons and integrated parameters (for example, R and Mathematica).

I would look at managed automation add-ins for custom functions . These are, in fact, C # library projects that use System.Runtime.InteropServices, as the link text describes in this article. For users, these functions are added at the cell level in the usual way using the function wizard and may be more or less what you want. Then this is your DSL. Users can easily integrate functionality into their existing models. It would also be quick to prototype something to test its feasibility. They are completely debugged.

In addition, using Visual Studio Tools for Office, you can access a complete hierarchy of excel objects and even add action bars that can be laid out by dragging and dropping controls for more complex data entry requirements. I believe that you can even use WPF with Excel if you need to add specialized visualizations. If you needed to save the data back to tell Sql Server, you can create a rotation around the validation form using this approach.

I sound like M $ shill! (Just to set the record directly, I do not work for them).

You will need to evaluate the effectiveness of this, and I'm not sure how it will scale.

+3
source share

The fame of Simon Peyton-Jones from Haskell contributed to the article β€œContract Writing: An Adventure in Financial Engineering,” which discussed how functional languages ​​are provided to independently compose executable descriptions of financial derivative contracts. Such a method should be possible with F #.

I believe LexiFi's proposals are aimed at commercializing some of these studies.

+3
source share

Jane Street Capital uses OCaml and writes his experiences here . This is quite interesting when read in a wide format.

In your environment, if you were to follow their model, you could use F # , which began with life as an OCaml dialect, but which of the Course works in the .NET world.

+2
source share

If your core library uses Java, you should take a look at the implementation of DSL in Groovy. There are several podcasts and articles about this, try Googling "DSL Groovy".

+1
source share

Most crunchy financial institutions (or divisions) have already acquired Matlab licenses. I recommend that you take a look at the object-oriented objects offered by Matlab (and indeed their Financial Toolbox ).

Upstairs, I think you get three things:

1) Access to a high-level environment where users can focus on a problem rather than implementation 2) High-quality graphics 3) Full integration with Excel and other productivity packages

I know what you mean by developing a language (as opposed to an application), but consider reinforcing your semantics with a well-known language - this way you avoid the learning curve for your users.

+1
source share

All Articles