Abstract
We present a type and effect system for a multi-staged language with exceptions. The proposed type and effect system checks if we safely synthesize complex controls with exceptions in multi-staged programming. The proposed exception constructs in multi-staged programming has no artificial restriction. Exception-raise and -handle expressions can appear in expressions of any stage, though they are executed only at stage 0. Exceptions can be raised during code composition and may escape before they are handled. Our effect type system support such features. We prove our type and effect system sound: empty effect means the input program has no uncaught exceptions during its execution.
Eo and Yi were partially supported by Brain Korea 21 Project of Korea Ministry of Education and Human Resources, by IT Leading R& D Support Project of Korea Ministry of Information and Communication, by Korea National Security Research Institute, and by Microsoft Research Asia. Kim was supported by post-doctoral grants from École Polytechnique and École Normale Supérieure in France.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Danvy, O.: Type-directed partial evaluation. In: Proceedings of the Symposium on Principles of Programming Languages, pp. 242–257. ACM Press, New York (1996)
Davies, R., Pfenning, F.: A modal analysis of staged computation. Journal of the ACM 48(3), 555–604 (2001)
Graham, P.: On Lisp: an advanced techniques for Common Lisp. Prentice-Hall, Englewood Cliffs (1994)
Guzmán, J.C., Suárez, A.: A type system for exceptions. In: Proceedings of the ACM SIGPLAN Workshop on ML and its Applications (June 1994)
Jones, N.D., Gomard, C.K., Sestoft, P.: Partial evaluation and automatic program generation. Prentice-Hall, Englewood Cliffs (1993)
Ik-Soon, K., Yi, K., Calcagno, C.: A polymorphic modal type system for Lisp-like multi-staged languages. In: Proceedings of The ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 257–268. ACM Press, New York (2006)
Leone, M., Lee, P.: Optimizing ML with run-time code generation. In: Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language Design and Implementation, pp. 137–148. ACM Press, New York (1996)
Nanevski, A.: A modal calculus for exception handling. In: Proceedings of the Intuitionistic Modal Logic and Applications Workshop (June 2005)
Pessaux, F., Leroy, X.: Type-based analysis of uncaught exceptions. In: Proceedings of The ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 276–290 (January 1999)
Poletto, M., Hsieh, W.C., Engler, D.R., Kaashoek, M.F.: C and tcc: a language and compiler for dynamic code generation. ACM Transactions on Programming Languages and Systems 21, 324–369 (1999)
Steele, G.L.: Common Lisp the Language, 2nd edn. Digital Press (1990)
Jean-Piere, T., Jouvelot, P.: Polymorphic type, region and effect inference. Journal of Functional Programming 2(3), 245–271 (1992)
Jean-Piere, T.: Theoretical and Practical Aspects of Type and Effect Inference. PhD thesis, University of Paris VI (May 1993)
Tofte, M., Jean-Piere, T.: Implementation of the typed call-by-value λ-calculus using a stack of regions. In: Proceedings of The ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 188–201 (January 1994)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Eo, H., Kim, IS., Yi, K. (2006). Type and Effect System for Multi-staged Exceptions. In: Kobayashi, N. (eds) Programming Languages and Systems. APLAS 2006. Lecture Notes in Computer Science, vol 4279. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11924661_4
Download citation
DOI: https://doi.org/10.1007/11924661_4
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-48937-5
Online ISBN: 978-3-540-48938-2
eBook Packages: Computer ScienceComputer Science (R0)