summaryrefslogtreecommitdiff
path: root/examples/hello.sysf
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hello.sysf')
-rw-r--r--examples/hello.sysf54
1 files changed, 54 insertions, 0 deletions
diff --git a/examples/hello.sysf b/examples/hello.sysf
new file mode 100644
index 0000000..7b300fb
--- /dev/null
+++ b/examples/hello.sysf
@@ -0,0 +1,54 @@
+; hello -- friendly greeting program
+;
+; Print a friendly, non-customizable greeting.
+
+; Copyright (C) 2026 Sebastian G. Kirmayer <gloria@gloria-mundi.eu>
+;
+; Permission to use, copy, modify, and/or distribute this software for any
+; purpose with or without fee is hereby granted.
+;
+; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+; AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+; OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+; PERFORMANCE OF THIS SOFTWARE.
+
+/\IO\fix:\/X((X->IO)->X->IO)->X->IO\read:IO->IO->IO->IO\write0:IO->IO\write1:IO->IO\exit:IO
+
+(\m:(IO->IO)->IO m
+ \r:IO write0 (write0 (write0 (write1 (write0 (write0 (write1 (write0 r)))))))
+)\H:IO->IO
+(\m:(IO->IO)->IO m
+ \r:IO write1 (write0 (write1 (write0 (write0 (write1 (write1 (write0 r)))))))
+)\e:IO->IO
+(\m:(IO->IO)->IO m
+ \r:IO write0 (write0 (write1 (write1 (write0 (write1 (write1 (write0 r)))))))
+)\l:IO->IO
+(\m:(IO->IO)->IO m
+ \r:IO write1 (write1 (write1 (write1 (write0 (write1 (write1 (write0 r)))))))
+)\o:IO->IO
+(\m:(IO->IO)->IO m
+ \r:IO write0 (write0 (write1 (write1 (write0 (write1 (write0 (write0 r)))))))
+)\comma:IO->IO
+(\m:(IO->IO)->IO m
+ \r:IO write0 (write0 (write0 (write0 (write0 (write1 (write0 (write0 r)))))))
+)\space:IO->IO
+(\m:(IO->IO)->IO m
+ \r:IO write1 (write1 (write1 (write0 (write1 (write1 (write1 (write0 r)))))))
+)\w:IO->IO
+(\m:(IO->IO)->IO m
+ \r:IO write0 (write1 (write0 (write0 (write1 (write1 (write1 (write0 r)))))))
+)\r:IO->IO
+(\m:(IO->IO)->IO m
+ \r:IO write0 (write0 (write1 (write0 (write0 (write1 (write1 (write0 r)))))))
+)\d:IO->IO
+(\m:(IO->IO)->IO m
+ \r:IO write1 (write0 (write0 (write0 (write0 (write1 (write0 (write0 r)))))))
+)\excl:IO->IO
+(\m:(IO->IO)->IO m
+ \r:IO write0 (write1 (write0 (write1 (write0 (write0 (write0 (write0 r)))))))
+)\lf:IO->IO
+
+H (e (l (l (o (comma (space (w (o (r (l (d (excl (lf exit)))))))))))))