Multi-stage programming with functors and monads: eliminating abstraction overhead from generic code
Multi-stage programming with functors and monads: eliminating abstraction overhead from generic code
复制标题
使用仿函数和单子的多阶段编程:消除通用代码的抽象开销
DOI:
10.1007/11561347_18
复制
发表时间:
2005
期刊:
影响因子:
--
通讯作者:
O. Kiselyov
中科院分区:
文献类型:
--
作者:
J. Carette;O. Kiselyov
With Gaussian Elimination as a representative family of numerical and symbolic algorithms, we use multi-stage programming, monads and Ocaml’s advanced module system to demonstrate the complete elimination of the abstraction overhead while avoiding any inspection of the generated code. We parameterize our Gaussian Elimination code to a great extent (over domain, matrix representations, determinant tracking, pivoting policies, result types, etc) at no run-time cost. Because the resulting code is generated just right and not changed afterwards, we enjoy MetaOCaml’s guaranty that the generated code is well-typed. We further demonstrate that various abstraction parameters (aspects) can be made orthogonal and compositional, even in the presence of name-generation for temporaries and other bindings and “interleaving” of aspects. We also show how to encode some domain-specific knowledge so that “clearly wrong” compositions can be statically rejected by the compiler when processing the generator rather than the generated code.
DOI:
10.1007/bfb0035455
发表时间:
1994
期刊:
--
影响因子:
--
作者:
J. Henry;J. Yvon
通讯作者:
J. Henry;J. Yvon
DOI:
10.1007/bfb0053381
发表时间:
1997-01-01
期刊:
ECOOP'97: OBJECT-ORIENTED PROGRAMMING
影响因子:
--
作者:
Kiczales, G;Lamping, J;Irwin, J
通讯作者:
Irwin, J