Sciweavers

IFL
2005
Springer

Polytypic Syntax Tree Operations

13 years 10 months ago
Polytypic Syntax Tree Operations
Polytypic functional programming has the advantage that it can derive code for generic functions automatically. However, it is not clear whether it is useful for anything other than the textbook examples, and the generated polytypic code is usually too slow for real-life programs. As a real-life test, we derive a polytypic parser for the Haskell 98 syntax and look into other front-end compiler syntax tree operations. We present a types–as–grammar approach, which uses polytypic programming (in both Generic Haskell and Clean) to automatically derive the code for a parser based on the syntax tree type, without using external tools. Moreover, we show that using polytypic programming can even be useful for data–specific syntax tree operations in a (functional) compiler, such as scope checking and type inference. Simple speed tests show that the performance of polytypic parsers can be abominable for real-life inputs. However, we show that much performance can be recovered by applying ...
Arjen van Weelden, Sjaak Smetsers, Rinus Plasmeije
Added 27 Jun 2010
Updated 27 Jun 2010
Type Conference
Year 2005
Where IFL
Authors Arjen van Weelden, Sjaak Smetsers, Rinus Plasmeijer
Comments (0)