IPSJ Digital Courier
Online ISSN : 1349-7456
ISSN-L : 1349-7456
A Transformation-Based Implementation of Lightweight Nested Functions
Tasuku HiraishiMasahiro YasugiTaiichi Yuasa
Author information
JOURNAL FREE ACCESS

2006 Volume 2 Pages 262-279

Details
Abstract

The SC language system was developed to provide a transformation-based language extension scheme for SC languages (extended/plain C languages with an S-expression-based syntax). Using this system, many flexible extensions to the C language can be implemented by means of transformation rules over S-expressions at low cost, mainly because of the preexisting Common Lisp capabilities for manipulating S-expressions. This paper presents the LW-SC (Lightweight-SC) language as an important application of this system, featuring nested functions (i.e., functions defined inside other functions). A function can manipulate its caller's local variables (or local variables of its indirect callers) by indirectly calling a nested function of its callers. Thus, many high-level services with “stack walk” can be easily and elegantly implemented by using LW-SC as an intermediate language. Moreover, such services can be implemented efficiently because we designed and implemented LW-SC to provide “lightweight” nested functions by aggressively reducing the costs of creating and maintaining nested functions. The GNU C compiler also provides nested functions as an extension to C, but our sophisticated translator to standard C is more portable and efficient for occasional “stack walk.”

Content from these authors
© 2006 by the Information Processing Society of Japan
Previous article Next article
feedback
Top