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 / s4 / v-text-empty-loop.om
| 1 | note S4 empty text: a callee that walks its view (for i ulong len s, get s i) reads no byte of `text e ""`. |
| 2 | note x = 100000000 is live in the register the old lowering read as the count, so the old loop ran off the |
| 3 | note image (SIGSEGV). Exit 0 when the sum is 0, else 1. |
| 4 | om2 |
| 5 | text e "" |
| 6 | fn sum s view uchar * to ulong |
| 7 | t = ulong 0 |
| 8 | for i ulong len s |
| 9 | t = add t ulong get s i |
| 10 | end |
| 11 | ret t |
| 12 | end |
| 13 | fn main to int |
| 14 | x = ulong 100000000 |
| 15 | if ne sum e 0 |
| 16 | ret 1 |
| 17 | end |
| 18 | ret int sub x 100000000 |
| 19 | end |