The manual pages
The page of each command and each word of SG, as man shows it in a terminal. It is made from
the same file as the page on the site, so the two never differ.
The commands, section 1
| sg-add(1) | Adds a package to sg.project and fetches it; with sg update, sg remove and sg lock, which keep sg.lock. |
| sg-build(1) | Compiles through C: a program, the program of its tests, a library C calls, or an object without an operating system. |
| sg-emit-c(1) | Prints the C that sg build compiles, for reading, for a sanitizer, or for a build of your own. |
| sg-help(1) | Prints the page of a word, a sign or a command of SG in the terminal, from sg itself, with no network. |
| sg-lsp(1) | The language server an editor starts: the first error as you type, and fixes applied with one click. |
| sg-test(1) | Runs the tests of a file, or of every module in a folder, in the interpreter or compiled. |
| sg(1) | Runs a program in the interpreter, from a file or a folder; the words after it are the program's own. |
The words, section 7
| sg-alias(7) | Gives a type a second name: the same type, which builds what it builds. |
| sg-align(7) | align(N) struct keeps every value of the type at a multiple of N bytes, wherever it is kept. |
| sg-as(7) | Names a value lent for a block: a shared value opened, a locked value taken, an item a select receives. |
| sg-assert(7) | Stops the program, or fails the test, when a condition is false. |
| sg-async(7) | Makes a function a light task, which may await and never holds its thread. |
| sg-atomic(7) | A number or a bool that tasks change without a lock, one step at a time. |
| sg-await(7) | Waits for a task in an async function, without holding the thread, and gives what it returned. |
| sg-bool(7) | true or false; the only type a condition can be. |
| sg-break(7) | Leaves the loop it is in, or the loop it names, at once. |
| sg-byte(7) | An integer of 8 bits, 0 to 255: one byte of a text, a file or a buffer. |
| sg-char(7) | One character of Unicode, in 32 bits; not a number. |
| sg-checked(7) | shared checked T: a shared value changed through any owner, each borrow of it checked while the program runs. |
| sg-conditional(7) | A value picked by a condition: a when c is true, b when it is false; only that arm runs. |
| sg-const(7) | A value fixed when the program is compiled. |
| sg-continue(7) | Ends this round of the loop and goes on with the next. |
| sg-double(7) | A fraction of 64 bits (IEEE 754); its arithmetic is the hardware's and never panics. |
| sg-else(7) | The block that runs when the condition of an if is false. |
| sg-embed(7) | embed("logo.gif"): the bytes of a file beside the source, read when the program is compiled and kept in it. |
| sg-enum(7) | Declares a type whose value is one of several variants, each with values of its own. |
| sg-export(7) | Makes a function of SG that C calls by its name, or through a CFunc, a pointer to a function as C has it. |
| sg-extern(7) | Declares the functions of a C library, or of a C file beside the program, to call inside unsafe. |
| sg-false(7) | The bool that is not true; what a comparison gives when it does not hold, and the zero value of a bool. |
| sg-float(7) | A fraction of 32 bits (IEEE 754), about 7 digits; half the size of a double, for large arrays and for C. |
| sg-for(7) | Goes over the numbers of a range or the items of a collection, one round for each. |
| sg-if(7) | Runs a block when a condition holds. |
| sg-in(7) | Stands between the name and the items in a for. |
| sg-index-from-end(7) | An index counted from the end: xs[^1] is the last item, xs[^n] is xs[xs.length() - n]. |
| sg-int(7) | An integer of 32 bits, with a sign; a whole number is one when nothing else is asked for. |
| sg-interface(7) | What a type can do; eight are built in and named after the colon, and a program cannot write its own yet. |
| sg-interpolation(7) | Text with values written into it, checked when the program is compiled; .toString() makes it a string. |
| sg-is(7) | Tests whether a value is one variant, or null, and names what it carries. |
| sg-list(7) | A list of items that grows, kept in one block of memory. |
| sg-lock(7) | A short block that alone touches a locked value; it never waits, so locks cannot deadlock. |
| sg-locked(7) | shared locked T: a value that tasks reach only inside a lock. |
| sg-long(7) | An integer of 64 bits, with a sign; for sums, sizes of files and time in milliseconds. |
| sg-match(7) | Chooses by the shape of a value; every case must be covered. |
| sg-new(7) | Puts a value on the heap and gives the pointer that owns it. |
| sg-nint(7) | An integer with a sign, as wide as an address; every length, index and position is one. |
| sg-not(7) | Turns the test of is around: x is not P, whose names are seen where the test failed. |
| sg-nuint(7) | An integer without a sign, as wide as an address; C's size_t, and an address as a number. |
| sg-null-coalescing(7) | The value of x, or y when x is null or an error. |
| sg-null-conditional(7) | A field or a method of x, or null when x is null. |
| sg-null(7) | No value; only a type written T? may hold it, and it is tested with is null. |
| sg-nullable(7) | A T that may be null; it is tested before it is used as a T. |
| sg-or(7) | Joins patterns: the arm, or the is, fits when one of them does. |
| sg-packed(7) | A struct with no padding between its fields and an alignment of 1, for a layout a file or a device gives. |
| sg-pointer(7) | A pointer that owns a value on the heap. |
| sg-public(7) | Shows a name to other modules; without it, a name stays inside its own module. |
| sg-range(7) | A range: the numbers from a up to b, without b; in a pattern, a..=b takes b too. |
| sg-raw(7) | An address of C, which owns nothing, may be null, and is not checked by the compiler. |
| sg-read(7) | Lends a value to be looked at, not changed. |
| sg-readonly(7) | Marks a field that is given when the value is built and never changed afterwards, nor anything behind it. |
| sg-ref(7) | Lends a value to be changed in place; the only borrow of it while it lasts. |
| sg-return(7) | Ends the function, with its value. |
| sg-sbyte(7) | An integer of 8 bits, with a sign, from -128 to 127: a small step, a reading, a signed byte of a file. |
| sg-share(7) | Makes one more owner of a shared value, or an owner from a weak look. |
| sg-shared(7) | shared T: a value on the heap with several owners, only read. |
| sg-short(7) | An integer of 16 bits, with a sign, from -32 768 to 32 767: a sample of sound, a field of two bytes. |
| sg-slice(7) | A slice: a window onto items that something else owns. |
| sg-static(7) | A value made once, the first time the program uses it. |
| sg-string(7) | Text in UTF-8 that owns its memory; read string is a borrow of it. |
| sg-struct(7) | Declares a type made of named fields, with the methods that work on them. |
| sg-test(7) | A block of checks written next to the code, which only sg test compiles and runs. |
| sg-this(7) | The value a method was called on; read this looks, ref this changes, this alone takes it. |
| sg-true(7) | The bool that is not false; what a comparison gives when it holds. |
| sg-try(7) | Opens a Result: its value, or the error handed to the caller. |
| sg-uint(7) | An integer of 32 bits without a sign, 0 to 4 294 967 295: for bits, masks, colors and hashes. |
| sg-ulong(7) | An integer of 64 bits without a sign, 0 to 18 446 744 073 709 551 615: for hashes, random numbers and sets of 64 bits. |
| sg-union(7) | A type whose fields all lie in the same bytes; it holds one of them at a time, read inside unsafe. |
| sg-unsafe(7) | Marks code the checker cannot follow: raw memory, calls of C, the fields of a union. |
| sg-use(7) | Brings the public names of a module into a file, to be written without the module in front. |
| sg-ushort(7) | An integer of 16 bits without a sign, from 0 to 65 535: a port, a field of a packet, a counter that wraps. |
| sg-var(7) | Declares a variable; its type comes from its value. |
| sg-void(7) | The return type of a function that gives nothing back. |
| sg-weak(7) | weak T: a look at a shared value that does not keep it alive; share asks for an owner. |
| sg-when(7) | Adds a condition to an arm of a match, or makes a lock block wait until one holds. |
| sg-while(7) | Repeats a block as long as a condition holds. |
| sg-with(7) | A copy of a struct with some fields changed: p with { x = 3 }. |
| sg-index(7) | every name in SG, as the index lists them |
In a terminal
man sg-build # the page of a command
man sg-read # the page of a word
man 7 sg-test # the word test; man sg-test is the command
man sg-index # every name
man -k sg # the pages of SG
The pages are installed with SG. From a copy of the repository, after npm run build in
website/plain: man -M "$PWD/build/man" sg-read.
From sg itself
sg help read # the page of a word, with no network
sg help sg-build # the page of a command; sg build --help prints it too
sg help index # every name, with what it is in one line
sg help # the words and the commands with a page
sg carries the same pages in itself, so they work on Windows too, and for a build from source where
nothing installs the manual pages. What it prints for read: help/read.txt.

