interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / seed / omc / tests / pools / g8a.om

44 lines · 806 bytes Raw Blame History
1note gate-pools 8: run under prlimit --as=268435456: an 8 GiB enlarge returns -12, the pool is unchanged,
2note the program goes on and ends with its own status 7. Without the limit the first 8 GiB enlarge gives 0.
3global P ulong *
4global Q ulong *
5global ob uchar 24
6fn pnum v ulong to void
7put ob 23 10
8i = ulong 23
9x = v
10go = true
11while go bound 21
12i = sub i 1
13put ob i uchar add rem x 10 48
14x = div x 10
15go = ne x 0
16end
17k = write 1 ob i sub 24 i
18end
19fn plong v long to void
20if lt v 0
21put ob 0 uchar 45
22k = write 1 ob 0 1
23pnum ulong neg v
24else
25pnum ulong v
26end
27end
28fn main to int
29r = enlarge P ulong 1000
30plong r
31put P 5 42
32r = enlarge P ulong 1073741824
33plong r
34pnum len P
35pnum get P 5
36r = enlarge Q ulong 1073741824
37plong r
38pnum len Q
39r = enlarge P ulong 2000
40plong r
41pnum len P
42pnum get P 5
43ret 7
44end