分步构建可插拔的精简编译器,适合资源受限设备
Developing a Modular Compiler for a Subset of a C-like Language
- 按模块逐步构建,每步都生成可用编译器
- 在资源受限单板机上验证,运行高效
- 设计符合工业规范,易维护可扩展
本文介绍了一种面向类C语言子集的模块化编译器开发过程,旨在应对高阶语言编译器构建的挑战。该方法通过小步迭代实现,每一步均产出一个功能完整的编译器,逐步扩展语言支持范围。模块化设计确保了语言可按需增删子集,实现最小化与内存高效。遵循行业最佳实践,强调模块化、代码复用与文档规范,提升了编译器的可维护性、可扩展性与功能性。实验表明,该编译器不仅能有效管理语言结构,还能生成优化代码,实际可用性得到验证。进一步在资源受限的单板计算机上测试,再次证明其在低内存环境下的效率与适用性。
原文摘要 · Abstract (English)
The paper introduces the development of a modular compiler for a subset of a C-like language, which addresses the challenges in constructing a compiler for high-level languages. This modular approach will allow developers to modify a language by adding or removing subsets as required, resulting in a minimal and memory-efficient compiler. The development process is divided into small, incremental steps, where each step yields a fully functioning compiler for an expanding subset of the language. The paper outlines the iterative developmental phase of the compiler, emphasizing progressive enhancements in capabilities and functionality. Adherence to industry best practices of modular design, code reusability, and documentation has enabled the resulting compiler's functional efficiency, maintainability, and extensibility. The compiler proved to be effective not only in managing the language structure but also in developing optimized code, which demonstrates its practical usability. This was also further assessed using the compiler on a tiny memory-deficient single-board computer, again showing the compiler's efficiency and suitability for resource-constrained devices.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。