Beautiful day

From Esolang
Jump to navigation Jump to search
Beautiful day
Paradigm(s) Functional, String-rewriting
Designed by User:Hakerh400
Appeared in 2020
Computational class Turing complete
Major implementations Interpreter
File extension(s) .txt

Beautiful day is a functional and string-rewriting esolang.


Source code consists of zero or more rules. Each rule ends with a semicolon and contains left-hand-side and right-hand-side separated by a hyphen. Syntax of rules are identical as in Golden sunrise, but instead of bits, any character can appear. However, characters \/#-.(); and whitespace characters must be escaped by prepending a backslash before each of them. On the left-hand-side, parentheses do not need to be escaped. Meaning of parentheses is identical as in Golden sunrise.

However, instead of being able to match exactly one rule in each step, this language matches all possible rules and for each match creates a new branch. It starts from an empty parentheses and keeps executing all branches in parallel. When no rule can be matched, that branch is deleted. When no parentheses are left, the string that remains is called a constructible string. Each program defines a set of constructible strings.

I/O format

Input is a string (can contain any characters). Output is a single bit. If the input string is constructible by the program, the output bit is 1, otherwise the output bit is either 0 or the program does not halt.


Output 1 iff the input consists of zero or more letters A

# - (c);
a - (b)(c);
b - A;
c - /;
c - (a);

Output 1 iff the input is a palindrome that includes only letters A, B and C

# - (palindrome);
palindrome - /;
palindrome - (letter);
palindrome - (func(letter));
func - .(palindrome).;
letter - A;
letter - B;
letter - C;