Logic based on theory.
Relations that take flight.

main.krt
% entry point
factorial[X, Out] :-
  karuta:nat[X],
  'factorial loop'[X, 1, Out].

% arity overloading
'factorial loop'[0, Out, Out] :- karuta:nat[Out].
'factorial loop'[N, Acc, Out] :-
  karuta:nat[N],
  karuta:mult[N, Acc, NewAcc],
  karuta:minus[N, 1, Prev],
  'factorial loop'[Prev, NewAcc, Out].

% query with conjuction
factorial[5, Out1], factorial[6, Out2]?
Answers
Out1 = 120
Out2 = 720

We compile Karuta to our µKanren runtime implementation in LFE, thus allowing logic programming in the BEAM.

Declarativeness

Facts and predicates

State what is true and let the engine search for what follows. Pattern matching, unification and backtracking as the foundation.

ML

Modules and signatures

Use modules and signatures to accomplish real encapsulation and modularity. ML functors are also on the short horizon!

Persistance

Sakura besides it

Store facts in Sakura, our partner database, and query them with the same syntax you are used to in Karuta. Meet Sakura.

How Karuta came to be

Four cards,
a meaningful
journey

In karuta, one card is read aloud and the other is taken. Each pair is a chapter on an uprising story: starting from frustration and disbelief and ending with hope and a dream for a better future.

Reading card: three cherry blossoms
Yomifuda
Even upon fields
ruined by the winter's decay,
spring has arrived;
from the scent of sakura
the darkness slowly loosens.
Torifuda
From the scent of sakura,
the darkness slowly loosens.
Reading card: a nest holding an egg, crimson feathers and petals
Yomifuda
Branches scattered
beneath the white morning dew
are bound anew;
within the nest now rests
a quiet and gentle light.
Torifuda
Within the nest now rests
a quiet and gentle light.
Reading card: a crimson owl on a blossoming branch
Yomifuda
Though the shadows
cast by dawn upon the branches
shift and pass away,
the owl of the peak
does not let the nest forget.
Torifuda
The owl of the peak
does not let the nest forget.
Reading card: two crimson birds flying among blue clouds
Yomifuda
Tearing through clouds,
toward the long-forgotten skies,
the wings ascend;
like the morning sun itself,
they go illuminating the world.
Torifuda
Like the morning sun itself,
they go illuminating the world.

From the nest

All posts

Deal your
first hand

Terminal
$ git clone https://github.com/dont-rely-on-nulls/karuta