Compilation as a Typed EDSL-to-EDSL Transformation
Emil Axelsson

TL;DR
This paper presents a compilation technique for Feldspar, translating high-level functional code into a low-level typed EDSL before generating C, simplifying backend development and improving reusability.
Contribution
It introduces a novel typed EDSL-to-EDSL transformation approach for compiling Feldspar, enhancing simplicity, correctness, and reusability of code generation.
Findings
Simplifies C backend development for Feldspar.
Reduces potential errors by using typed EDSLs.
Enables sharing of low-level EDSL across multiple high-level EDSLs.
Abstract
This article is about an implementation and compilation technique that is used in RAW-Feldspar which is a complete rewrite of the Feldspar embedded domain-specific language (EDSL) (Axelsson et al. 2010). Feldspar is high-level functional language that generates efficient C code to run on embedded targets. The gist of the technique presented in this post is the following: rather writing a back end that converts pure Feldspar expressions directly to C, we translate them to a low-level monadic EDSL. From the low-level EDSL, C code is then generated. This approach has several advantages: 1. The translation is simpler to write than a complete C back end. 2. The translation is between two typed EDSLs, which rules out many potential errors. 3. The low-level EDSL is reusable and can be shared between several high-level EDSLs. Although the article contains a lot of code, most of it is in…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsModel-Driven Software Engineering Techniques · Parallel Computing and Optimization Techniques · Logic, programming, and type systems
