Koopas are Involved

From Esolang
Jump to navigation Jump to search

Koopas are Involved is an esoteric programming language designed by User:Oshaboy as an edge case for discussions about whether X is a programming language (X could be HTML, Scratch, CSS, SQL, Brainfuck, Minecraft Redstone, etc.). Usually people have this idea of what a programming language looks and acts like. But Koopas are Involved challenges that notion.

Semantics

The commands are simple and straightforward

var:=expression
while var/expression
goto var/expression
read var (as a character)
print var/expression (as an integer)

an expression can be a combination of any of the following

(expression+expression)
(expression-expression)
(expression*expression)
(expression/expression)
(var/expression?expression:expression)

Yes the brackets are necessary, mostly because of ambiguity involving division (On a related note 6/2(2+1) doesn't have an answer, stop arguing about it). However, a few restrictions were added to prevent you from doing anything with it.

arithmetic expressions can only use immediate values 
goto can only jump forwards 
any variable can only be assigned once and used once in the program. (like Single Static Assignment, but with Single Static Use)

Discussion

So I always had this idea a computer language is a programming language iff it has Data Storage, Arithmetic, Flow Control, Loops, and IO. But this programming language has the ability to do all of these and you can't do anything interesting in it (give it a try). Out of all the Popular Problems only an infinite loop is possible AFAIK. Now is Koopas are Involved a programming language if it can do everything a programming language can do but can't do much beyond it? It looks like a programming language, but looks are deceiving when Koopas are Involved.

Also I learned how to use lex and yacc. So that's neat. (on a related note, are lex and yacc programming languages?)

Interesting Program

User:VilgotanL created a clever Truth Machine in Koopas are Involved. Proving the language is interesting and that the language failed in its only goal.

read x
goto x
[lines 3-47 left blank]
goto 50
while 1 print 1
print 0

Implementation

Interpreter