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/bench/omc_efficiency/kernels/om2/leafcall.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 / bench / omc_efficiency / kernels / om2 / leafcall.om` 36 lines ยท 863 bytes Raw Blame History 1 note leafcall: a two-parameter leaf function called `30000000` times from a loop that keeps values 2 note live across the call; s = 1 + sum mix(i, `2654435761`), t = xor of every running s. Prints s then t. 3 note OMC-EFF-2: main writes the nanoseconds between its two monons readings (the computation, without 4 note start-up and output) as one decimal line on stderr; stdout is unchanged. 5 om2 6 global obuf uchar 32 7 fn putnum fd int v ulong to void 8 put obuf 31 10 9 p = ulong 31 10 x = v 11 while gt x 9 12 p = sub p 1 13 put obuf p uchar add rem x 10 48 14 x = div x 10 15 end 16 p = sub p 1 17 put obuf p uchar add x 48 18 w = write fd obuf p sub 32 p 19 end 20 fn mix x ulong k ulong to ulong 21 ret xor mul x k shr x 5 22 end 23 fn main to int 24 t0 = monons 25 s = ulong 1 26 t = ulong 0 27 for i ulong `30000000` 28 s = add s mix i `2654435761` 29 t = xor t s 30 end 31 t1 = monons 32 putnum 2 ulong sub t1 t0 33 putnum 1 s 34 putnum 1 t 35 ret 0 36 end