pythOwO
- This article is about the original implementation.
| Paradigm(s) | imperative |
|---|---|
| Designed by | virejdasani |
| Appeared in | 2022 |
| Type system | dynamic |
| Memory system | variable-based |
| Computational class | Turing complete |
| Reference implementation | pythOwO (virejdasani) |
| Major implementations | PythOwOn-cpp |
| Influenced by | Python |
| File extension(s) | .pyowo |
PythOwO is a programming language with UwU syntax made by virejdasani on GitHub inspired by a Reddit post. [1]
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() # receives 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 program as an example, a more Pythonic implementation 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 the official repository admits it. [2]
See also
External resources
- Main implementation by virejdasani
- pythOwOn-compiler/PythOwOn-cpp a virtual machine for PythOwO in C++ by UFifty50
py-myopl-codebydavidcallanan
References
- ↑ https://www.reddit.com/r/ProgrammerHumor/comments/vkkyyv/say_hello_to_pythowo_make_sure_to_treat_her_well/ The original post with the pythOwO logo, the one that inspired the creation of this language
- ↑ pythowo.py line 1 of
pythowo.pyhas a comment that says# cowode stowlen shamewesswy fwom: https://github.com/davidcallanan/py-myopl-code