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 / omc / om2 / s2 / u1r.om
| 1 | om2 |
| 2 | fn sq x uint to uint |
| 3 | ret mul x x |
| 4 | end |
| 5 | fn mix a uint b uint to uint |
| 6 | if gt a b |
| 7 | ret xor a b |
| 8 | end |
| 9 | ret add rotr a 3 sq b |
| 10 | end |
| 11 | fn main to int |
| 12 | w = new uint 16 0 |
| 13 | for i ulong 16 |
| 14 | put w i uint add mul i 3 1 |
| 15 | end |
| 16 | s = uint 0 |
| 17 | for i ulong 4 |
| 18 | for j ulong 4 |
| 19 | s = add s mix get w add mul i 4 j uint j |
| 20 | end |
| 21 | end |
| 22 | k = ulong 0 |
| 23 | while lt k 3 |
| 24 | s = add s sq uint k |
| 25 | k = add k 1 |
| 26 | end |
| 27 | ret int and s 127 |
| 28 | end |