"Use template metaprogramming only when you really need to"
― C++ Core Guidelines
mpl-lazyk is a monadic and impractical compile-time lazyk interpreter with template metaprogramming. This is achieved by implementing a simple parser combinator consisting of a monad transformer and either monad. The implementation and naming of many of these algebraic data structures is influenced by the programming language Haskell and category theory.
Build and run
$ cd app
$ make LAZYK_CODE='"(SKK)I"' INPUT='"Hello, world!"'
Hello, world!
Or inside the docker container...
$ docker-compose -f docker/docker-compose.yml run lazyk
Hello, world!
$ INPUT="Que Sera, Sera" LAZYK_CODE="(SKK)I" docker-compose -f docker/docker-compose.yml run lazyk
Que Sera, Sera
$ INPUT="Que Sera, Sera" LAZYK_CODE="****i*i*i*ii*ii*ii11111110001111111110000011111111100000" docker-compose -f docker/docker-compose.yml run lazyk
Que Sera, Sera
Build and run
$ cd tests
$ make
Or inside the docker container...
$ docker-compose -f docker/docker-compose.yml run test
- There is my blog post about this implementation (Japanese)
- If you enojoy this, write your impressions on reddit!