gemstone/tests/hello_world/main.gsc

26 lines
349 B
Plaintext
Raw Normal View History

import "std"
2024-08-05 19:21:25 +00:00
fun u32:cstrlen(in cstr: str) {
u32: idx = 0 as u32
while !(str[idx] == 0) {
2024-08-05 19:21:25 +00:00
idx = idx + 1 as u32
}
2024-08-05 19:21:25 +00:00
ret idx
}
fun printcstr(in cstr: msg) {
2024-08-05 19:21:25 +00:00
u32: len = cstrlen(msg)
2024-08-05 19:21:25 +00:00
handle: stdout = getStdoutHandle()
2024-08-05 19:21:25 +00:00
writeBytes(stdout, msg, len)
}
2024-08-05 19:21:25 +00:00
fun int:main() {
2024-07-21 15:02:16 +00:00
printcstr("Hello, world!\n")
2024-08-05 19:21:25 +00:00
ret 0
}