Lete

From Esolang
Jump to navigation Jump to search

Lete (pronounced leet) is an esolang by User:BoundedBeans where you cannot delete previously entered code.

It is similar to Uyjhmn n in that it’s main weirdness is the IDE.

IDE

The IDE must only allow appending to code. It may allow other operations to the appending string to correct typos before it is added, but once the program has been run, the code is “solidified” and cannot be modified other than appending again.

The IDE uses Lete code to generate a brainfuck program, which is then run.

Instructions

Popping from an empty stack gives an empty string. Other than that, anything that would normally cause an error is treated as a no-op.

P - prepend + to the code
M - prepend - to the code
L - prepend < to the code
R - append > to the code (not prepend, just to make it a bit more annoying)
I - append , to the code
O - prepend . to the code
$ - enclose the entire code in square brackets
^ - delete the first character from the code
v - delete the last character from the code
: - begin construction of a new string, push the old string onto a stack, delete the current string
; - append the top string on the stack to the current string, popping it
_ - jump ahead the number of characters in the current string
! - replace the current string with the top string on the stack, popping it
@ - discard the top string on the stack
% - duplicate the top string on the stack
= - swap the top two strings on the stack
? - pop the top two strings, take their lengths, return a substring of the current string with the two numbers, push that substring onto the stack.

Programs

Add 3+5

PPP:PPPPPR;:PLMR$:=!;:L:=!;

Equivalent to:

+++++>+++[-<+>]<

Print an exclamation point

PPPPPPPP:MR:LPPPP:=!;$:=!;:R:PO:=!;:=!;

Equivalent to:

++++++++[->++++<]>+.

Computational class

Lete can construct any brainfuck program, and given any starting code, there is a code that can be appended to cause any other effect (kind of cheating, but : followed by a ton of @s will allow you to start from scratch). Thus, Lete is Turing-complete.