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
omega-mv / seed / host / affinity / caller-main.om
| 1 | note Compose after the existing run.om helpers, replacing only its benchmark main. |
| 2 | fn main to int |
| 3 | mask = new uchar 128 0 |
| 4 | n = cpuget 0 mask 0 128 |
| 5 | if le n 0 |
| 6 | ret 91 |
| 7 | end |
| 8 | core = ulong 1024 |
| 9 | for i ulong 128 |
| 10 | if ne get mask i 0 |
| 11 | for j ulong 8 |
| 12 | if ne and get mask i shl uchar 1 uchar j 0 |
| 13 | core = add mul i 8 j |
| 14 | break |
| 15 | end |
| 16 | end |
| 17 | break |
| 18 | end |
| 19 | end |
| 20 | if eq argcnt 3 |
| 21 | core = 1024 |
| 22 | end |
| 23 | pbclr |
| 24 | pbnum core |
| 25 | setslot 6 |
| 26 | n = argread 1 gcd 0 4096 |
| 27 | if le n 0 |
| 28 | ret 92 |
| 29 | end |
| 30 | put gcdn 0 ulong n |
| 31 | cpk1 |
| 32 | ret int runpk |
| 33 | end |