Implementing Explicit and Finding Implicit Sharing in Embedded DSLs
Oleg Kiselyov

TL;DR
This paper explores methods for implementing explicit and implicit sharing in embedded domain-specific languages (DSLs), focusing on Haskell, to improve efficiency and maintain purity in modeling aliasing in various domains.
Contribution
It introduces a technique combining explicit sharing with hash-consing for implicit sharing in embedded DSLs, enhancing performance while preserving functional purity.
Findings
Explicit sharing speeds up hash-consing
Embedding is achieved in pure Haskell
Applicable to DSLs for hardware, SAT solving, and music synthesis
Abstract
Aliasing, or sharing, is prominent in many domains, denoting that two differently-named objects are in fact identical: a change in one object (memory cell, circuit terminal, disk block) is instantly reflected in the other. Languages for modelling such domains should let the programmer explicitly define the sharing among objects or expressions. A DSL compiler may find other identical expressions and share them, implicitly. Such common subexpression elimination is crucial to the efficient implementation of DSLs. Sharing is tricky in embedded DSL, since host aliasing may correspond to copying of the underlying objects rather than their sharing. This tutorial summarizes discussions of implementing sharing in Haskell DSLs for automotive embedded systems and hardware description languages. The technique has since been used in a Haskell SAT solver and the DSL for music synthesis. We…
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.
