PythOwO
- 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.
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
pwease inpuwut = inpwt() # recieves stwing IF inpuwut == "twue" THWEN # okie so i made a mistwake TwT pythOwO does have while loops lol WHILE twue pwint("UwU") END EWIF inpuwut == "false" THWEN pwint("OwO") EWSE pwint("UwU invawid inpuwut!") 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 = inpwt_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
# why does python use capital true and false pwease inpuwut = inpwt() # recieves stwing if inpuwut == "twue" thwen while Twue pwint("UwU") ewif inpuwut == "fawse" thwen pwint("OwO") ewse pwint("UwU invawid inpuwut!")
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 = inpwt_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
- Main implementation by virejdasani
- pythOwOn-compiler/PythOwOn-cpp a virtual machine for PythOwO in C++ by UFifty50
- py-myopl-code by David Callanan where the
# cowode stowlen shamewesswy fwom: https://github.com/davidcallanan/py-myopl-code
(pythowo.py line 1)