Accepted for the Haskell Workshop, 2004.
|
Extension languages enable users to expand the functionality of an application without touching its source code. Commonly, these languages are dynamically typed languages, such as Lisp, Python, or domain-specific languages, which support runtime plugins via dynamic loading of components. We show that Haskell can be comfortably used as a statically typed extension language, and that it can support type-safe dynamic loading of plugins using dynamic types. Moreover, we discuss how plugin support is especially useful to applications where Haskell is used as an embedded domain-specific language (EDSL). We explain how to realise type-safe plugins using dynamic types, runtime compilation, and dynamic linking, exploiting infrastructure provided by the Glasgow Haskell Compiler. We demonstrate the practicability of our approach with several applications that serve as running examples. |
The full text of the paper can be downloaded: (ps.gz ,ps ,pdf)
hs-plugins LibraryThe source code for the hs-plugins library
referenced in the paper can be downloaded from:
http://www.cse.unsw.edu.au/~dons/hs-plugins
Check the nightly cvs snapshots for the latest code.
@inproceedings{PSSC04,
author = {Andr{\'e} Pang and Don Stewart and Sean Seefried and Manuel M. T. Chakravarty},
title = {Plugging Haskell In},
booktitle = {Proceedings of the ACM SIGPLAN workshop on Haskell},
year = {2004},
isbn = {1-58113-850-4},
pages = {10--21},
location = {Snowbird, Utah, USA},
doi = {http://doi.acm.org/10.1145/1017472.1017478},
publisher = {ACM Press},
}
make infrastructure to compile and link against the
plugins library. They live in the examples/ subdirectory
of hs-plugins.