Joshua Potter caac19270e | ||
---|---|---|
.githooks | ||
initial-encoding | ||
leibniz-proof | ||
parser-utils | ||
tagless-final | ||
.envrc | ||
.gitignore | ||
README.md | ||
cabal.project | ||
flake.lock | ||
flake.nix | ||
hie.yaml |
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.
Formatting
Link in .githooks
by running:
$ git config --local core.hooksPath .githooks/