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.

Reference

From Esolang
Jump to navigation Jump to search

Reference is an esolang invented by User:None1 that can read its source code, but not modify it.

Commands

Command table
Command Meaning Example
[i~j] (i,j are positive decimal integers) Output the i-th to the j-th characters of the source code [3~5] prints the third to the fifth characters of the source code
\ Escape character \x prints x.
Other characters Print themselves a prints a

When the parser sees a [, it tries to find the nearest ], if there is no nearest ] or the things between the two brackets do not follow the [i~j] format, the [ is treated as Other characters.

Files in Windows use CR+LF as newlines, to avoid this issue, an interpreter removes all CR characters in the source code read before interpreting it.

Examples

Hello, World!

Hello, World!

Quine

Quine

Another Quine (cheating)

[1~5]

Output [

\[

Output ]

]

Truth-machine

Only works if it supports nested reference (interpret the selected characters), and input 0 prints 0[0~6.

[11~2x]____[5~5][0~6]

x is the input.