Sex documentation engine survey #32
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We will keep in mind that agents need some kind of docs extracted from
humanshuman docs too. Yes?Sex has single documentation surface:
Readme.org. Ground truth istests/andexample/*.sex. The compiler already exposes the observability a good language site needs:sexc -C— generated Csexc -m— macro-expanded Sexsexc --public-interface— what(import …)pastes (pubforms + docstrings)sextest— compile + run + expected I/OA docs engine that does not plug into those four is just a prettier Markdown site.
What “good PL docs” actually are
Four jobs, usually split across tools (Diátaxis):
pub+ docstrings (rustdoc, ExDoc, odoc).Plus two Sex-specific jobs:
llms.txttree that cannot drift from the human site.Red Blob Games hexagons is the right tutorial aesthetic (SVG + Vue/D3, reader mutates inputs, diagram updates) and the wrong engine: Amit wrote custom JS per concept. That scales to a handful of explorable pages, not a language manual. Use it as a widget style inside a real docs compiler.
Landscape, grouped by what they optimize
1. Prose site generators (you write Markdown; they theme, search, nav)
Strong at manuals. Weak at “this
fnexists because the compiler said so” unless you add a plugin.doctest, PDF, cross-refs that fail the build if a symbol is missing. Custom Sex domain (:sex:fn:,:sex:macro:, …) is the documented extension path. MyST lets current.mdstay Markdown. Not pretty by default; themes (Furo, Book, PyData) fix that. Python toolchain next to a Chicken compiler.mdbook testare the pattern Sex wants, but they are Rust-shaped. Preprocessors are stdin/stdout JSON — implementable in Chicken. Weak as an API reference (Rust uses rustdoc beside the book).2. Language-native autodoc (compiler emits the reference)
This is what serious compiled languages eventually grow. Sex would have to write this layer regardless of host.
.mldfor prose.llms.txt. Closest existing product to “human site and agent corpus from one source”.nim doc— compiler-built HTML/LaTeX/JSON from##comments and standalone Markdown/RST, with checked links between them. Architecturally the closest to “fold docs intosexc”.zig std). Interesting long-term (interactive stdlib browser); large investment.3. Document-as-program (culturally closest to Sex)
Prose is a program. Tags are functions. Build-time evaluation.
defform,defproc, BNF,examplesthat run at doc-build, in-source docs. Best PL documentation language in existence. Host is Racket, Sex is Chicken — a second Scheme, not a free lunch.Readme.org) — babel can tangle/run blocks; ox-html/ox-hugo publish. Fine for the project README; a weak multi-page language site unless you commit to a full Org publishing pipeline.If docs were written in Sex or Chicken S-exprs, this family is the honest design. It fights the existing Markdown-for-agents tree unless you generate
docs/llms/from the Scribble/Org source.4. Computational / explorable publishing
{ojs}(Observable). Best off-the-shelf Red-Blob-like diagrams in a docs toolchain. Weak Sex semantics; strong for a “how hex grids / how the type checker” explainer chapter..sex” widget once asexcsandbox exists.sexc -Cis a tiny Compiler Explorer.Elixir Livebook and the Go Tour are interactive tutorials with a language runtime in the browser or a backend. Sex has no GC’d interpreter; a Tour implies sandboxing
sexc+cc(server) or a future WASMsexc(Chicken static + WASI is a research project, not a docs milestone).Constraints that knock options out
sexc(and maybe a small compile API) beats in-browser execution for years. Do not pick Jupyter/Thebe as the core.mdbook test/ Sphinx doctest: every fencedsexblock is a sextest (or at leastsexc -C). If the engine cannot fail CI on a stale snippet, it is not the language’s docs.llms.txtanddocs/llms/are load-bearing. Either Markdown is the source, or the engine emits them (ExDoc-style). Dual-maintaining HTML-only Scribble and hand Markdown will drift.What is worth writing ourselves
A full SSG (search, theming, i18n, PDF, mobile nav) is a trap. The Sex-specific core is small:
.sex, reuse--public-interface+ docstrings onpub fn/struct/defmacro/….-C/-msnapshots.sexfrom prose; run through sextest /sexc.-m|-C(build-time first; live compile later)#+linux/#+(and unix (not macosx))docs/llms/*.md+llms.txt.That core is “sexdoc”. The host is a commodity.
Shortlist (when we choose)
-Cdirectives, PDF, inventories. Keep writing Markdown. Interactive diagrams: raw HTML or a few JS islands, not the default. Best if the manual and reference matter more than a slick tutorial landing page.sexc,mdbook testanalogue. Pair with a later autodoc HTML forpubAPIs (the rustdoc split). Best if the first artefact is The Sex Book.docs/llms/from it. Highest ceiling, Racket (or Guile) as a third language, slowest to a decent site.sexc(Nim/rustdoc path) — right long-term for the reference; still needs a host for the tutorial. Do this after the IR exists, not as the first website.Not recommended as the primary engine: MkDocs-alone, Antora, Jupyter Book, Org-publish, Doxygen/Breathe-as-front, hand-rolled HTML like Red Blob for the whole manual.
Hybrid that most languages actually ship: book engine (A or B) + compiler-backed reference (E) + 2–3 explorable pages (Quarto
{ojs}or MDX diagrams). Codapi/CE-style “Run” only after a sandboxedsexcservice exists.Suggested evaluation, not implementation
If the next step is choosing (not building):
docs/llms/syntax.md) and one module with docstrings (tests/modules/greet.sex).pubAPI from--public-interface, and a snippet that shows Sex besidesexc -C.docs/llms/as either source or generated output in both prototypes; reject any pipeline that cannot produce it.greet, three-pane C view, agent Markdown, authoring friction.That comparison will decide A vs B (and whether C is worth it for diagrams) more honestly than a second survey.
Evaluation checklist
--public-interface, docstrings, and optional-C/-msnapshots; dual-emit HTML +docs/llmsgreet.sex, doctest viasexc/sextest, C pane directivellms.txt, authoring; pick host A/B/C/D