An awful programming language.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
Colin Reeder 7b1542e438 Fix hello example 1年前
src Change addition and multiplication to take any number of arguments 1年前
.gitignore Initial commit 3年前
Cargo.toml Initial commit 3年前 Fix hello example 1年前


An awful programming language

  • Only has three characters, all others are ignored: 4()
  • Operations are contained within parentheses, the first contained expression is the type. e.g. (44(444))
  • () is Nil.

Hello, world!

This is a simple program that outputs “Hello, world!” It's minimally optimized, and could almost certainly be made much smaller.


Value Types

Four supports the following data types:

  • Integer: Non-fractional numbers, created using the 4 literal or from various operations.
  • Nil: A type representing nothing, created using the () literal.
  • String: A string of 0 or more Unicode characters, created using “char code to string” and other operations.
  • Function: A callable procedure, created using “function declaration”. Usable as an operation.

List of Operations

ID Operation Description
0 function declaration Takes one expression as a parameter, and returns a callable function form of it. Functions can be used as operations.
1 multiply Takes any number of values and multiplies them, ignoring nils. If passed zero values, returns nil. Strings can be multiplied by integers for repetition.
4 add Takes any number of values and adds or concatenates them, ignoring nils. If passed zero values, returns nil.
8 divide Divides two numbers. If either value is nil, returns nil.
9 character from string Takes a string and an integer, returns the character at the given index in the given string as a string.
12 conditional Takes three values. If the first value is 4, the second is returned, otherwise the third is returned.
16 subtract Subtracts two numbers. If either value is nil, returns nil.
24 char code to string Interprets a number as a Unicode codepoint. Returns a string.
nil get Returns a function parameter by index.