Cathain (Irish Gaelic for "when", /kəˈhɪnʲ/ "kah-HIN" or /ˈkahənʲ/ "KAH-huhn") is an esolang created by Nurdle. Inspired by languages like Slashes and Thue, its main function is text replacement, however, instead of text, it's actually bits represented as hexidecimal. It also introduces goto-labels and "timelines".
the initial state is
there are only 3 commands in Cathain:
||Define a goto label|
||Goto a label|
||Replace text with something else|
if you try to call a goto label that hasn't been defined then the timeline terminates and returns
In Cathain, there are timelines, every timeline is defined by a list of bits, every bit corresponds to one of the commands in the given script.
if a bit is on, then its corresponding command will be run in its timeline.
if a bit is off, then its corresponding command will be ignored.
This does include commands that define a label, if a label isn't declared then the timeline will terminate if it tries to call said label.
This program is used to show how the timeline system works:
ff 0f f a
timeline 0 (00) 0 FF 1 FF hex: 0xFF string: 'ÿ' timeline 1 (01) 0 FF 1 AA hex: 0xAA string: 'ª' timeline 2 (10) 0 0F 1 0F hex: 0x0F string: '\x0f' timeline 3 (11) 0 0F 1 0A hex: 0x0A string: '\n'
- Arís - another language that uses time as a core mechanic of the language.
- Python Cathain Interpreter by Nurdle