Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/omc/tests/pools/g3i.om # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / omc / tests / pools / g3i.om` 74 lines ยท 1475 bytes Raw Blame History 1 om2 2 note gate-pools 3: enlarge runs inside the value of put, the index of get, and the counts of read and 3 note write; every call grows the pool it serves by 4096 elements and a blocker pool beside it, so mremap 4 note moves the regions and later mappings reuse the old addresses (the gate counts both with strace). 5 note stdin: the 40 bytes abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN. Every grower is an OM-2 inline body. 6 global P ulong * 7 global Q ulong * 8 global U uchar * 9 global V uchar * 10 global ob uchar 24 11 fn pnum v ulong to void 12 put ob 23 10 13 i = ulong 23 14 x = v 15 go = true 16 while go bound 21 17 i = sub i 1 18 put ob i uchar add rem x 10 48 19 x = div x 10 20 go = ne x 0 21 end 22 k = write 1 ob i sub 24 i 23 end 24 fn plong v long to void 25 if lt v 0 26 put ob 0 uchar 45 27 k = write 1 ob 0 1 28 pnum ulong neg v 29 else 30 pnum ulong v 31 end 32 end 33 fn gv v ulong to ulong inline 34 r = enlarge P add len P 4096 35 r = enlarge Q add len Q 4096 36 ret v 37 end 38 fn gi j ulong to ulong inline 39 r = enlarge P add len P 4096 40 r = enlarge Q add len Q 4096 41 ret j 42 end 43 fn gu n ulong to ulong inline 44 r = enlarge U add len U 4096 45 r = enlarge V add len V 4096 46 ret n 47 end 48 fn main to int 49 r = enlarge Q ulong 1 50 r = enlarge P ulong 1 51 r = enlarge V ulong 1 52 r = enlarge U ulong 64 53 j = ulong 0 54 while lt j 40 55 put P j gv add mul j 3 1 56 x = get P gi j 57 pnum x 58 k = read 0 U j gu 1 59 k = write 1 U j gu 1 60 pnum ulong k 61 j = add j 1 62 end 63 k = write 1 U 0 40 64 s = ulong 0 65 j = ulong 0 66 while lt j 40 67 s = add s get P j 68 j = add j 1 69 end 70 pnum s 71 pnum len P 72 pnum len U 73 ret 0 74 end