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-1.om

36 lines · 743 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 128 0
15r = lstat p 0 len p s 0 128
16if ne r 0
17if ne r 0
18ret r
19end
20r = stat p 0 len p s 0 128
21if ne r 0
22ret r
23end
24fd = fopen p 0 len p 559104 0
25if lt fd 0
26ret fd
27end
28b = new uchar 16 0
29k = fstat int fd s 0 128
30n = read int fd b 0 16
31z = fclose int fd
32if ne k 0
33ret k
34end
35ret n
36end