Skip to content

Instantly share code, notes, and snippets.

@zphixon
Last active March 26, 2016 02:08
Show Gist options
  • Save zphixon/f2772f6d25f6066f89d4 to your computer and use it in GitHub Desktop.
Save zphixon/f2772f6d25f6066f89d4 to your computer and use it in GitHub Desktop.

Ufupolg programming language

This is kind of an esoteric programming language. The goal is to be as ugly as possible.

There is no god

Simple stuff

Expressions

Expressions are a very simle concept. In a nested set of expressions, the innermost are evaluated before the outermost, eventually working its way out to the final value of the expression.

pr[2 + [3 - [6 - 2]]]
1

Comments

Comments are one of the most useful features in a programming language. They should be used to add information to a program's source code in a way that a person could open the code and know what's going on, but also not give so much information to the point of redundancy.

=+ This is a comment, and they are between these symbols. +=

Text literals

A way to represent text is an integral part of any usable programming language. The art of text manipulation is one of the most interesting brain teasers ever created. see regexes.
&This a string, encapsulated between ampersands.&

Variables

Data manipulation is the most important function in computing, so it should go without saying that a way to represent changeable data is ingegral.

"variable" : 3

"text" : &Hello, world!&

Control flow

Control flow is another important feature in programming, but some are greater than others. goto is an abomination, for is a godsend. There are several different ways to implement control flow:

Functions

"say hello to everyone" :=: :
    pr[&Hello, world!&]
    pr[&This is an examle function.&]
|

"function" :=: "arg1" "arg2" :
    re["arg1" + "arg2"]
|

"result" : "function" . 2 3

The syntax of a funtion is as follows:

"function name (spaces allowed)" :=: "arguments" :
    body
| =+ end funtion +=

If

"f" :=: pr[&one and two are equal&] |
"z" :=: pr[&one and two are not equal&] |
"one" : 1
"two" : 1
{[["one"]=["two"]]["f"]["z"]}

The syntax of an if statement is like so in pseudocode:

{[if this expression is true][do this][optional: otherwise, do this]}

This allows for blocks to be put inside the do part.

Loops:

3_[pr[&Three times&]]

"bool" : true
"count" : 0
"bool"_{["bool"][
    "count" : "count" + 1
    pr["count" + &times&]
    {[["count"]=[10]][
        "bool" : false
    ]}
]}

If you aren't giggling right now, you have something wrong with you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment