Ririsu

From Esolang
Jump to: navigation, search

Ririsu is a small, untyped and stack-based concatenative language with some more interesting features like dynamic scoping and occasional purity. The language is under active development, and some features have not been implemented yet, like concurrency.

Overview

In Ririsu everything is a pure function that takes in a Stack and Environment and returns a new Stack and Environment. Whenever a token can't be applied (either it isn't understood, or the expected parameters don't match), the token gets pushed onto the Stack.

Since there's no I/O operation in the language, the initial Stack is the contents of the STDIN, and the remaining of the Stack after running the program gets output to the STDOUT.

Examples

Compute the sum of all numbers in a list:

   [123456789][li]|[+].

Find all the even numbers in a list:

   [123456789][li]|[[2]i~%[0]i=]#

Solve the 100 Doors problem:

   [e]h[^[f]~[[1]i~-]~[2]i>!?],r[s^o=]|

External resources