{"title":"Compiling syntactically recursive programs","authors":"C. Queinnec","doi":"10.1145/382126.382129","DOIUrl":null,"url":null,"abstract":"Lisp programs are traditionally represented by S-expressions. Side-eeecting S-expressions allows to easily build cyclic S-expressions which can be turned, through macroexpansion, into syntactically recursive programs i.e., programs which do not have a nite DAG-like representation. We do not know of any compiler able to compile such syntactically recursive programs. Yet, interpreters do not have these problems when evaluating these sort of programs. The paper proposes a program transformation that translates any possibly syntactically recursive program into an equivalent regular program. This result establishes (i) that any S-expression can be considered as a program irrespectively of its possibly cyclic structure, (ii) the equivalence of compilers and interpreters with respect to any S-expression as well as (iii) the possibility to implement a dynamic evaluation facility i.e., the eval function, without any interpreter and with the sole use of a compiler.","PeriodicalId":262740,"journal":{"name":"ACM SIGPLAN Lisp Pointers","volume":"76 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1992-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"ACM SIGPLAN Lisp Pointers","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/382126.382129","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
Lisp programs are traditionally represented by S-expressions. Side-eeecting S-expressions allows to easily build cyclic S-expressions which can be turned, through macroexpansion, into syntactically recursive programs i.e., programs which do not have a nite DAG-like representation. We do not know of any compiler able to compile such syntactically recursive programs. Yet, interpreters do not have these problems when evaluating these sort of programs. The paper proposes a program transformation that translates any possibly syntactically recursive program into an equivalent regular program. This result establishes (i) that any S-expression can be considered as a program irrespectively of its possibly cyclic structure, (ii) the equivalence of compilers and interpreters with respect to any S-expression as well as (iii) the possibility to implement a dynamic evaluation facility i.e., the eval function, without any interpreter and with the sole use of a compiler.