Commit graph

58 commits

Author SHA256 Message Date
c791af1593 Unused definitions
A subsection after typed holes: the compiler warns about a definition
nothing uses, and a leading _ keeps one on purpose.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-22 15:06:15 +02:00
2a4e3b3fcf Typed holes
A subsection under Values, types and signatures: _ where the code is not
written yet, what the compiler says about it, and a _name as a named hole.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-22 12:37:40 +02:00
ae58a1e004 Newtypes: phantom type parameters
One Id with a tag for what it is an id of, in place of a newtype per kind
of id, and a tag that records what has been checked about a value, kept
honest by #:opaque.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-22 11:47:12 +02:00
1a407720a9 Unions: two may have a case of one name; which name wins, as it is
A case of one name in two unions is chosen by type, then by scope, and
the manual says so in place of "cannot both have a case called Red".
Writing programs said two imports offering one name, a type among them,
resolved to the later import; a use is refused until the program says
which, except for cases of different unions.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-22 11:27:57 +02:00
684745d6c0 Pages and tour entries for the modules that had none
Reference pages for (std uuid), (std scan), (std priority-queue),
(std crypto hash) and (text encodings), and entries for them in the
tour of the standard library, with (text xml), (text json-codec) and
(text bjodat-core). The text/json entry links to its page instead of
prelude.org.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-22 07:59:36 +02:00
5a9f65accf Traits and fmt brought up to the compiler of 21 October
- Where an implementation is written: with its trait or its type, a
  newtype for anything else, and traits, types and impls usable above
  where they are written.
- One implementation that fits decides the type of a call.
- A function is written as #<procedure> wherever it is; Procedure.
- A (dyn T) implements the traits T requires.
- Formatting: the lambda that returns a vec of mixed pieces, in the
  table of errors; the short fmt tour in Language basics in the style of
  a string being a block.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-22 07:59:36 +02:00
25720e4fb2 Traits: write the rules' itemlist with a brace body
@itemlist[...] gave the items as arguments, which samizdat reads as
bjodat, and the comma in the prose stopped it.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-22 07:15:28 +02:00
e448ee0d93 Printing: written and displayed
->str gives way to two traits, as Scheme's write and display: a value
as the reader reads it, and the value for a person. Every type of your
own is written in constructor syntax. The examples, the REPL session and
the expect output follow.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-21 15:38:01 +02:00
481538a1cb Numbers: the full set of types, and real literals that take their type
The numeric types table lists bigint, int128, uint128, float and decimal.
A real literal without a suffix is a double, float or decimal as the
context says. A boolean prints as #t.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-21 13:05:45 +02:00
bd71102c19 Newtypes, and giving one the traits of the type it wraps
A newtype beside aliases in "Your own types", and #:via and type/derive
for one in the traits chapter.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-21 08:25:02 +02:00
6d9c9bf8a0 Traits: traits that require other traits
A trait may require another of every implementor, with a where clause
in the trait. The section shows a function that asks for one trait and
uses the other, and notes that Ord now requires Eq.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-21 06:33:00 +02:00
8729cb3ef7 Traits: implementations for particular type arguments
One type may have an implementation at (List int) and another at
(List string). The section says how the compiler picks one, and that
overlapping implementations and calls at a type it cannot decide are
errors.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-20 22:15:21 +02:00
cefa2313ad Timers take a Duration
timeout and with-deadline take a Duration, made with milliseconds,
seconds, minutes or hours; within takes one too.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-20 18:07:05 +02:00
3f8c13cc2f Formatting text: a number bound by def needs no type
A number bound by def is read as the number written there would be, so
the guide no longer asks for (: n int), and says when (: n double) is
needed.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-20 13:24:31 +02:00
84000bf384 A main that does not return an int exits with 0
The first program no longer ends in a 0, and the appendix says what the
compiler knows about main. The unit type is spelled void in the
signatures that wrote unit, which is its value, and print-n-times has a
loop clause for its body.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-20 13:24:25 +02:00
4f8da92dc2 Formatting text: settings by parameterize around show, or with-fmt*
The Settings section says where a parameterize of a setting works: around
show, not around the code that builds a block. For part of an output it
shows with-fmt*, which binds several settings as parameterize does.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-20 12:20:48 +02:00
5bc42069cd Formatting text: a string is a block, and so is a vec of blocks
The guide is written for (std fmt) as it is now: one thing needs no
brackets, several things are a vec, and each is needed only for a
lambda given to a function such as vec-map.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-20 11:56:52 +02:00
21fa7af6dc Formatting text: tables drawn with StyleAscii
The guide's framed tables use +, - and |, which every font has, so they
line up in a browser whatever font it draws code in.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-20 11:24:16 +02:00
aaf92b38c1 Formatting text: a guide to std/fmt and its blocks
A section in "Writing programs" on (std fmt): what a block and a vec of
blocks are, what goes in the brackets and how to convert the rest,
blocks from data, padding, numbers, paragraphs, tables, settings, and
what to write when it does not compile. The std/fmt entry in Part III
gives the rule and points to it, and no longer names str*.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-20 10:48:12 +02:00
21d0c9de06 aot clarifications 2026-10-20 08:01:41 +02:00
15bfc18167 Native executables, std/array and std/simd
"Projects and packages" gets a section on Native AOT: (aot #t), where the
executable goes, what it gives and costs, and (aot-cpu ...) for the CPU it
is built for. The standard library chapter gets std/array and std/simd
after std/maths, and "Performance" a section on vectors: the kernels first,
a loop with its tail, masks, and when vectors pay, with the measurements
from the Advent of Code solutions. modules/std/array.sz and
modules/std/simd.sz are the reference pages, generated from the modules'
docs.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-4-7)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-18 17:16:42 +02:00
ca170a7e24 Grammars read quoted literals
Bjolang 0.2.0 reads a quoted literal with a grammar, and refuses #:tag
on a union case. The section on literals for your own types now declares
a def/grammar and shows its errors. The std/url summary says what the
compiler checks in a URL literal, and how a computed scheme, host or
port is made.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-4-7)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-17 18:03:35 +02:00
40f4783fa5 std/url: URLs read, written, resolved and percent-encoded
The standard library chapter gets std/url after std/http: the quoted
literal that encodes each value for its part, parse-url's strict reading,
the round trip, url-resolve, the decoded parts and the encoders.
modules/std/url.sz is the reference page, generated from (std url)'s docs.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-4-7)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-17 12:39:22 +02:00
1b4493700d Benchmarking: #:setup and #:setup-every as bindings, the body as forms
(std bench) changed: a setup binds names, as let* does, and the body uses
them and the parameters by name instead of being a (fun ...). The deck's
benchmark file, the options table and the paragraphs on the setups and
parameters say so, with an example of the two setups used together. The
outputs are unchanged: the same benchmarks measure the same.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-4-7)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-16 21:07:00 +02:00
f8cb9d3459 Benchmarking: (std bench) and bjo bench, with the card game
A new section 2.9 between Testing and Performance: time-it, a benchmark file
for the deck, how a benchmark is measured, setup and parameters, the menu,
--detail and --scaling, --compare-within, saving and comparing, --against
with --processes, the flags, and --serve. Every output is from a real run.
It shows the weakness of comparing two processes too: unchanged benchmarks
called faster or SLOWER by a few percent, and how --processes 6 settles it.

