Hostname: page-component-7479d7b7d-qlrfm Total loading time: 0 Render date: 2024-07-13T20:00:16.962Z Has data issue: false hasContentIssue false

Functional programming with the FC++ library

Published online by Cambridge University Press:  07 June 2004

BRIAN MCNAMARA
Affiliation:
College of Computing, Georgia Institute of Technology, GA, USA, 801 Atlantic Dr. Atlanta, GA 30332-0280
YANNIS SMARAGDAKIS
Affiliation:
College of Computing, Georgia Institute of Technology, GA, USA, 801 Atlantic Dr. Atlanta, GA 30332-0280
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

We describe the FC++ library, a rich library supporting functional programming in C++. Prior approaches to encoding higher order functions in C++ have suffered with respect to polymorphic functions from either lack of expressiveness or high complexity. In contrast, FC++ offers full and concise support for higher-order polymorphic functions through a novel use of C++ type inference. The FC++ library has a number of useful features, including a generalized mechanism to implement currying in C++, a “lazy list” class which enables the creation of “infinite data structures”, a subtype polymorphism facility, and an extensive library of useful functions, including a large part of the Haskell Standard Prelude. The FC++ library has an efficient implementation. We show the results of a number of experiments which demonstrate the value of optimizations we have implemented. These optimizations have improved the run-time performance by about an order of magnitude for some benchmark programs that make heavy use of FC++ lazy lists. We also make an informal performance comparison with similar programs written in Haskell.

Type
Article
Copyright
© 2004 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.