esolang

LRIP

Every character is built up from 0, one shift and one increment at a time.

Lebster, 2020 · Turing complete: unknown · ●●○ moderate · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: Hello world

The idea

Lebster made LRIP in 2020, and its name is its first four commands. There are no number literals. To print a letter the program starts from 0 and builds the code bit by bit from the highest bit down, doubling with L and adding 1 with I. Then + pushes a fresh 0 for the next one. Only the top of the stack can be changed or tested, so the items below wait until a - brings them back up.

The machine

CommandDoes
L RShift the top one bit left or right
IAdd 1 to the top
PPrint the top as a character
+ -Push a 0; pop
kRead a character and push its code
( )brainfuck's loop, on the top

The stack starts as one 0, and popping the last item leaves a 0. Small letters work as well, and line feeds are left out. The specification's Python interpreter reads with input('? '), so k prints ? first and wants a line of one character.

Example

Hello world.

Hello world. ILLLILLL builds 72, which is 1001000 in binary, so the first P prints H.

Expected: ABCDEFGHIJKLMNOPQRSTUVWXYZ

The alphabet builds 65 once, prints A, and then adds 1 and prints 25 more times.

A loop runs while the top is not 0. This program pushes the i and then the H, and (P-) prints and pops until it meets the 0 at the bottom.

Expected: Hi
Expected: ? a

Patterns it teaches

Further

Stack-based

Write your own in Run Convert a program from LRIP

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: lrip.

Command line

shib run lrip -e 'ILLLLLLIPIPIPIPIPIPIPIPIPIPIPIPIPIPIPIPIPIPIPIPIPIPIPIPIPIP'
shib manual lrip

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/lrip.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org