1
Fork 0
Code samples for tagless final parsing.
 
 
 
Go to file
Joshua Potter e67d2d8903
Include snippet of post
2022-01-11 16:06:48 -05:00
initial-encoding Keep strict. 2021-12-25 18:31:54 -05:00
leibniz-proof Initial commit. 2021-12-20 08:16:50 -05:00
parser-utils Minor clean up of final implementation. 2021-12-25 15:00:12 -05:00
tagless-final Strict dynamic. 2021-12-26 17:27:04 -05:00
.envrc Initial commit. 2021-12-20 08:16:50 -05:00
.gitignore Remove NF in multiple passes implementation. 2021-12-22 08:17:17 -05:00
README.md Include snippet of post 2022-01-11 16:06:48 -05:00
cabal.project Add implementations and tests around closed tagless final. 2021-12-23 18:21:00 -05:00
flake.lock Initial commit. 2021-12-20 08:16:50 -05:00
flake.nix Cleanup parser-initial code. 2021-12-20 08:53:18 -05:00
hie.yaml Cleanup parser-initial code. 2021-12-20 08:53:18 -05:00

README.md

tagless-final-parsing

This repository contains collections of code snippets related to my Tagless Final Parsing blog post.

In his introductory text, Oleg Kiselyov discusses the tagless final strategy for implementing DSLs. The approach permits leveraging the strong typing provided by some host language in a performant way. This post combines key thoughts from a selection of papers and code written on the topic. We conclude with an implementation of an interpreter for a toy language that runs quickly, remains strongly-typed, and can be extended without modification.

Experimenting

This repository uses Nix for reproducible builds. First install Nix if you do not currently have it on your system. Afterward, enable flakes by adding line

experimental-features = nix-command flakes

to $HOME/.config/nix/nix.conf. You may then use nix build and nix develop. To makes things easier, we recommend using Home Manager to install direnv and nix-direnv. Once you run

$ direnv allow

from the root directory, nix develop will be automatically invoked each time a change is detected in flake.nix or you return to the directory.