Codd

From Esolang
Jump to navigation Jump to search
Not to be confused with the cellular automaton with the same name.

Codd, (which has nothing to do with Cod), is an esoteric programming language made by Areallycoolusername. It's meant to be a Turing complete language implementing the use of lambda calculus.

Instructions

Codd has 9 valid symbols and instructions, along with letters a-z (capital letters aren't supported), and numbers 0-9. The number of instructions are limited so that this language doesn't get too complicated and frustrating (as the higher a number each function represents, the more confusing the program is to read unfortunately).

Symbol Function
+ Adds
- Subtracts
( Used to multiply
) Used with ( to multiply
/ Divides
. Makes variables bound
λ Used to start function
` Prints values and functions

Specifics

Codd has an unbounded tape that holds user defined functions and values. The first cell on the tape and every 2 cells after that holds a function representing a number (basically a Church numeral).The second cell of the tape, and every 2 cells after that, will hold the number value represented by the Church numeral before it in the cell behind it (e.g the Church numeral λcv.c(v) represents the number 1. The function is stored in one cell, while its value is stored in the cell in front of it). Before anything is done, a function must be declared. For example:

λrx.r(r(r(z)))

This is the Church numeral for 3. The value of this function is stored in the cell next to it. In this case, the value is 3. If you want to print this variable and function, you have to utilize the "`". Use the print command with the position of the cell holding the value or function you want printed. The function in this case is held in cell position 1, and it's value is stored in cell position 2. So, we build a program based on this as follows:

λrx.r(r(r(z)))
`1`2

This program stores the Church numeral for 3 in the 1st cell, and prints that numeral along with its value, which is stored in the 2nd cell. A position must always be listed with the print command, or it will enter an infinite loop, printing spaces and newlines. The output of this program would be:

 
λrx.r(r(r(z)))
3

A Church numeral that represents a number outside of the ASCII range 32 to 126, will be ouput as an integer. Otherwise, it will be output as its corresponding ASCII character. Codd can also evaluate compound numerals. For example: λqe.q(e)(i) represents the function: λe.i(e) which represents 1. The simplified numeral will be the one stored in the cell, while the initial numeral will be discarded.

Hello World Program

Due to the time consuming nature of this program, a Wolfram language program has been made to print the functions necessary for this program, using square braces. Only the print instructions have been made by hand.

λrx.r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r[r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]]

λzx.z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[z[x]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

λjk.j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[k]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

`2`4`6`6`8`10`12`14`8`16`6`18`20

Wolfram Program

This is the Wolfram program used to generate the Hello World program code.

NestList[r,x,72]
NestList[q,w,101]
NestList[v,u,108]
NestList[d,f,111]
NestList[e,g,44]
NestList[e,z,32]
NestList[p,o,119]
NestList[m,n,114]
NestList[z,x,100] 
NestList[j,k,118]

See also