omega-rosetta
aien-dev/omega-rosetta
Brought by drakestapleton
omega-rosetta / tasks / hello-world / hello-world.om
| 1 | note Rosetta Code task "Hello world/Text": https://rosettacode.org/wiki/Hello_world/Text |
| 2 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 3 | om2 |
| 4 | text msg "Hello world!\n" |
| 5 | note emit writes every byte of a to stdout; a short write is retried, an error exits 1 |
| 6 | fn emit a view uchar * to void |
| 7 | o = ulong 0 |
| 8 | while lt o len a bound 4096 |
| 9 | k = write 1 a o sub len a o |
| 10 | if le k 0 |
| 11 | exit 1 |
| 12 | end |
| 13 | o = add o ulong k |
| 14 | end |
| 15 | end |
| 16 | fn main to int |
| 17 | emit msg |
| 18 | ret 0 |
| 19 | end |