2000 · 15 citations · 6 references
ComputingComputer EngineeringComputer ScienceCompilersProgramming LanguagesTheory Of ComputationAbstract Syntax TreesAutomata TheoryCompiler ConstructionComputational ComplexityType CheckingType SystemsPattern Matching
Modern, statically typed, functional languages define functions by pattern matching. Although pattern matching is defined in terms of sequential checking of a value against one pattern after another, real implementations translate patterns into automata that can test a value against many patterns at once. Decision trees are popular automata. The cost of using a decision tree is related to its size and shape. The only method guaranteed to produce decision trees of minimum cost requires exponential match-compilation time, so a number of heuristics have been proposed in the literature or used in actual compilers. This paper presents an experimental evaluation of such heuristics, using the Standard ML of New Jersey compiler. The principal finding is that for most benchmark programs, all heuristics produce trees with identical sizes. For a few programs, choosing one heuristic over another may change the size of a decision tree, but seldom by more than a few percent. There are, however, machine-generated programs for which the right or wrong heuristic can make enormous differences: factors of 2-20.
6
The implementation of functional programming languages
Microprocessors and Microsystems · 1987 · 1.1K citations
Christoph M. Hoffmann, Michael J. O’Donnell · Journal of the ACM · 1982 · 440 citations · Full text
Compiling a functional language
Luca Cardelli · 1984 · 154 citations · Full text
The Complexity of Trie Index Construction
Douglas E. Comer, Ravi Sethi · Journal of the ACM · 1977 · 56 citations · Full text