Metaprogram and Runtime Library: Language Backend Draft

Due Wednesday Oct 23rd @ 9 am

From this assignment, students may show...

Abstractions and Representations - Reasoning

CodeGen and Metaprograming - Reasoning

... in addition to other learning objectives students feel their work accomplishes.

Update: Common Questions during office hour

Motiviation and context

This assignment allows you to establish a small, working core to your language before you decide on the full scope. Picking an underlying representation and writing library code to use it can be the most time consuming task of language design, so hopefully this assignment will help you complete a minimal viable piece.

What to turn in

At this stage, the library does not need to be fully functional, but the types and api should be enough to support your examples. If the algorithms are too difficult to implement fully, please provide stubbed or trivial implementations and comment them as such.

Example

Here is an example metaprogram project for the "timed hardware" DSL from my proposal. This backend shows exactly one language feature, the tracking of delay times through the loop. I mocked up 1 analysis that is more restricted, but easier to implement than the best one I could have proposed. This compile-time analysis collects all the timing properties declared in the setup sub-program, and checks that they are upheld in the loop sub-program.

The two sub-programs (setup and loop) are defined by the Algebraic Data Type Typed that I made to represent my Abstract Syntax. These metaprograms are compiled into IO programs using a function I wrote called eval and the IO program is spliced in. At runtime, the IO program will run the setup computation once and then the loop computation forever.

How I approached the problem

You don't have to do this assignment this way, but here is what worked for me so I could iterate quickly and fight with Template-Haskell less.

TL;DW

Optional META.md

META.md should include
  1. your name
  2. your utln
  3. how much time you spent on this assignment
  4. the witness "proof" for how you earned each learning objective.

Please Submit

Contents to be submitted

Method of submission

Please commit your changes in the hw14-1 directory of your private repo and push them to the remote server before 9 am.