
TL;DR
This paper introduces a novel approach to source-code generation that uses functors to embed action code, enhancing type safety and error localization in generated code for functional languages.
Contribution
It proposes generating closed functors for source-code tools, enabling type-checked code instantiation and improved error localization, with implementations for Standard ML, OCaml, and Haskell.
Findings
Implemented lexer and parser generators based on functor technique
Enhanced type safety and error localization in generated code
Demonstrated applicability across multiple functional languages
Abstract
Existing source-code-generating tools such as Lex and Yacc suffer from practical inconveniences because they use disembodied code to implement actions. To prevent this problem, such tools could generate closed functors that are then instantiated by the programmer with appropriate action code. This results in all code being type checked in its appropriate context, and it assists the type checker in localizing errors correctly. We have implemented a lexer generator and parser generator based on this technique for Standard ML, OCaml, and Haskell.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
