Implementing Functional Languages with Fast Equality, Sets and Maps: an Exercise in Hash Consing. Goubault, J.
abstract   bibtex   
We investigate hash consing, a memory allocation strategy for functional languages. Though the idea is not new, its systematic use as a foundation for the run-time system of a language is new. We call this systematic approach maximal sharing. This strategy is shown to be implementable in practice with small speed and space penalties, while o ering great opportunities to save space and execution time in big projects. Besides, it paves the way towards more e cient implementations of very desirable data structures like sets and maps (set-theoretic functions of nite domain) 23], opening the door to a whole slew of set- and map-based functional languages like POPS-Lisp 18] and HimML 20], a variant of Standard ML written by the author. The average-case complexities of operations on sets and maps are investigated, and shown to be quite good indeed. Computation sharing and incremental computation are brie y considered in this framework. Garbage collection techniques are reviewed to decide of their suitability in a maximal sharing environment. Stop-and-copy and its variants are almost impossible to implement; however, a good surprise awaits us, as mark-and-sweep becomes fast in a maximal sharing environment. Finally, benchmarks are done to get an idea of the cost of maximal sharing.
@article{goubault_implementing_nodate,
	title = {Implementing {Functional} {Languages} with {Fast} {Equality}, {Sets} and {Maps}: an {Exercise} in {Hash} {Consing}},
	abstract = {We investigate hash consing, a memory allocation strategy for functional languages. Though the idea is not new, its systematic use as a foundation for the run-time system of a language is new. We call this systematic approach maximal sharing. This strategy is shown to be implementable in practice with small speed and space penalties, while o ering great opportunities to save space and execution time in big projects. Besides, it paves the way towards more e cient implementations of very desirable data structures like sets and maps (set-theoretic functions of nite domain) 23], opening the door to a whole slew of set- and map-based functional languages like POPS-Lisp 18] and HimML 20], a variant of Standard ML written by the author. The average-case complexities of operations on sets and maps are investigated, and shown to be quite good indeed. Computation sharing and incremental computation are brie y considered in this framework. Garbage collection techniques are reviewed to decide of their suitability in a maximal sharing environment. Stop-and-copy and its variants are almost impossible to implement; however, a good surprise awaits us, as mark-and-sweep becomes fast in a maximal sharing environment. Finally, benchmarks are done to get an idea of the cost of maximal sharing.},
	language = {en},
	author = {Goubault, Jean},
	pages = {42},
}

Downloads: 0