Giter Club home page Giter Club logo

thesis's Introduction

Annotating Deeply Embedded Languages

This is my master's thesis on extending deeply embedded languages* with additional information that can be used to add source mapping support and custom compiler instructions to existing embedded languages.

Abstract:

This thesis explores the idea of annotating deeply embedded languages with additional information. A common problem with deeply embedded languages is that there is no strong connection between an embedded program, the abstract syntax tree for that embedded program, and a compiled version of the program. By gathering source location information for embedded expressions using a novel implicit parameter-based approach and annotating the embedded program's AST with this information, it becomes possible to map the embedded program back to the original source code. This new information can be used to improve compiler diagnostics, and to provide better profiling and debugging experiences for the language. In addition, the idea of extending that approach by also annotating the language with instructions for the compiler as a way to allow the programmer to hand optimize parts of a program will be explored. Storing these instructions as annotations on the abstract syntax trees enables new optimization workflows without requiring any changes to the language itself. Finally, an implementation of this annotation system in an existing language is examined, and its consequences on the experience of using the language are evaluated.

Full PDF
Thesis defense presentation, presented by @tmcdonell at the Haskell Implementor's Workshop 2022

*An embedded language is a programming language whose programs are written inside of another language, called the host language. Evaluating a shallowly embedded program directly produces a result, while deep embeddings produce an Abstract Syntax Tree of the program instead. This AST can then be checked, optimized, and eventually interpreted or compiled to native code.

Links

ICFP 2022
UU Theses Repository

Implementation source code

The implementation for the annotation system as implemented in Accelerate can be found in the GitHub repositories for the forked accelerate and the accelerate-llvm packages. The Data.Array.Accelerate.Annotations module in the accelerate fork contains a complete guide on how to migrate Accelerate libraries to the new annotated version of Accelerate. Take a look at the linear-accelerate fork for an example on how to do this.

thesis's People

Contributors

robbert-vdh avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.