PythOwO

From Esolang
Jump to navigation Jump to search
Note that pythOwO usually starts with a lowercase letter unless it's at the start of a sentence.
This article is about the original implementation.
pythOwO
Paradigm(s) imperative, procedural, structured, functional
Designed by virejdasani
Appeared in 2022
Type system dynamic, strong
Memory system variable-based
Computational class Turing complete
Reference implementation pythOwO (virejdasani)
Major implementations pythOwO (virejdasani) PythOwOn-cpp
Influenced by Python
Influenced PythOwOn-cpp
File extension(s) .pyowo

PythOwO is a scripting programming language with UwU syntax made by virejdasani on GitHub after a (now archived) Reddit post was posted.

Examples

Hello World

This program prints "Hewwo Wowrld!" to the standard output.

pwint("Hewwo Wowrld!")

Ternary Operator

Ternary operators don't exist in pythOwO because they are regular IF statements

pwease tehe = 500
pwease var = IF tehe == 501 THWEN "tehe is 501" EWIF tehe == 500 THWEN "tehe is 500" EWSE "tehe is not 500 or 501"
pwint(var)

Outpuwut:

tehe is 500

Functions

Fwunctions (functions) in pythOwO are single-statement functions like in functional languages.

# 'IF' statements in pythOwO are one statement
FWUNCTION say(inpuwut) ->
    IF inpuwut == 1 THWEN
        pwint("UwU")
        WETURN 0
    EWIF inpuwut == 2
        pwint("OwO")
        WETURN 1
    EWSE
        pwint("TwT")
        WETURN 2
    END

say(1) # UwU
say(2) # OwO
say(2147483647) # TwT

Truth Machine

# pythOwO does have inpuwut but idk how to use it
pwease inpuwut = twue
IF inpuwut == twue THWEN
    # original pythOwO doesn't have while loops either
    FOR i = 0 TO 999999 THWEN
        pwint("UwU")
    END
EWSE
    pwint("OwO")
END

Fibonacci Sequence

WARNING! UNTESTED

# functions in pythOwO are single-statement only, however 'if' statements
# can hold unlimited statements.
FWUNCTION fibonacci(n) ->
    IF n < 2 THWEN
        WETURN 1
    EWSE
        WETURN fibonacci(n - 1) + fibonacci(n - 2)
    END

pwease fib_num = input_int()

pwint(fibonacci(fib_num))

Criticism

PythOwO was criticized twice for not being Pythonic enough, aka the syntax is more reminiscent of BASIC with uppercase keywords and the missing off-side rule where indentation matters.

Using the truth machine code as an example, a more Pythonic implemenation of pythOwO would look like

pwease inpuwut = Twue
if inpuwut == Twue thwen
    for i = 0 to 999999 thwen
         pwint("UwU")
ewse
    pwint("OwO")

Here is another example with the Fibonacci sequence.

# Ideally a fuwunction would be a cowontainew
fuwunction fibonacci(n)
    if n < 2 thwen
        wetuwurn 1
    ewse
        wetuwurn fibonacci(n - 1) + fibonacci(n - 2)

pwease fib_num = input_int()

pwint(fibonacci(fib_num))

Also the source is just a copy of py-myopl-code by davidcallanan on GitHub but UwUfied and pythowo.py will let you know that

See also

External resources