Zero-overhead exception handling using metaprogramming

  • Markus Hof
  • Hanspeter Mössenböck
  • Peter Pirkelbauer
Contributed Papers
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1338)


We present a novel approach to exception handling which is based on metaprogramming. Our mechanism does not require language support, imposes no run time overhead to error-free programs, and is easy to implement. Exception handlers are implemented as ordinary procedures. When an exception occurs, the corresponding handler is searched dynamically using the type of the exception as a search criterion. Our implementation was done in the Oberon System but it could be ported to most other systems that support metaprogramming.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [ArGo96]
    Arnold K., Gosling J.: The Java Programming Language. Addison Wesley 1996.Google Scholar
  2. [Atta89]
    Attardi G. et al.: Metalevel Programming in CLOS. Proc. European Conference on Object-Oriented Programming (ECOOP'89). Cambridge University Press, 1989.Google Scholar
  3. [ElSt90]
    Ellis M.A., Stroustrup B.: The Annotated C++ Reference Manual. Addison-Wesley 1990.Google Scholar
  4. [Good75]
    Goodenough J. B.: Exception Handling: Issues and a Proposed Notation. Communications of the ACM, vol.18, no.12, December 1975.Google Scholar
  5. [GoRo83]
    Goldberg A., Robson D.: Smalltalk-80, the Language and its Implementation. Addison Wesley 1983.Google Scholar
  6. [McCa60]
    McCarthy J.: Recursive Functions of Symbolic Expressions and their Computation by a Machine. Comm. of the ACM, vol.3, no.4, 1960.Google Scholar
  7. [KöSt90]
    König A., Stroustrup B.: Exception Handling for C++ (revised), Proc. USENIX C++ Conference, 149–176, (1990)Google Scholar
  8. [Meye92]
    Meyer B.: Eiffel — The Language. Prentice Hall 1992.Google Scholar
  9. [Mill88]
    Miller W. M.: Exception Handling without Language Extensions. Proc. USENIX C++ Conference. Denver CO., October 1988.Google Scholar
  10. [MMN93]
    Lehrmann-Madsen O., Moller-Pedersen B., Nygaard K.: Object-Oriented Programming in the BETA Programming Language. Addison-Wesley 1993.Google Scholar
  11. [Nels91]
    Nelson G. (ed.): Systems Programming with Modula-3. Addison-Wesley 1991.Google Scholar
  12. [StM696]
    Steindl C., Mössenböck H.: Metaprogramming Facilities in Oberon for Windows and Power Macintosh. Technical Report 4, Institute of Computer Science, University of Linz, 1996.Google Scholar
  13. [Stro86]
    Stroustrup B.: The C++Programming Language. Addison Wesley 1986.Google Scholar
  14. [Stro94]
    Stroustrup B.: The Design and Evolution of C++. Addison Wesley 1994.Google Scholar
  15. [Temp94]
    Templ J.: Metaprogramming in Oberon. Dissertation, ETH Zurich, 1994.Google Scholar
  16. [WiGu92]
    Wirth N., Gutknecht J.: Project Oberon-TheDesign of an Operating System and Compiler. Addison-Wesley 1992.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1997

Authors and Affiliations

  • Markus Hof
    • 1
  • Hanspeter Mössenböck
    • 1
  • Peter Pirkelbauer
    • 1
  1. 1.Johannes Kepler University LinzLinz

Personalised recommendations