Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

falgon/mpl-lazyk

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mpl-lazyk

CI

"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.

Run

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

Tests

Build and run

$ cd tests
$ make

Or inside the docker container...

$ docker-compose -f docker/docker-compose.yml run test

FYI

  • There is my blog post about this implementation (Japanese)
  • If you enojoy this, write your impressions on reddit!

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.