This is a stack machine based language
It is the ocaml version of https://github.com/msakuta/rustack
The image above was produced by below script
/koch {
/level exch def
/scale exch def
{ level 5 < }
{
save
scale 3. div level 1 + koch
scale 100 * 0 translate
pi -3. div rotate
scale 3. div level 1 + koch
scale 100 * 0 translate
pi 2. * 3. div rotate
scale 3. div level 1 + koch
scale 100 * 0 translate
pi -3. div rotate
scale 3. div level 1 + koch
restore
}
{
begin_path
0 0 move_to
scale 300 * 0 line_to
stroke
}
if
} def
10 300 translate
2. 1 koch
dune build stackl.exe
or
make
cat scripts/koch.sl | ./_build/default/stackl.exe
Press q