Difference between revisions of "Haskell in practice"

From HaskellWiki
Jump to navigation Jump to search
m (Add lambdabot, yi and hmp3)
m (Link to "A Comparative Study of Language Support for Generic Programming", and Frag)
Line 51: Line 51:
 
<dt>[http://homepages.cwi.nl/~tromp/cl/cl.html Interpreters for lambda calculus and combinatory logic].</dd>
 
<dt>[http://homepages.cwi.nl/~tromp/cl/cl.html Interpreters for lambda calculus and combinatory logic].</dd>
 
<dt>[[Lambdabot]]<dd>A large IRC bot, dynamically extensible via plugins.
 
<dt>[[Lambdabot]]<dd>A large IRC bot, dynamically extensible via plugins.
  +
<dt>[[Frag]]<dd>A first person 3D game written in Haskell.
 
<dt>[http://www.cse.unsw.edu.au/~dons/yi.html Yi]<dd> An extensible text editor, reminiscent of vim.
 
<dt>[http://www.cse.unsw.edu.au/~dons/yi.html Yi]<dd> An extensible text editor, reminiscent of vim.
 
<dt>[http://www.cse.unsw.edu.au/~dons/hmp3.html hmp3]<dd> A curses-based mp3 player.
 
<dt>[http://www.cse.unsw.edu.au/~dons/hmp3.html hmp3]<dd> A curses-based mp3 player.
Line 90: Line 91:
 
[ftp://ftp.wins.uva.nl/pub/computersystems/functional/reports/JFP_pseudoknotI.ps.Z <STRONG>Benchmarking implementations of functional languages with ``pseudoknot'', a Float-Intensive benchmark</STRONG>] by P. H. Hartel, M. Feeley, M. Alt, L. Augustsson, P. Baumann, M. Beemster, E. Chailloux,C. H. Flood, W. Grieskamp, J. H. G. van Groningen, K. Hammond, B. Hausman, M. Y. Ivory, R. E. Jones, J. Kamperman, P. Lee, X. Leroy, R. D. Lins, S. Loosemore, N. R&ouml;jemo, M. Serrano, J.-P. Talpin, J. Thackray, S. Thomas, P. Walters, P. Weis, and P. Wentworth.<EM>J. Functional Programming</EM>, 6(4):621--655, Jul 1996.
 
[ftp://ftp.wins.uva.nl/pub/computersystems/functional/reports/JFP_pseudoknotI.ps.Z <STRONG>Benchmarking implementations of functional languages with ``pseudoknot'', a Float-Intensive benchmark</STRONG>] by P. H. Hartel, M. Feeley, M. Alt, L. Augustsson, P. Baumann, M. Beemster, E. Chailloux,C. H. Flood, W. Grieskamp, J. H. G. van Groningen, K. Hammond, B. Hausman, M. Y. Ivory, R. E. Jones, J. Kamperman, P. Lee, X. Leroy, R. D. Lins, S. Loosemore, N. R&ouml;jemo, M. Serrano, J.-P. Talpin, J. Thackray, S. Thomas, P. Walters, P. Weis, and P. Wentworth.<EM>J. Functional Programming</EM>, 6(4):621--655, Jul 1996.
   
[http://shootout.alioth.debian.org/great/ The Great Computer Language Shootout]<br>Comparative benchmarks of a number of different languages and compilers, including Haskell with ghc.
+
[http://shootout.alioth.debian.org/ The Great Computer Language Shootout]<br>Comparative benchmarks of a number of different languages and compilers, including Haskell with GHC. GHC ranks first at the time of writing (Early 2006).
  +
*Colin Runciman and David Wakeling (ed.): <EM>Applications of Functional Programming</EM>, UCL Press, 1995, ISBN 1-85728-377-5 HB.<BR>
+
Colin Runciman and David Wakeling (ed.): <EM>Applications of Functional Programming</EM>, UCL Press, 1995, ISBN 1-85728-377-5 HB.<BR>
 
From the cover:
 
From the cover:
 
<BLOCKQUOTE>
 
<BLOCKQUOTE>
 
This book is unique in showcasing real, non-trivial applications of functional programming using the Haskell language. It presents state-of-the-art work from the FLARE project and will be an invaluable resource for advanced study, research and implementation.
 
This book is unique in showcasing real, non-trivial applications of functional programming using the Haskell language. It presents state-of-the-art work from the FLARE project and will be an invaluable resource for advanced study, research and implementation.
 
</BLOCKQUOTE>
 
</BLOCKQUOTE>
  +
  +
Ronald Garcia, Jaakko J�rvi, Andrew Lumsdaine, Jeremy G. Siek, and Jeremiah
  +
Willcock. <em>A Comparative Study of Language Support for Generic
  +
Programming</em>. In Proceedings of the 2003 ACM SIGPLAN conference on
  +
Object-oriented programming, systems, languages, and applications (OOPSLA'03),
  +
October 2003. <br> An interesting comparison of generic programming support across
  +
languages, including: Haskell, SML, C++, Java, C#. Haskell supports all
  +
constructs described in the paper -- the only language to do so.

Revision as of 02:54, 19 February 2006

Haskell in Practice

Applications written in Haskell

The following free Haskell programs may serve as examples for constructing large applications in Haskell.

Real World Applications of Functional Programming
Includes several large applications written in Haskell (Equational Reasoning Assistant, Mitre Speech Recognition System, the LOLITA Natural Language Processing System, ...).
Pugs
An implementation of Perl6.
Monadius
A shoot 'em up game using OpenGL. Takayuki Muranushi also wrote a couple of other games in Haskell.
DoCon, the Algebraic Domain Constructor
The DoCon computer algebra system implements a good-sized piece of commutative algebra. One of the project aims is to test the efficiency of a real-world CA system based on pure functionality and "lazy" computation.
Dumatel, a prover based on equational reasoning
This is a study in combining Computer algebra, Term rewriting and Automatic proofs. The system is presented as a library of Haskell functions.
Postmaster
A mail transport agent (MTA) written in Haskell. The primary focus of the project is to provide an MTA that's a lot more flexible than the current implementations, in particular when it comes to implementing junk mail countermeasures.
Flippi
A simple and lightweight Wiki clone written in plain Haskell 98 using the hierarchical libraries. There is a running trial copy.
AMuZed and ZooM
AMuZed is a graphical editing tool for the creation of mu-charts or microcharts. mu-charts consist of the 'well-defined' part of the Statecharts found in UML -- in that they have a semantics and, via the Z translation, a logic too. ZooM is a tool which takes the .muz file output of a created chart from AMuZed and generates a series of .tex files which contain the Z specification for that chart.
Paradox
A tool that processes first-order logic problems and tries to find finite-domain models for them.
A Partial Evaluator
CheckRDF
A tool for downloading RDF site summaries and showing news in a text file and in an HTML file.
darcs
David's Advanced Revision Control System is yet another replacement for CVS. It is written in Haskell, and has been tested on Linux and MacOS X. It has not yet been optimized for speed, so it runs a little slowly on large projects. darcs includes a cgi script, which can be used to view the contents of your repository.
David Tweeds Haskell Programs
Currently David offers a LaTeX preprocessor and a C++ prettifier.
FstStudio
An application for construction and running of finite state transducers.
Haskell in Space
An asteroids-like game.
A Haskell Compiler Front-End
This is a stand alone version of a compiler front-end, which was built by Norbert Klose as part of his master's thesis and which is described in detail there.
LPS: Language Prototyping System
A project that uses Haskell to build interpreters from monadic semantic descriptions.
Knit
Knit is a component definition and linking language for systems programming based on the Unit component programming model. Knit lets you turn ordinary C code (e.g., bits of the Linux kernel) into components and link them together to build new programs. Since the freedom to do new things brings with it the freedom to make new errors, Knit provides a simple constraint system to catch component configuration errors. Knit also provides a cross-component inliner and schedules initialization and finalization of components.
Knit is released under a BSD-style license, is written in Haskell (and a little C) and includes a C parser and pretty-printer. A useful little utility included in the distribution is a tool for renaming symbols in ELF-format object files.
The current Knit release acts post-compilation: we compile C code as normal and then rename symbols in object files before linking. We are rewriting Knit to act pre-compilation: manipulating the source code before compilation. This will bring the much needed ability to import and export types from modules.
linkchk
A heart-beat monitor for local network links for Linux.
Micro attribute grammar system
This is a small attribute grammar system written in Haskell. It has been bootstrapped and is now included in the set of modules that is distributed with Doaitse Swierstra's parser combinator library.
Paratrooper
A simple action game.
Quake Haskell ;-)
Truth
Truth is a platform for the verification of distributed systems.
TSL
TSL is a language for describing hierarchies of schedulers and reasoning about what kinds of locks can legally be used at each level and what race conditions those locks can prevent.
VOP - Vision of Persistance
VOP is a program that parses POV-Ray scene description files and renders them using OpenGL.
A Web Server written in Haskell
It has been extended to produce HWS-WP, the Haskell Web Server With Plugins.
Interpreters for lambda calculus and combinatory logic.
Lambdabot
A large IRC bot, dynamically extensible via plugins.
Frag
A first person 3D game written in Haskell.
Yi
An extensible text editor, reminiscent of vim.
hmp3
A curses-based mp3 player.

Note that some of the Haskell systems and many of the tools and libraries are written in Haskell as well.

Embedded Domain Specific Languages

Haskell has become quite popular for the development of domain specific languages. Instead of implementing an interpreter or compiler in Haskell, Haskell is enriched by libraries for domain specific data types and functions, that turn Haskell into a domain specific language, for example for describing music, pictures, animations or hardware. Even parsing combinators can be understood as domain specific languages. These embedded languages are filed as tools and libraries.


Reports on Experiences with Haskell

Composing contracts: an adventure in financial engineering by Simon Peyton Jones, Jean-Marc Eber, Julian Seward. ICFP 2000.

Financial and insurance contracts do not sound like promising territory for functional programming and formal semantics, but in fact we have discovered that insights from programming languages bear directly on the complex subject of describing and valuing a large class of contracts.

We introduce a combinator library that allows us to describe such contracts precisely, and a compositional denotational semantics that says what such contracts are worth. We sketch an implementation of our combinator library in Haskell. Interestingly, lazy evaluation plays a crucial role.

See also this article in the Risk Magazine, a journal of the financial engineering industry.

Haskell vs. Ada vs. C++ vs. Awk vs. ..., An Experiment in Software Prototyping Productivity by Paul Hudak and Mark P. Jones, 16 pages.
Description of the results of an experiment in which several conventional programming languages, together with the functional language Haskell, were used to prototype a Naval Surface Warfare Center requirement for Geometric Region Servers. The resulting programs and development metrics were reviewed by a committee chosen by the US Navy. The results indicate that the Haskell prototype took significantly less time to develop and was considerably more concise and easier to understand than the corresponding prototypes written in several different imperative languages, including Ada and C++.

Benchmarking implementations of functional languages with ``pseudoknot, a Float-Intensive benchmark by P. H. Hartel, M. Feeley, M. Alt, L. Augustsson, P. Baumann, M. Beemster, E. Chailloux,C. H. Flood, W. Grieskamp, J. H. G. van Groningen, K. Hammond, B. Hausman, M. Y. Ivory, R. E. Jones, J. Kamperman, P. Lee, X. Leroy, R. D. Lins, S. Loosemore, N. Röjemo, M. Serrano, J.-P. Talpin, J. Thackray, S. Thomas, P. Walters, P. Weis, and P. Wentworth.J. Functional Programming, 6(4):621--655, Jul 1996.

The Great Computer Language Shootout
Comparative benchmarks of a number of different languages and compilers, including Haskell with GHC. GHC ranks first at the time of writing (Early 2006).

Colin Runciman and David Wakeling (ed.): Applications of Functional Programming, UCL Press, 1995, ISBN 1-85728-377-5 HB.
From the cover:

This book is unique in showcasing real, non-trivial applications of functional programming using the Haskell language. It presents state-of-the-art work from the FLARE project and will be an invaluable resource for advanced study, research and implementation.

Ronald Garcia, Jaakko J�rvi, Andrew Lumsdaine, Jeremy G. Siek, and Jeremiah Willcock. A Comparative Study of Language Support for Generic Programming. In Proceedings of the 2003 ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA'03), October 2003.
An interesting comparison of generic programming support across languages, including: Haskell, SML, C++, Java, C#. Haskell supports all constructs described in the paper -- the only language to do so.