Xoc, an extension-oriented compiler for systems programming

Architectural Support for Programming Languages and Operating Systems(2008)

引用 42|浏览104
暂无评分
摘要
Today's system programmers go to great lengths to extend the lan- guages in which they program. For instance, system-specific com- pilers find errors in Linux and other systems, and add support for specialized control flow to Qt and event-based programs. These compilers are di cult to build and cannot always understand each other's language changes. However, they can greatly improve code understandability and correctness, advantages that should be acces- sible to all programmers. We describe an extension-oriented compiler for C called xoc. An extension-oriented compiler, unlike a conventional extensible compiler, implements new features via many small extensions that are loaded together as needed. Xoc gives extension writers full control over program syntax and semantics while hiding many compiler internals. Xoc programmers concisely define powerful compiler extensions that, by construction, can be combined; even some parts of the base compiler, such as GNU C compatibility, are structured as extensions. Xoc is based on two key interfaces. Syntax patterns allow ex- tension writers to manipulate language fragments using concrete syntax. Lazy computation of attributes allows extension writers to use the results of analyses by other extensions or the core without needing to worry about pass scheduling. Extensions built using xoc include xsparse, a 345-line exten- sion that mimics Sparse, Linux's C front end, and xlambda, a 170- line extension that adds function expressions to C. An evaluation of xoc using these and 13 other extensions shows that xoc exten- sions are typically more concise than equivalent extensions written for conventional extensible compilers and that it is possible to com- pose extensions.
更多
查看译文
关键词
powerful compiler extension,base compiler,systems programming,system-specific compiler,compiler internal,equivalent extension,345-line extension,extension writer,conventional extensible compiler,170-line extension,extension-oriented compiler,front end,control flow
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要