interplane.Get Omega
Read in your language

omega-bridge

Omega-first language interoperability: checked conversion backends and native language bindings

Brought by drakestapleton

branch main Branches Tags History

omega-bridge / tests / fixtures / bytecopy.om

23 lines · 412 bytes Raw Blame History
1note byte copy: read up to 65536 bytes, copy them byte by byte into a second pool reversed, write it
2global src uchar 65536
3global dst uchar 65536
4fn fill to ulong
5t = ulong 0
6k = read 0 src 0 len src
7while gt k 0
8t = add t ulong k
9k = long 0
10if lt t len src
11k = read 0 src t sub len src t
12end
13end
14ret t
15end
16fn main to int
17n = fill
18for i ulong n
19put dst sub sub n i 1 get src i
20end
21w = write 1 dst 0 n
22ret 0
23end