The Design and Implementation of BER MetaOCaml
- Oleg KiselyovAffiliated withUniversity of Tsukuba
MetaOCaml is a superset of OCaml extending it with the data type for program code and operations for constructing and executing such typed code values. It has been used for compiling domain-specific languages and automating tedious and error-prone specializations of high-performance computational kernels. By statically ensuring that the generated code compiles and letting us quickly run it, MetaOCaml makes writing generators less daunting and more productive.
The current BER MetaOCaml is a complete re-implementation of the original MetaOCaml by Taha, Calcagno and collaborators. Besides the new organization, new algorithms, new code, BER MetaOCaml adds a scope extrusion check superseding environment classifiers. Attempting to build code values with unbound or mistakenly bound variables (liable to occur due to mutation or other effects) is now caught early, raising an exception with good diagnostics. The guarantee that the generated code always compiles becomes unconditional, no matter what effects were used in generating the code.
We describe BER MetaOCaml stressing the design decisions that made the new code modular and maintainable. We explain the implementation of the scope extrusion check.
- The Design and Implementation of BER MetaOCaml
- Book Title
- Functional and Logic Programming
- Book Subtitle
- 12th International Symposium, FLOPS 2014, Kanazawa, Japan, June 4-6, 2014. Proceedings
- pp 86-102
- Print ISBN
- Online ISBN
- Series Title
- Lecture Notes in Computer Science
- Series Volume
- Series ISSN
- Springer International Publishing
- Copyright Holder
- Springer International Publishing Switzerland
- Additional Links
- Industry Sectors
- eBook Packages
To view the rest of this content please follow the download PDF link above.