`
cookoo
  • 浏览: 646429 次
  • 性别: Icon_minigender_1
  • 来自: Shanghai
社区版块
存档分类
最新评论

Why Function Programming is Important to Financial Modeling?

    博客分类:
  • FP
阅读更多
(Quoted from LexiFi)

LexiFi found that a functional programming language was the most effective tool for developing compositional contract and scenario algebras.

LexiFi users derive important benefits from a functional programming approach, including:

  • Lists.   Functional programming languages offer powerful support for useful pre-defined types such as lists. Lists play a central role in finance where they are used extensively to define schedules. For example, a swap schedule or a Bermuda option exercise schedule may be defined recursively using a list.
  • Specification.   The declarative formalism of functional programming languages is well suited for specifying complex data structures and algorithms, and the interactions between complex data structures and algorithms. In contrast, imperative programming languages tend to reflect the actual behavior of computers: complex types may be extremely difficult to design and maintain. Object-oriented languages are better candidates than imperative languages for implementing a contract algebra. However, they suffer from certain limitations, especially with respect to pattern matching (see " What are the limitations of data-oriented and object-oriented approaches for modeling financial instruments?").
  • Functions.   Functions are "first-class citizens" in functional programming languages: they can be used as arguments of other functions. For example, a "sliding contract" used in a LexiFi simulation is a function that takes a date and a scenario argument and returns a contract. A list of sliding contracts—i.e., a list of functions—is passed to LexiFi's simulator function to run a simulation...

More generally, quoting Don Syme of Microsoft Research:

"Mixed functional/imperative programming is a fantastic paradigm for many programming tasks. Languages such as OCaml and Standard ML provide excellent general purpose programming languages suited to medium-advanced programmers who want simple yet highly expressive tools that boost their productivity, primarily by reducing the error rate, increasing their productivity through type inference, and basically letting them focus on the difficult parts of their applications. ...

Purely functional languages like Haskell are excellent within certain niches, but while laziness and Haskell's very strict control of effects do offer substantial benefits they also pose real problems for interoperability between lazy and strict languages. Purely imperative programming languages like C or Pascal do not provide satisfying mechanisms for abstraction or data manipulation. Purely object oriented languages like Smalltalk are excellent for some dynamic applications but do not provide static guarantees. Typed class-based languages like C# and Java contain a very large number of constructs, and it can sometimes be difficult for programmers to choose how to model their problem, and sometimes result in very large amounts of code just to solve quite simple problems. In contrast, the core constructs of the ML family of languages provide a smaller number of simple, orthogonal constructs which work together to allow for succinct yet efficient solutions to programming problems, and in particular permit common patterns of coding to be abstracted very easily." 


分享到:
评论
1 楼 simohayha 2007-06-04  
  FP对程序员的"内功"要求太高,而现在在国内就像robbin说的不入流的程序员太多了,很多都是直接培训个几个月j2ee或者c#之类的。现在一些所谓的软件学院,也是j2ee或者c#为主。并且一大部分程序员也就是混日子等着30岁转行,像这样环境,fp很难流行起来.

相关推荐

Global site tag (gtag.js) - Google Analytics