data/cookbooks: add full-Jerboa jerbuild-binary recipe
ober
c5d5f2142bdf727f4ba0b8735953da1f809f3f25
--- a/data/cookbooks.sexp +++ b/data/cookbooks.sexp @@ -1,5 +1,17 @@ ((("code" . + "(import (jerboa prelude) (std misc thread))\n\n;; A complete full-Jerboa entry: ONLY (jerboa prelude) + (std ...),\n;; with NO #!chezscheme directive and NO (except (chezscheme) ...) header.\n(def (main)\n (displayln (cpu-count))\n (let ([t (thread-start! (make-thread (lambda () (* 6 7))))])\n (displayln (thread-join! t))))\n\n(main)\n\n;; Build a native executable (run in a shell; needs the jerbuild symlink):\n;; jerbuild binary ./entry.ss myprog\n;; ./myprog") ("id" . "jerbuild-binary-full-jerboa-entry") + ("imports" "(jerboa prelude)" "(std misc thread)") + ("notes" + . + "jerbuild binary <entry.ss> <out> compiles via compile-program, which (unlike scheme --script) supplies no implicit base language. (jerboa prelude) and (std ...) are ADDITIVE over (chezscheme), not a standalone base, so a raw full-Jerboa entry would otherwise fail to compile with unbound display, /, etc. jerbuild auto-detects an entry importing no chez base ((chezscheme)/(rnrs)/(scheme)) and wraps it, prepending (import (except (chezscheme) <conflicts>) <orig-imports>); the except-list is computed dynamically via environment-symbols (the prelude/std export names that collide with chezscheme). So you write clean Jerboa with no #!chezscheme. Needs the jerbuild multicall symlink: the C launcher sets JERBOA_MULTICALL_NAME from argv0, so JERBOA_MULTICALL_NAME=jerbuild jerboa does NOT work. On macOS, make install ad-hoc re-signs the binary because overwriting a Mach-O invalidates its signature and the kernel SIGKILLs it (Killed: 9).") + ("tags" "jerbuild" "binary" "native" "executable" "compile" + "prelude") + ("title" + . + "Compile a full-Jerboa .ss to a native binary with jerbuild")) + (("code" + . "(import (jerboa prelude))\n\n; Now you have: def, defstruct, defclass, defmethod, match, try/catch,\n; hash, sort, format, JSON, path, string, list, alist operations\n(def (greet name)\n (format \"Hello, ~a!\" name))\n\n(display (greet \"World\"))\n(newline)") ("id" . "jerboa-import-prelude") ("imports" "(jerboa prelude)") ("notes"