Domain-specific languages (DSLs) are able to provide intuitive high-level abstractions that are easy to work with while attaining better performance than general-purpose languages. Yet, implementing new DSLs is a burdensome task. As a result, new DSLs are usually embedded in general-purpose languages. While low-level languages like C or C++ often provide better performance as a host than high-level languages like Python, high-level languages are becoming more prevalent in many domains due to their ease and flexibility. Here, we present Codon, a domain-extensible compiler and DSL framework for high-performance DSLs with Python's syntax and semantics. Codon builds on previous work on ahead-of-time type checking and compilation of Python programs and leverages a novel intermediate representation to easily incorporate domain-specific optimizations and analyses. We showcase and evaluate several compiler extensions and DSLs for Codon targeting various domains, including bioinformatics, secure multi-party computation, block-based data compression and parallel programming, showing that Codon DSLs can provide benefits of familiar high-level languages and achieve performance typically only seen with low-level languages, thus bridging the gap between performance and usability.
Mendeley helps you to discover research relevant for your work.
CITATION STYLE
Shajii, A., Ramirez, G., Smajlović, H., Ray, J., Berger, B., Amarasinghe, S., & Numanagić, I. (2023). Codon: A Compiler for High-Performance Pythonic Applications and DSLs. In CC 2023 - Proceedings of the 32nd ACM SIGPLAN International Conference on Compiler Construction (pp. 191–202). Association for Computing Machinery, Inc. https://doi.org/10.1145/3578360.3580275