Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/utils/docs/platforms.md
diff options
context:
space:
mode:
Diffstat (limited to 'utils/docs/platforms.md')
-rwxr-xr-xutils/docs/platforms.md10
1 files changed, 7 insertions, 3 deletions
diff --git a/utils/docs/platforms.md b/utils/docs/platforms.md
index 18d3b89..5e25b26 100755
--- a/utils/docs/platforms.md
+++ b/utils/docs/platforms.md
@@ -20,9 +20,13 @@ Creating new Platform Adapters
We have a template for new platforms at "platforms/template" that you can copy to "platforms/{name}" and fill in the blanks. These consist of:
-1. A shell script at "platforms/{name}/bin/platform-{name}" that executes the interpreter engine of choice and causes it to load a bootstrap script. This script will be loaded by "bin/narwhal" with `NARWHAL_HOME` set to the Narwhal project directory. This script will be run if `NARWHAL_PLATFORM` is set to your platform name. You can set `NARWHAL_DEFAULT_PLATFORM` or `NARWHAL_PLATFORM` in a "narwhal.conf" in your Narwhal project directory (template provided).
+1. An executable (shell script or binary) at "platforms/{name}/bin/platform-{name}" that executes the interpreter engine of choice and causes it to load a bootstrap script. This script will be loaded by "bin/narwhal" with the environment variable `NARWHAL_HOME` set to the Narwhal project directory and `NARWHAL_PLATFORM_HOME` set to the platform directory. This script will be run if `NARWHAL_PLATFORM` is set to your platform name. You can set `NARWHAL_DEFAULT_PLATFORM` or `NARWHAL_PLATFORM` in a "narwhal.conf" in your Narwhal project directory (template provided).
-2. A "thunk", at `platforms/{name}/bootstrap.js` that evaluates `narwhal.js` and passes the returned function a preliminary `system` object with a few required properties (`global`, `evalGlobal`, `platform`, `platforms`, `print`, `evaluate`, `prefix`, `fs.read`, and `fs.isFile`).
+2. A "thunk", at `platforms/{name}/bootstrap.js` that evaluates `narwhal.js` and passes the returned function a preliminary `system` object with a few required properties (`global`, `evalGlobal`, `platform`, `platforms`, `print`, `evaluate`, `prefix`, `fs.read`, and `fs.isFile`). This should be enough to get to an interactive console.
-2. Platform implemenations for core modules, such as `file` and `system` located in `platforms/{name}/lib/`. You can implement `file-platform` instead of `file` if you implement the subset of the ServerJS file API used by `lib/file.js`. To get things running, you must implement the file module's `list`, `canonical`, `mtime`, `isDirectory`, `isFile`.
+3. Platform implementations for core modules, such as `file` and `system` located in `platforms/{name}/lib/`. You can implement `file-platform` instead of `file` if you implement the subset of the ServerJS file API used by `lib/file.js` (and similar for `io`, `os`, `binary`, etc). The next steps are:
+
+ * system: You must implement `system.args` to be able to pass command line options to Narwhal.
+
+ * file: To enable the package system you must implement `list`, `canonical`, `mtime`, `isDirectory`, `isFile`.