一句话:设计并实现面向切面 C 语言 Aclang 及其编译器,将成熟 AOP 支持引入 C。
面向切面编程(AOP)通过模块化横切关注点提升程序组织能力,但 Java、C++ 已有 AspectJ、AspectC++ 等成熟语言与编译支持,C 语言的 AOP 支持仍较薄弱且缺乏编译器。本文设计了一种新的通用、富有表达力的面向切面 C 编程语言 Aclang,并实现了相应编译器,为 C 领域带来较完整的 AOP 支持。作者从有效性和性能两方面进行评估,并与 ACC、AspectC++ 两个先进工具比较:有效性上 Aclang 优于 ACC 和 AspectC++;性能上执行时间优于 ACC,并在执行时间和内存消耗上均优于 AspectC++。
Aspect-Oriented Programming (AOP) is a programming paradigm that implements crosscutting concerns in a modular way. People have witnessed the prosperity of AOP languages for Java and C++, such as AspectJ and AspectC++, which has propelled AOP to become an important programming paradigm with many interesting application scenarios, e.g., runtime verification. In contrast, the AOP languages for C are still poor and lack compiler support. In this paper, we design a new general-purpose and expressive aspect-oriented C programming language, namely Aclang, and implement a compiler for it, which brings fully-fledged AOP support into the C domain. We have evaluated the effectiveness and performance of our compiler against two state-of-the-art tools, ACC and AspectC++. In terms of effectiveness, Aclang outperforms ACC and AspectC++. In terms of performance, Aclang outperforms ACC in execution time and outperforms AspectC++ in both execution time and memory consumption.
@article{paperbot2541,
title = {Design and Implementation of an Aspect-Oriented C Programming Language},
author = {Zhe Chen and Yunlong Zhu and Zhemin Wang},
journal = {Proceedings of the ACM on Programming Languages},
volume = {8},
number = {OOPSLA1},
year = {2024},
doi = {10.1145/3649834}
}