As of the 24th of April 2019, krrp is kindly included in the TIO language collection, making krrp interpretation available from within the web. Great thanks go out to TIO for providing this service.

krrp is a functional, dynamic, interpreted and (theoretically) Turing-complete esolang implemented only using standard C. As such, on top of designing the actual language, any data structures, memory management and general auxiliary functionality deviating from the lacking capabilities offered by C had to be home-brewed and hand-crafted. A time-consuming task — I have been working on this language for the past year. However, it gives the language a certain purity, as its high-level functional approach rests firmly and closely on the state-changing, mutable and segmentation-faulting depths that are the C language.

As far as the language itself goes, I intentionally went with a sparse set of core features, in spirit aligned with functional pioneers like Lisp. Most constructs are represented using only one or a few bytes, leading to a compressed, though (possibly disputably) surprisingly legible source code look:

./krrp -c ',^k:?<k2k+@-k1@-k2.$20.' $6765.

In eighteen bytes, the above program fully represents the Fibonacci recurrence relation, an additional five are required to apply the implementation and compute — counting zero-indexed.

However, also higher-level computations are possible using krrp; `LxLyLzE`

representing the standard algebraic list data type:

./krrp -c '\L\M [map]^n:[pow]2n.[range]0$12.' L1L2L4L8L$16.L$32.L$64.L$128.L$256.L$512.L$1024.L$2048.E

True to its esoteric appearance, krrp is also capable of some rather unorthodox behavior:

./krrp -c '!f^g:g581. f^ij:*+jii. f^_:-0_. f^xyz:-x*yz.' $65. $-5. $-3.

With that being said, I can only hope that you will give krrp a try and wish all of you …

./krrp --str -c ']]>\L[append][map]^c:+*8$11.c.L$-16.L9L$24.L$24.L$33.EL$32.[append][filter]^z:|>%z20<$100.z.L2L$69.L$97.L4L$115.L$90.L8L$116.L$101.L$114.L$22.E L$46.E'

| 4 3 | --------- 2 | 1 4 | ./sudoku 5 2

However, to write a generator I first wrote a sudoku solver, both generalized as well as broader — instead of only finding one solution, it (eventually) discovers every valid solution to a given sudoku. Within this design decision lies the generator’s essence — a fully solved, yet pseudo-randomly picked, sudoku which can later be clue-dropped can be found in the set of all solutions to the empty sudoku (bearing in mind performance to some extend, not the entire set is generated and pseudo-randomly sampled, but rather the solving process itself is pseudo-randomly altered).

4 6 | | 7 8 | 1 9 | 4 1 | | 8 --------------------- 6 4 7 | 5 | 1 | 8 | 5 8 | 6 4 | 7 --------------------- 2 | 8 1 | 3 | 3 | 1 | | 9 ./sudoku 17 3

Having acquired a fully solved sudoku, the algorithm proceeds to remove clues whilst maintaining the puzzle’s unique solvability. How many clues are attempted to be removed is determined by the given minimum number of clues.

One has to note that the above described algorithm cannot always hit as low a clue number as is possible due to the pseudo-randomly chosen path in which clues are dropped. However, clue-dropping does behave monotonically with regards to solvability, in the sense that a sudoku never loses solutions by removing clues.

3 | 12 7 | 2 10 | 11 6 9 13 | 15 14 2 | 8 6 11 | 4 5 11 2 12 | 10 | 14 3 | 16 8 4 14 10 | | | 12 ----------------------------------------------------- 2 12 | 8 4 | 3 7 | 11 8 | 2 12 | 1 | 14 3 7 5 | 6 15 | 10 12 9 | 8 13 2 14 9 3 | 10 7 | 8 2 | ----------------------------------------------------- 16 9 | 13 11 | 8 | 1 14 12 10 6 4 | 5 1 14 | | 15 7 8 8 1 | 3 | 14 9 13 5 | 10 6 12 13 14 | 10 7 8 | 4 | 16 2 5 9 ----------------------------------------------------- 4 | 3 13 1 | 7 16 12 | 5 15 | 9 | 2 10 | 6 16 13 6 | 7 2 | 5 1 | 11 10 7 2 | 16 10 6 | 9 11 8 | 12 13 1 ./sudoku 125 4]]>

*Try it online.* Happy pi day.