CPL - Chalmers Publication Library
| Utbildning | Forskning | Styrkeområden | Om Chalmers | In English In English Ej inloggad.

Combining Deep and Shallow Embedding for EDSL

Josef Svenningsson (Institutionen för data- och informationsteknik, Programvaruteknik (Chalmers)) ; Emil Axelsson (Institutionen för data- och informationsteknik, Programvaruteknik (Chalmers))
Trends in Functional Programming (LNCS) (0302-9743). Vol. 7829 (2013), p. 21-36.
[Konferensbidrag, refereegranskat]

When compiling embedded languages it is natural to use an abstract syntax tree to represent programs. This is known as a deep embedding and it is a rather cumbersome technique compared to other forms of embedding, typically leading to more code and being harder to extend. In shallow embeddings, language constructs are mapped directly to their semantics which yields more flexible and succinct implementations. But shallow embeddings are not well-suited for compiling embedded languages. We present a technique to combine deep and shallow embedding in the context of compiling embedded languages in order to provide the benefits of both techniques. In particular it helps keeping the deep embedding small and it makes extending the embedded language much easier. Our technique also has some unexpected but welcome knock-on effects. It provides fusion of functions to remove intermediate results for free without any additional effort. It also helps to give the embedded language a more natural programming interface.



Den här publikationen ingår i följande styrkeområden:

Läs mer om Chalmers styrkeområden  

Denna post skapades 2014-01-20. Senast ändrad 2016-08-29.
CPL Pubid: 192911

 

Läs direkt!


Länk till annan sajt (kan kräva inloggning)