We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Coders Coding Coders

From Esolang
Jump to navigation Jump to search

Oh god this is way longer than I expected.

Coders Coding Coders is an Esolang by User:5anz, where instead of any normal form of flow control, requires Coders Coding Coders coders to code code that codes more code, which can get to the point of forcing said Coders Coding Coders coders have code's code coding coding coder's code... I may or may not have got a bit carried away there.

It's named after the Minecraft achievement Crafters Crafting Crafters, which requires an Auto Crafter to craft another Auto Crafter. Similarly, Coders Coding Coders requires a coder to code a coder (or, more accurately, code that writes code, and then runs it)

A notable difference between people who code in Coders Coding Coders and the coders of Codex is that coders of Coders Coding Coders are still coders.

Syntax

Coders Coding Coders has Basic-like syntax. Not really sure how else to explain it, so just know that the following line is valid.

IF num1[int] = num2 CODE "PRINT \"num1 equalled num2\""

It should be relatively easy to get you're head arounoh no I used the wrong your and my backspace key is broken I think

Functions

All parameters will be explained after this section.

Function Meaning
PRINT <str> Basically just Python's print(str)
SET <var> <val> Set var's value to val
COPY <var> <int> Set var's value to line int, Line numbers start indexing at 0
COPY <var> <int1>,<int2> Set var's value to all lines from int1 to int2
INPUT <var> Take input as a string, and set var to it. Basically just Python's var = input()
IF <bool> <func> As long as bool is true, run func. No, you cannot nest IF's, not like you'd even need to.
CODE <str> Write str to the next part of the next program to run. Like PRINT, but the code uses it later instead of the user reading it
RUN Stops the current program, and instead starts running the code coded by all the CODEs. Example Programs has a bunch of Hello, World! programs that use CODE and RUN.

Anything that starts with no capital letter is considered a comment.

Variables (and datatypes)

Variables must entirely consist of lower case letters and numbers, starting with the former (hell0 works, 4ello and Hell0 do not). Also, you can't name a variable i, true, or false.

They can be any of the following datatypes, which will also have maths stuff in their sections.

Note: Maths always runs left to right, though you can use brackets to kind of sort of break that a bit.

Integers (int)

Integers are whole numbers, that simple.

Maths Thing Meaning
int1 + int2 Equal to int1+int2
int1 - int2 Equal to int1-int2...
int1 * int2 Take a fat guess.
int1 / int2 Equal to int1/int2, always resulting in a float
int1 // int2 Equal to int1/int2 rounded towards 0
int1 ^ int2 Equal to int1^int2, as in exponent

Floats (float)

Decimal numbers, such as 3.14, 5.0, -2.7, etc. Has the same functions as integers, if floats are involved in a maths thing for integers, the result will always be a float, with 2 exceptions:

- num1 // num2 - will always be an integer

- num1 ^ num2 - if num1 is negative and num2 is a float, it will result in a complex number

Complex (cmx)

No, I wasn't joking about that, though if there's no imaginary component, it will turn into an integer. Both components are integers, it steals maths stuff from integers again, where stuff will always be complex (also / and // are the same) and no raising to the power of a complex number.

Also, they're written either as 3+4i, or -6i, depending on whether or not they have a real component.

Strings (str)

Moving away from that imaginary nonsense, strings are defined "kind of like this", 'or I guess this is ok too", and only have the function of +, which will concatenate two strings together. As long as one side is a string, they'll both act like a string.

Booleans (bool)

Booleans are basically just true/false. Booleans also work as integers 0 and 1 in numbers stuff.

Maths Thing True if...
val1 = val2 val1 and val2 are the same (datatype, and the data itself)
num1 > num1 num1 is greater than num2
num1 < num2 num2 > num1
num1 >= num2 (num1 = num2) or (num1 > num2)
num1 <= num2 (num1 = num2) or (num1 < num2)
bool1 and bool2 bool1 and bool2 are both true
bool1 or bool2 either bool1 or bool2 are true
not bool bool is false

Other stuff

Mainly parameter stuff from the Functions section. They're all just things that are combinations of other datatypes. These don't apply to casting.

Datatype Meaning
var Name of a variable, num works, but even if num = 5, 5 doesn't work.
val Any of the above
func Anything from the Functions section besides IF.
num Either an int, or a float.

Functions but slightly different

After any value, you may add on something with square brackets to apply a function to it. An example would be something like (3+4)[str], which is "7". It can also be stack (like "Hello!"[cn3][ord])

The following table will start with 5 castings

Function Meaning
int Round floats towards 0. Remove the imaginary component from complex numbers. If a string is just a number (like "8"), have it be that number.
float Makes integers floats (like 5 -> 5.0). Removes the imaginary component from complex numbers and do integer stuff. If a string is just float with one decimal point ("5" also works), make it that number.
cmx Makes strings with the format of either 3+4i or -6i that number.
str Makes integers, floats, complex numbers, and booleans that string.
bool As long as an integer, float, or complex number isn't 0, make it true, otherwise make it false. Strings are their corresponding thing.
chr Converts an integer into the corresponding character (through ASCII).
ord Converts a single-character string into the corresponding integer (through ASCII)
cn<int> Only uses the intth character of a string (so "345"[cn1] is "4").
cn<int1>,<int2> Uses the characters int1-int2 of a string (so "0123456789"[cn4,7] is "4567").

Practical Uses

Example Programs

Hello, World!

PRINT "Hello, World!"

Versions that use CODE and RUN

As promised in the functions section:

CODE "PRINT 'Hello, World!'"
RUN

Version that further uses SET:

CODE "SET hi 'Hello, World!'"
CODE "PRINT hi"
RUN

Note that this DOESN'T WORK, due to setting "Hello, World!" and printing it being in different codes (it actually results in an error, hi is considered undefined.):

SET hi "Hello, World!"
CODE "PRINT hi"
RUN

Note that this also doesn't work, as RUN is hit before PRINT:

SET hi "Hello, World!"
CODE "buffer text"
RUN
PRINT hi

Cheating quine

COPY file 0,1
PRINT file

Cat Program

INPUT cat
PRINT cat

99 bottles of beer

The first true use of CODE and RUN

SET bottles 99
PRINT bottles + " bottles of beer on the wall,"
PRINT bottles + " bottles of beer!"
PRINT "Take one down, pass it around,"
SET bottles bottles-1
PRINT bottles + " bottles of beer on the wall!"
PRINT
CODE "SET bottles " + bottles
COPY code 1,10
CODE code
IF bottles != 0 RUN

Does this count as self modifying?

Not sure if this counts as self-modifying, it uses its own interpreter, but it doesn't CHANGE it or anything? The description is pretty vague, so I've added it it anyways, but if anyone with more knowledge is reading, please remove either this part, or the Category. Actually remove this part either way but you know what I mean.