From: Michael D. Lowis Date: Sun, 24 May 2020 02:42:21 +0000 (-0400) Subject: added pages for mdlowis.com X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=ff100de00b6fff28982e4305c41132ee43093f15;p=projs%2Fawiki.git added pages for mdlowis.com --- diff --git a/awiki.rb b/awiki.rb index 6128e9e..227ccb2 100755 --- a/awiki.rb +++ b/awiki.rb @@ -5,7 +5,6 @@ require 'webrick' require 'redcarpet' # TODO: -# * Copy auxiliary files over # * Add page attachment mechanism # * Add edit shortcut # * Add save shortcut @@ -14,7 +13,7 @@ require 'redcarpet' # * Add a move/rename method # * Add git revisioning for pages -SITE_TITLE = "awiki" +SITE_TITLE = "Michael D. Lowis" SERVER_PORT = (ARGV[0] || 8080) HTML_DIR = "./html/" PAGES_DIR = "./pages/" @@ -22,6 +21,14 @@ VIEW_TEMPLATE = "config/page.html.erb" EDIT_TEMPLATE = "config/editor.html.erb" PLANTUML_JAR = "config/plantuml.jar" PLANTUML_CMD = "java -jar #{PLANTUML_JAR} -tsvg -pipe" +EDIT_SCRIPT = <<-eos + +eos class Page def initialize(src) @@ -110,8 +117,9 @@ def genpage(path, src, force=false) html = File.read(htmlfile) end gensitemap() - html.sub("", - "[edit]") + html = html.sub("", + "[edit]") + html.sub("", EDIT_SCRIPT) end def do_post(req, res, path) diff --git a/config/page.html.erb b/config/page.html.erb index 23f0893..04904d4 100644 --- a/config/page.html.erb +++ b/config/page.html.erb @@ -98,28 +98,31 @@ -
-
- -
+ -
- <%= @article %> -
+
+ <%= @article %> +
- \ No newline at end of file diff --git a/pages/zam.md b/pages/zam.md new file mode 100644 index 0000000..5ce1597 --- /dev/null +++ b/pages/zam.md @@ -0,0 +1,40 @@ +# ZINC Abstract Machine + +## Registers +* **accum** - accumulator register + +## Instruction Set +* **const8(int8)** - Put int8 constant into the accumulator +* **const16(int16)** - Put int16 constant into the accumulator +* **const32(int32)** - Put int32 constant into the accumulator +* **const64(int64)** - Put int64 constant into the accumulator +* **atom(n)** - Pointer to a 0 sized block tagged *n* in the accumulator +* **get_global(int32)** - Load global into the accumulator +* **set_global(int32)** - Save the accumulator to the designated global + +## Function Handling +* **push, pushmark** - Push the accumulator (resp. a mark) on the argument stack +* **apply, appterm** - Call (resp. jump to) the closure contained in the accumulator +* **return** - If there is a mark on top of the argument stack, pop it and return to the caller; otherwise, jump to the closure contained in the accumulator +* **grab** - Popone value on the argument stack and put it in the environment; if the top of stack is a mark, build a closure and return it to the caller +* **cur(ofs)** - Build the closure of ofs with the current environment, and put it in the accumulator + +## Environment Handling +* **access(ofs)** - Fetch the nth slot in the environment, and put it in the accumulator +* **let** - Put the value of the accumulator in front of the environment +* **endlet(n)** - Throw away the first n local variables from the environment +* **dummies(n)** - Put n dummy closures in front of the environment +* **update(n)** - Physically update the nth slot of the environment with the value of the accumulator +* **letrec1(ofs)** - Same as Dummies(1); Closure(ofs); Update(0) (A very frequent sequence, corresponding to `let rec f = function ... in ...` + +## Building and Destructuring Blocks + +## Integers + +## Floating Point Numbers + +## Strings + +## Predicates + +## Branches and Conditional Branches