Skip to content

GWEB 0.3.0

Choose a tag to compare

@sjnam sjnam released this 30 Jun 12:42

GWEB 0.3.0 moves much closer to its model, CWEB, in how it typesets Go, and
restructures the repository down to the essentials — only the Go that bootstraps
gtangle is committed.

CWEB-faithful typesetting (gweave)

Operators and constants now print as CWEB does:

  • bitwise xor ^ (and ^=, &^, &^=) as a circled plus ;
  • == as , != as , <=/>= as /, ! as ¬, &&/|| as /,
    <</>> as /;
  • octal literals with a raised circle and oldstyle digits, hexadecimal with a
    superscript #, in typewriter;
  • nil as Λ, the way CWEB shows C's NULL;
  • a visible space for blanks inside string literals;
  • tighter inter-token spacing (\GS), matching CWEB's math spacing.

In a code comment, a |...| span is now set as inline Go and a \.{...} span as
typewriter, as in CWEB. \datethis (a dated listing) is implemented.

Contents & PDF outline

  • A double-star section @** is a top-level group, its title bold in the
    table of contents.
  • The PDF outline ends with a collapsible “Names of the sections” entry that
    lists every section name, each linking to where it is defined — as cweave
    does (localized and UTF-16BE-encoded for Korean).

Korean (kotexgweb)

Hangul inside Go strings, @d names, and \.{...} spans is set in a monospace
Hangul; cross-reference notes use the small font, matching the English side.

//line always on, like ctangle

gtangle always emits //line directives (the -line option is gone), so the
Go compiler, go vet, and panic traces report errors at .w positions.

Structure: commit only the bootstrap Go

Following CWEB's tradition, the repository now keeps just the source of truth:

  • the tangle and weave engines are folded into their commands — no more
    internal/tangle or internal/weave; each lives in its command’s main
    package (GWEB is a set of commands, not a library);
  • the tests live in the .w sources (a Tests chapter per web), tangled and
    git-ignored — no _test.go is committed;
  • only the Go needed to build gtangle the first time is committed; gweave and
    the rest are tangled by make;
  • the lit/ directory is gone — each .w sits beside the Go it generates
    (internal/web/web.w, cmd/gtangle/gtangle.w, cmd/gweave/gweave.w), with the
    master gweb.w at the repo root.

The self-hosting fixpoint still holds: make bootstrap reproduces the committed
Go byte-for-byte.

Editors

Editor support is now just the VS Code extension; the Emacs and Vim modes are
discontinued (use CWEB's).