esolang

pythOwO

A Python in UwU speak that turned out to be BASIC.

virejdasani, 2022 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 4 known programs · Test method

Run it

Expected: Hewwo Wowrld!

The idea

virejdasani made pythOwO in 2022, after a post on r/ProgrammerHumor. It is meant to be Python with UwU spelling. print is pwint, return is WETURN and a variable is made with pwease. The specification notes that it reads more like BASIC than Python. Keywords are in capitals and blocks close with END, not by indentation.

Read the story

Most things are expressions. IF gives a value, so it stands in for a ternary, and a loop on one line gives the list of its body's values.

The machine

CodeDoes
pwease x = 5 / x = 6Define a variable / set it
IF c THWEN ... EWIF c THWEN ... EWSE ... ENDChoose
WHILE c THWEN ... ENDLoop while c holds
FOR i = 0 TO 10 STWEP 2 THWEN ... ENDCount, 10 left out
FWUNCTION f(a, b) ... ENDA function; -> expr for one expression
WETURN BWEAK CONTINUWUReturn, break, continue
pwint(x) inpwt() inpwt_int()Print a line, read a line, read an integer
appwend pwp extwend lwenWork on lists
twue fawse nwull mwath_pwi1, 0, 0 and pi

Numbers print as Python prints them. / always gives a float, so 10 / 4 * 4 prints 10.0. The specification gives no spelling for AND, OR and NOT, so they keep their English names, and rwun, which runs a file, is left out.

Example

IF is an expression, so it can pick a string.

IF is an expression, so it can pick a string.

Expected: tehe is 500

The Fibonacci is a one expression function whose body starts on the next line. It starts from 1 and 1, so fibonacci(10) is 89.

Expected: 89

A loop on one line is a list.

Expected: 0, 1, 4, 9, 16

Further

Also in Jokes

Write your own in Run Convert a program from pythOwO

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run pythowo -e 'pwint("Hewwo Wowrld!")'
shib manual pythowo

Source

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

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

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