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.

9 trits, 19683 trytes

From Esolang
Jump to navigation Jump to search
Note: This page has been generated by Claude.

This is an esolang User:Miui generated with Claude. It is a sister language of 6 trits, 243 trytes by islptng. Unlike most of "x bits, y bytes", this esolang is serious. Unlike its sister, its memory is multiplicative. Note: 1 tryte is 9 trits.

Syntax

This language uses the balanced ternary. The syntax is like a high-level language, because it has "if", "while", "break", etc. However, it has only a limited memory of 118,098 trits (13,122 trytes), while program is stored in the memory.
Values are wrapped at 19683 (i.e. 9841+1=-9841).
Memory is NOT addressed linearly. The valid addresses are exactly the 13,122 trytes from -9841 to 9841 that are not divisible by 3 (the multiplicative units modulo 19683). If an address divisible by 3 is given, 1 is added to it. The successor of a cell is found by doubling: the cell after address a is address 2a. Because 2 generates the whole unit group modulo 3^9, repeated doubling visits every cell exactly once before returning, so memory is one single cycle of 13,122 trytes with no other wrap point. The program is loaded starting at address 1, one tryte per cell, along the doubling order (cell number k of the program lives at address 2^k). Consequently, the "linear position" of an address is its discrete logarithm base 2, and a memory dump in address order is a log table.
Note that every instruction begins on a tryte boundary; unused trailing trits before the next boundary are 0 and are skipped by the parser. Address and value fields are 9 trits.

Note that because memory advances by doubling, a pointer is stepped to the next cell with mul by 2, not add by 1. mul by 2 of any valid address is again a valid address, so pointers can never leave memory.

Examples

Hello World

Character:

while neg eql get_p get_endptr then do putch do p:data end set_p mul get_p get_const2 end halt
data: 72 101 108 108 111 44 32 87 111 114 108 100 33 10 const2:2 endptr:17087

Ternary dump:

11t1110t1 0111t0000 001ttt1t0
t1t0t0t01 100000000 1t0000000
111t1t1t0 t0000tt0t 110000000
t0001ttt1 t11100100 001ttt1t0
0tt1100tt 110000000 110t00000
; below is decimal
72 101 108 108 111 44 32 87 111 114 108 100 33 10 2 17087

The pointer field p is program tryte 7, so it lives at address 2^7 = 128. The data begins at program tryte 15, address 2^15 = 13085, and each set_p doubles the pointer to reach the next character. After the last character (program tryte 28) the pointer doubles to 2^29 = 17087, which is what endptr holds, so the loop exits. Note that endptr holds an address as data: the end marker is not a value sentinel as in the sister language, but the discrete-log successor of the last character.

Kontakion:

The same program expressed as a loader Kontakion. Each entry's heptavintimal key is one tryte value and the last three terscii-decoded hexadecimal digits of its address give the discrete log k of the cell, so the loader stores each key at address 2^k. Unlike a machine-generated Kontakion, a loader Kontakion retains duplicate keys (the three D0 entries are the three letters l).

0:B<020272520263021243>83563737673101556708374671
1:J<020272521202021233>83563737673101556708374671
2:AE<020272521272021252>83563737673101556708374671
3:AF<020272521212021223>83563737673101556708374671
4:AQ<020272521282021242>83563737673101556708374671
5:BR<020272521243020263>83563737673101556708374671
6:CF<020272521262021262>83563737673101556708374671
7:CS<020272521222021213>83563737673101556708374671
8:CT<020272521233021202>83563737673101556708374671
9:D0<020272521223021212>83563737673101556708374671
10:D0<020272521213021222>83563737673101556708374671
11:D0<020272521232021203>83563737673101556708374671
12:DC<020272521203021232>83563737673101556708374671
13:DC<020272521252021272>83563737673101556708374671
14:DF<020272521242021282>83563737673101556708374671
15:NF<020272522213020222>83563737673101556708374671
16:NF<020272522212020223>83563737673101556708374671
17:DF0<020272522223020212>83563737673101556708374671
18:F00<020272522272020252>83563737673101556708374671
19:I00<020272522282020242>83563737673101556708374671
20:KLY<020272522233020202>83563737673101556708374671
21:KR0<020272521253020253>83563737673101556708374671
22:L00<020272522242020282>83563737673101556708374671
23:L00<020272521263020243>83563737673101556708374671
24:LTF<020272522262020262>83563737673101556708374671
25:QYQ<020272522252020272>83563737673101556708374671
26:RAP<020272522232020203>83563737673101556708374671
27:SWS<020272522203020232>83563737673101556708374671
28:VII<020272522222020213>83563737673101556708374671
29:WKW<020272522202020233>83563737673101556708374671
30:WKW<020272520253021253>83563737673101556708374671

The word field is the terscii of Hello, World! and the radix field counts down from 29996 following the Kontakion convention.

See also

Alexandrion