ACM Home Page
Please provide us with feedback. Feedback
A monadic approach for avoiding code duplication when staging memoized functions
Full text PdfPdf (383 KB)
Source ACM/SIGPLAN Workshop Partial Evaluation and Semantics-Based Program Manipulation archive
Proceedings of the 2006 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation table of contents
Charleston, South Carolina
SESSION: Meta-programming table of contents
Pages: 160 - 169  
Year of Publication: 2006
ISBN:1-59593-196-1
Authors
Kedar Swadi  Presistent Systems Pvt. Ltd., Pune, India
Walid Taha  Rice University, Houston, TX
Oleg Kiselyov  FNMOC, Monterey, CA
Emir Pasalic  Rice University, Houston, TX
Sponsor
SIGPLAN: ACM Special Interest Group on Programming Languages
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 4,   Downloads (12 Months): 21,   Citation Count: 4
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1111542.1111570
What is a DOI?

ABSTRACT

Building program generators that do not duplicate generated code can be challenging. At the same time, code duplication can easily increase both generation time and runtime of generated programs by an exponential factor. We identify an instance of this problem that can arise when memoized functions are staged. Without addressing this problem, it would be impossible to effectively stage dynamic programming algorithms. Intuitively, direct staging undoes the effect of memoization. To solve this problem once and for all, and for any function that uses memoization, we propose a staged monadic combinator library. Experimental results confirm that the library works as expected. Preliminary results also indicate that the library is useful even when memoization is not used.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

1
2
 
3
J. Aldrich. Open modules: A foundation for modular aspect-oriented programming. Available online from http://www-2.cs.cmu.edu/~aldrich/papers/tinyaspect.pdf, Jan. 2003.
4
 
5
 
6
 
7
C. Calcagno, E. Moggi, and W. Taha. ML-like inference for classifiers. In Proceedings of the European Symposium on Programming (ESOP '04), volume 2986 of Lecture Notes in Computer Science, Springer-Verlag, Mar. 2004.
 
8
 
9
J. Carette and O. Kiselyov. Multi-stage programming with functors and monads: Eliminating abstraction overhead from generic code. In R. Glück and M. Lowry, editors, Proceedings of the ACM International Conference on Generative Programming and Component Engineering (GPCE'05), volume 3676 of Lecture Notes In Computer Science. Springer-Verlag, Sept. 2005.
 
10
 
11
12
 
13
W. DeMeuter. Monads as a theoretical foundation for AOP. In Proceedings of the International Workshop on Aspect-Oriented Programming at ECOOP, volume 1357 of Lecture Notes in Computer Science, page 25. Springer-Verlag, 1997.
 
14
Dynamic Programming Benchmark. Available online from http://www.metaocaml.org/examples/dp, 2005.
15
 
16
J. Eckhardt, R. Kaiabachev, E. Pasalic, K. Swadi, and W. Taha. Implicitly heterogeneous multi-stage programming. In R. Glück and M. Lowry, editors, Proceedings of the ACM International Conference on Generative Programming and Component Engineering (GPCE'05), volume 3676 of Lecture Notes In Computer Science. Springer-Verlag, September 2005.
 
17
 
18
A. Filinski. Normalization by evaluation for the computational lambda-calculus. In S. Abramsky, editor, Proceedings of the International Conference on Typed Lambda Calculi and Applications (TLCA '01), volume 2044 of Lecture Notes in Computer Science, pages 151--165. Springer-Verlag, May 2001.
19
20
 
21
 
22
23
 
24
 
25
26
 
27
O. Kiselyov and W. Taha. Relating FFTW and split radix. In Z. Wu, M. Guo, C. Chen, and J. Bu, editors, Proceedings of the International Conference on Embedded Software and Systems (ICESS '04), volume 3605 of Lecture Notes in Computer Science. Springer-Verlag, Dec. 2004.
 
28
29
30
31
 
32
 
33
B. McAdam. Y in practical programs (extended abstract). Unpublished manuscript.
 
34
 
35
MetaOCaml: A compiled, type-safe multi-stage programming language. Available online from http://www.metaocaml.org/.
 
36
 
37
 
38
E. Moggi and S. Fagorzi. A monadic multi-stage metalanguage. In A. Gordon, editor, Proceedings of Foundations of Software Science and Computation Structures (FOSSACS '03), volume 2620 of Lecture Notes in Computer Science. Springer-Verlag, Apr. 2003.
 
39
 
40
Oregon Graduate Institute Technical Reports. P.O. Box 91000, Portland, OR 97291-1000, USA. Available online from http://www.cse.ogi.edu/tech-reports/.
41
42
 
43
 
44
45
 
46
47
48
 
49
P. Thiemann. Continuation-based partial evaluation without continuations. In R. Cousot, editor, Proceedings of the International Symposium on Static Analysis (SAS '03), volume 2694 of Lecture Notes in Computer Science, pages 366--382. Springer-Verlag, 2003.
50
 
51


Collaborative Colleagues:
Kedar Swadi: colleagues
Walid Taha: colleagues
Oleg Kiselyov: colleagues
Emir Pasalic: colleagues