The standard library chapter gets std/bench, std/stopwatch says time-it is
(std bench)'s, and modules/std/bench/ has the reference pages for (std
bench), (std bench stats) and (std bench store).

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-4-7)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-16 19:42:23 +02:00
3dc1518638 std: folders sorted in among the modules, without a slash
(std stm), (std test) and (std mutable) are listed where their titles
put them, with (folders mixed) and (folder-marker? #f) from glasnost
0.3.12. The mutable folder is titled (std mutable), as the others are,
so that it sorts among them.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-15 14:55:46 +02:00
11d435803c Modules: a module with submodules is its folder's page
(std test) and (std stm) were pages next to folders of their submodules, and
the std menu lists folders first, so each showed up twice, far apart. The
module page is now the folder's index.sz, so the menu has one entry for it,
and its submodules are listed at the top of the page and in the menu below.

(std test prop), (std test gen) and (std test expect) get pages, and the
standard library chapter says what they have and links to them.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-14 22:56:25 +02:00
ef24c95108 Performance: choosing between List and Vec, and Map and OrderedMap
A new subsection under Performance with two tables from the benchmarks in
bench/collections. It says which operations each collection does cheaply,
and names the traps: vec-add in a loop, binding the rest of a vec in a
recursive match, and indexing into a list.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-14 21:38:05 +02:00
671ad9ac88 Benchmarks: the memory the service took, measured again
Bjolang's peak in the service's closed loop was inflated by how its
program gathered samples, and Go's matched run was given that peak as its
limit. With the program fixed, Bjolang peaks at 369 MB on all cores, and
Go, given the larger corrected .NET peak, at 364.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-14 12:02:50 +02:00
ba5c7afc9d Benchmarks: Go and Hopac in one comparison, and the service run again
The primitive benchmarks are one table with all six columns, Bjolang's
two, Go's two and Hopac's two, with the introduction once and what each
comparison says after it. What each operation allocates is one paragraph
for all three.

The service section has a new run on the current runtime. Go with as
much memory as .NET has the shortest tail at 250k/s on four cores;
Bjolang has it at every higher load. Over three runs the row at 500k/s
on all cores moved too much to rank, and the text says so.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-14 11:45:01 +02:00
970754b3be Benchmarks: the choose after the scheduler fix
A chain of two fibers no longer moves between cores when the inline
budget runs out, and the skewed choose takes 181 ns at best, not 230.
The ring rows move by a nanosecond or two, and the spawn row to 210 ns.
The text says that the spawn row is slow only on many cores: on two or
four, the current scheduler spawns faster than the pool did.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-14 10:38:28 +02:00
6fef5a9c5f Benchmarks: current numbers, and a service under load
The ring, spawn and choose rows are measured again. Spawn and choose cost
about twice what they did, with the scheduler that replaced the .NET
pool, and several sentences no longer held: an event synced alone costs
nothing over chan-put, a choose allocates 56 bytes, and Hopac's choose
stays ahead with a cancel IVar.

A new section gives bench/service against Go and Hopac: the closed loop,
and the open loop with latency taken from when a request was due.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-14 07:51:19 +02:00
a4c27bbf7c Comparison patterns, and decimal and bigint literals
Part I's pattern matching chapter gets a section on (:at-least lo),
(:at-most hi), (:between lo hi), (:greater-than lo) and (:less-than hi):
what each matches, that they nest like any pattern, that the bounds are
literals, and that the ranges of integers and characters are added up
by the exhaustiveness check while those of doubles are not. The section
on exhaustiveness shows a counterexample in a gap between ranges.

The table of literals lists decimal and bigint, and the comment in the
inference example says which binding is pinned.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-13 10:00:18 +02:00
fb90f971b4 Reference pages for the rest of std, and Part III sections on them
Pages for (std eq), (std clr-ord), (std monad), (std effect),
(std hashset), (std orderedset), (std orderedmap), (std inbox),
(std ports), (std net), (std test), (std simpletest), (std stopwatch)
and (std syntax-match), and for the five (std mutable ...) modules in
a directory of their own, as (std stm) has. Part III has a short
section on each group with links to its pages.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-12 07:15:06 +02:00
bb8cefba19 Scopes work in ordinary code, and macros can write by-colour
The Scopes section shows a with-scope in a defun, and own!, own-disposable
and release!. The Macros section has a section on by-colour.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-10 22:45:43 +02:00
8ca519a8ed fixed example 2026-10-09 14:38:08 +02:00
56a5e7c141 Transactions: a guide in Part II, and reference pages for (std stm)
Part II's section on concurrency has a new subsection, "Shared state:
atomics and transactions": when to share data instead of sending it,
locations and atomically, the rules for a transaction function, waiting
with tx-retry, a transaction as an event in a choose, tx-or-else, the
queue, map and counter, and what transactions cost. The examples use
the card game and were compiled and run.

Part III has a section on std/stm that links the four reference pages:
(std stm), and (std stm queue), (std stm map) and (std stm counter) in
a directory of their own, as (text xml) has.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-09 14:05:10 +02:00
82adbb03a4 (std atomic) has a reference page, and Part III a section on it
🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-09 08:25:26 +02:00
6cd4628e02 Numbered headings
The manual numbers its parts, sections and subsections, 1, 1.1, 1.1.1, in
its table of contents too. The titles that numbered themselves no longer
do: Part III is "The standard library", 3, and the appendices are 4.1 to
4.4 rather than A to D. The std/random section after the appendices is
gone; Part III has it.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-08 21:35:59 +02:00
7ed3b382ee Part I no longer has its own section on editor support
It said less than Appendix D does, and some of it was no longer true:
Appendix D covers bjomode.el and samizdat-mode.el.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-08 21:28:10 +02:00
371f1685ca (std maths) has a reference page, and Part III a section on it
🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-06 20:09:22 +02:00
319c9df63e The prelude's reference, beside the other modules'
modules/std/prelude.sz is the prelude's page, made from the docs the
prelude was compiled with, builtins included. Part III starts with the
prelude and links to it, instead of pointing at Docs/prelude.org.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-06 18:08:04 +02:00
bc58247994 The REPL section: line editing, Tab completion and :complete.
The REPL no longer relies on rlwrap. Say what it does at a terminal
instead (history, Enter continuing an open form), how Tab completes,
and that :complete gives editors the same completions.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-06 13:08:01 +02:00
5735643b05 Fix two typos in the benchmark comparison.
🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-06 11:54:38 +02:00
60110605ec Compare the concurrency benchmarks with Hopac as well as Go.
The Go table is refreshed with a new run (the numbers moved within the
noise), and the section gains a Hopac part: the same rows on the same
.NET runtime, plain and with every operation raced against a cancel
IVar, with what the numbers show. Hopac is ahead without cancellation
and far behind with one shared cancel IVar, and allocates more.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-06 11:47:23 +02:00
7fbff1f6cc Changed some language in Writing Programs. 2026-10-06 10:41:30 +02:00
554d74b7f2 chan-put and chan-get, and Bjolang's concurrency compared with Go
The channels section introduces chan-put and chan-get beside the event
forms. A new section compares the CML benchmarks with their Go twins, with
Bjolang measured both syncing events and with chan-put/chan-get and Go both
plain and racing ctx.Done(), and says what Bjolang has that Go does not:
events as values and structured scopes.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-06 08:22:12 +02:00
96d6ebc8e2 The REPL's :show prints the doc of a visible name
🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-05 21:42:58 +02:00
5924aa27bc Slices, string-search, and trimming left and right
🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-05 09:44:37 +02:00
16278c2c92 substring, after Bjolang's rename of substring/cursors
🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
2026-10-05 09:02:15 +02:00