hp
toc

krrp

2019-04-20, post № 214

C, krrp, programming, #2018

A project of epic proportions has come to a close. Yesterday, the 19th of April 2019, saw the first public release of my new programming language, krrp.

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 F_{20}=6765 — 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'
Jonathan Frech's blog; built 2024/12/19 23:13:08 CET