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/fib.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 / fib.om` 34 lines ยท 697 bytes Raw Blame History 1 note fib: doubly recursive Fibonacci of 38 (ulong); prints fib(38). Call and return heavy. 2 note OMC-EFF-2: main writes the nanoseconds between its two monons readings (the computation, without 3 note start-up and output) as one decimal line on stderr; stdout is unchanged. 4 om2 5 global obuf uchar 32 6 fn putnum fd int v ulong to void 7 put obuf 31 10 8 p = ulong 31 9 x = v 10 while gt x 9 11 p = sub p 1 12 put obuf p uchar add rem x 10 48 13 x = div x 10 14 end 15 p = sub p 1 16 put obuf p uchar add x 48 17 w = write fd obuf p sub 32 p 18 end 19 fn fib n ulong to ulong 20 if lt n 2 21 ret n 22 end 23 a = fib sub n 1 24 b = fib sub n 2 25 ret add a b 26 end 27 fn main to int 28 t0 = monons 29 r = fib 38 30 t1 = monons 31 putnum 2 ulong sub t1 t0 32 putnum 1 r 33 ret 0 34 end