summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--HelloWorld/hello.b15
-rw-r--r--README.md16
3 files changed, 33 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..78af015
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.sbl
+*.dis
diff --git a/HelloWorld/hello.b b/HelloWorld/hello.b
new file mode 100644
index 0000000..2621594
--- /dev/null
+++ b/HelloWorld/hello.b
@@ -0,0 +1,15 @@
+implement Hello;
+
+include "sys.m";
+include "draw.m";
+
+Hello: module {
+ init: fn(nil: ref Draw->Context, nil: list of string);
+};
+
+init(nil: ref Draw->Context, nil: list of string) {
+ sys := load Sys Sys->PATH;
+
+ sys->print("Hello World! ☺\n");
+ exit;
+}
diff --git a/README.md b/README.md
index 852daa8..cc3ac6c 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,22 @@ Programming examples in the spirit of [gobyexample](https://github.com/mmcgrana/
These exercises are tested on the [purgatorio](http://code.9front.org/hg/purgatorio/) fork of the Inferno operating system.
+The `;` rune in examples indicates a command to be run from the Inferno sh(1) shell.
+
+## Building
+
+If a given example provides a mkfile:
+
+ ; mk
+
+Otherwise, there will only be one file, a Limbo source file which can be built with:
+
+ ; limbo file.b
+
+You could then run said file with:
+
+ ; file
+
## Index
[Hello World](./HelloWorld)