UnnumericPy

From Esolang
Jump to navigation Jump to search

UnnumericPy is an esoteric programming language created by User:Marina and inspired by UnnumericJS. It is an equivalent to Python, but if the code has any digits it will raise a syntax error.

Examples

Hello world

print("Hello World")

Cat program

i = input(">>>")
print(i)

Truth machine

a=input(">>> ")
if a==str(int(False)):
    print(int(False))
elif a==str(int(True)):
    while True:
        print(int(True))
else:
  raise Exception

Here, int(False) and int(True) are used for 0s and 1s.

A shorter one that doesn't use number literals (int(False) and int(True)):

a=input(">>> ")
if int(a):
    while ' ':
        print(a)
else:
    print(a)

Syntax error

0

Interpreter

Python

def unnumericpy(code):
 for i in range(10):
   if str(i) in code:
     raise SyntaxError("syntax error")
 exec(code)

Turing completeness

The proof is like in UnnumericJS, but here we have to use int(True) for 1 and int(False) for 0, and use chr() to convert integers to a string and finally exec() to run the Python code.