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 / sites / found-xarray-2.om

35 lines · 737 bytes Raw Blame History
1target x86linux
2note ok.om: an OM-2 function unit (no fn main) using every function-mode host word: getuid geteuid
3note getgid getegid, stat lstat fopen fstat fclose, and read. Compiles (exit 0) since the om2 function-mode
4note host-word subset; the same unit without the om2 line is error 9 (om1.om).
5om2
6fn ids to ulong
7a = ulong getuid
8b = ulong geteuid
9c = ulong getgid
10e = ulong getegid
11ret add add a b add c e
12end
13fn peek p view uchar * to long
14s = new uchar 9999999 0
15r = lstat p 0 len p s 0 128
16if ne r 0
17ret r
18end
19r = stat p 0 len p s 0 128
20if ne r 0
21ret r
22end
23fd = fopen p 0 len p 559104 0
24if lt fd 0
25ret fd
26end
27b = new uchar 16 0
28k = fstat int fd s 0 128
29n = read int fd b 0 16
30z = fclose int fd
31if ne k 0
32ret k
33end
34ret n
35end