Repository navigation
0.27.0
Pre-releaseJennifer 0.27.0
Linux ships two binaries - same source, same language, different compiler:
jennifer- standard Go build. Default, full-featured; what most users want.jennifer-tiny- TinyGo build. Smaller, embeddable; noos/execor network stack.
macOS and Windows get the standard jennifer only, as best-effort unsupported builds (no jennifer-tiny).
Install jennifer unless you have a specific reason to use the constrained variant; see docs/user-guide/installing.md for guidance.
What's new
A release without a milestone: it ships what was done since 0.26.0. A second
audit of the bundled modules makes parsers and protocol clients stricter
(malformed input throws, the module's error struct or a generic kind),
refuses credentials over plain http:// and plaintext logins unless opted in,
and fixes lost messages, races and quadratic paths. New are
fs.readSecretBytes (M29.22), UTF-16 and UTF-32 in encoding,
intl.formatNumber and i2c.writeRead; the first round of the conventions
survey renames thirteen names and five fields (M29.23). From the
next milestone come bounded request parsing in Go (M29.2), the remaining caps
as kind "limit" (M29.1), new strings, lists, json and decimal
functions, printf and time.format width modifiers, and match on an indexed
subject (M29.7, .8, .19, .24-28).
Breaking changes
- Stance 8 renames, old name kept. The old names still work, marked
@deprecated, and are removed in 0.28.0 (M29.23, M29.34):orm.hasOne/hasMany->oneToOne/oneToMany;validate.isInt/isFloat/isBool->integer/number/
boolean. The rule kinds change with them, also through the old
names:Failure.rule,localizekeys andwebapi's 422 failures read
"integer"/"number"/"boolean";rest.insecure,graphql.insecure,mikrotik.insecure,
soap.withInsecure,webdav.withInsecure->withSkipVerify;soap.withCaCert,webdav.withCaCert->withCA.
- Stance 8 renames, no old name. Code that names these fields must change
(M29.23):memcache.Session.timeout,redis.Session.timeoutand
s3.Client.timeout->timeoutMs;totp.Options.period->periodSec;
oauth.DeviceAuth.interval->intervalSec. Renamed parameters
(positional, so calls are unaffected):ttl->ttlSecinkvstoreand
session,timeout->timeoutSecintelegram.getUpdates. - Credentials need TLS unless opted in. Refused before anything is sent:
- an
Authorization/Proxy-Authorizationheader (aCookietoo in
webdav) overhttp://to a host other than loopback ingraphql,
jsonrpc,mcp,soapandwebdav(reason / status"insecure"or 0),
every signeds3request, everygotifypush, and everyacmerequest
(RFC 8555); opt in withallowInsecureHttpon the client,Configor
acme.connectWith(url, key, acme.Options{...}); imapLOGIN/ XOAUTH2,popUSER/PASS/ XOAUTH2, anldap
simple bind orpasswordModifywith a password, and amikrotiklogin
over plain TCP; opt in withallowInsecureAuth(onldap.Conn, on the
others'Options);mactelnetspeaks EC-SRP only; MD5 (RouterOS < 6.43) needs
connectWithwithallowLegacyMd5;rest.paginatethrows on arel="next"link to another origin
(allowCrossOriginRedirectfollows it).
- an
- Strict parsing. Malformed input throws instead of being skipped,
defaulted or repaired:ical.parseandvcard.parsethrow the newical.IcalError/
vcard.VcardError(kind,message,line) for broken structure,
escapes, dates, durations,RRULEs, a missingFN, an unknownVERSION;mime.parse(header lines, boundaries, truncated multiparts, bad base64 /
QP, bytes invalid in the declared charset; nesting past 100 is"limit");
multipart.parse(a part withoutform-dataandname, a line starting
with the boundary, no close delimiter);feed.parsethrows kind"value"for an unparseable date on any item, a
bad enclosurelength, an<rss>without exactly one<channel>or a
<feed>outside the Atom namespace;dotenv(a line without=, an empty key, unknown escapes, text after a
closing quote);jsonl(Unicode whitespace that is not JSON's);
semver.satisfies/maxSatisfying/minSatisfying/simplifyRange
throw"value"for an invalid range;cronrefuses a value past the
field's range;dot.renderrefuses control characters;uri.parse/resolverefuse a malformed port and text after an IP
literal's];validate.urlchecks%escapes and IP literals;idna
refuses non-canonicalxn--labels and invisible / control characters;- replies:
http(status line, header syntax, obs-fold, control characters,
Transfer-Encodingother than a lonechunked, conflicting
Content-Length),jsonrpcandmcp(not a JSON-RPC 2.0 response),
graphql(not a GraphQL response, also fromtryQuery),acme,imap,
pop(kind"pop3"),webdav.parseMultistatus,snmpunsigned values
out of range,s3<Error>bodies under a 200; kv.openFilerefuses a file that is not a kv store or is damaged.
- Options and arguments are checked, never clamped: a negative TTL in
kv
andkvstore;totpnegativeperiodSecor counter,digitsoutside
6..8, and a secrettotp.uricould not use;passwordminLengthbelow 1 or a negative
minimum;orm.limit/offsetbelow 0 and WHERE / HAVING connectors other
thanAND/OR;log.atwith an unknown level ("log");args
duplicate or shadowing definitions and an option value that looks like an
option (--name --quiet; write--name=--quiet);websameSiteother
thanLax/Strict/None(Noneneedssecure);ansicolour indexes
and channels outside 0..255 ("value", were clamped);barcodesizes, QR
EC level, empty 1D data and GS1-128 element strings;labelsizes,
rotations, quantities and barcode data;plotmarks, shapes,legendPos,
barModeand geometry;pdfpage sizes, colours, an empty document and a
bookmark to a missing page;zmq.pollwith a negative timeout;
doctreeselectors with other brackets. - Error kinds.
"limit"for a reached cap inflatdb.openWith(was
"flatdb"),ipnethosts/hostCount/split(was"ipnet"),
thedoctreereaders' caps (was"markdown"/"rst"),pdfimage
pixel caps;"closed"for ansmtpreply cut off or asendOnon a closed
session (was"smtp"/ code -1);"pdf"for text outside WinAnsi (was
"runtime").oauth.load,uri,font,pdf,rstandmystpass the
generic kinds on.validate.custompasses a predicate's"runtime"and
generic kinds on instead of failing the field; a non-boolresult is
"value". - Behaviour:
gpio.jmaps a pin through the Raspberry Pi header chip's sysfs base
(512+ since Linux 6.2), found by label; another board throws.
gpio.useChip(gpio.GLOBAL)keeps the old global numbering;serial.open/openWithclaim the port exclusively (shared: true
opts out) and reset every line setting a previous program left;cron: a*/nday field restricts, and with one day field starting*
a day must match both (Vixie cron);session.savereturnsbooland writes only a live session (never one
destroyed, rotated, expired or never created);webnames the CSRF cookie__Host-csrfwith Secure cookies;acme.pollAuthorizationthrows anAcmeErrorwith the challenge's
problem unless the authorization isvalid;webapi:installmakes the guard every route's handler; rate limiting
runs before the 401 / 403 / 422 checks; badlimit/offsetis a 400;
a handler throw is a 500 envelope, then rethrown toweb.onError;jsonrpc.notifythrows on a non-2xx answer;barcodeEAN / UPCtextcarries the check digit; code39 / code93
encode lowercase as uppercase;spi.transferover spidev'sbufsizthrows"limit"instead of failing
in the kernel; it is never split.
- Caps throw
"limit", not"runtime"(M29.1), messages unchanged: a
range materialised into a list past the element cap (0..n),
channel.makepast its capacity cap, acrypto.pbkdf2/argon2id/
scryptkeyLenover 1 MiB,pbkdf2work over 1e8, theargon2idtime,
threads and memory caps, thescryptmemory andpcaps, and the same
caps and the bcrypt cost cap incrypto.verifyPassword,serial.read/i2c.read/readReg
over 256 MiB,intl.troutput over 1 MiB, anio.printffield value over
4096 (pad,max,prec,group,depth), and the handle caps ofnet
(connections, listeners, UDP sockets),httpdservers,sqlconnections,
rows, transactions and statements, andterm.makeRaw. time.format/time.parselayouts: a|right after a code starts a
modifier list; write||for a literal|there (M29.24).- Request parsing caps (M29.2), kind
"limit": more than 10,000 form or
query pairs (web.form,uri.parseQuery), a multipart part header over
16 KiB or a part name / filename over 1 KiB. A multipart part header that
is not UTF-8 throws"multipart"(was"runtime"). web.form/formValueare strict (M29.2): a%without two hex
digits or a decoded value that is not UTF-8 throws kind"encoding", and a
body that is not UTF-8"runtime"; before, such bytes stayed literal or
were read as ISO-8859-1. Unhandled, the request is answered 500 until M29.29
answers it 400. Browsers send neither from a page served as UTF-8.- One cap for every result a call builds: a string built by
strings.replicate/replace/joinorregex.replacenow stops at
256 MiB (32 MiB onjennifer-tiny), as bytes did; it was 1 GiB (128 MiB). webrouting: runs of/in a request path count as one, and a path
of more than 128 segments matches no route (a 404), wildcards included.
webapireads the first 64 ranges of anAcceptheader and the first 16
;pieces of each.
Deprecated
Removed in 0.28.0 (M29.35); jennifer lint reports each use as L301
(info, so a gate keeps passing while code migrates):
strings.substring,lists.slice/head/tail/popand
binary.slice: the language's slices do their job ($s[a..b],$xs[..n],
$xs[len($xs) - n..],$xs[..len($xs) - 1],$b[a..b]).io.printf/sprintf/eprintfwith one non-string value: write
io.printf("%v", $v).strings.repeat: renamedstrings.replicate, becauserepeatis a
keyword.testing.runWith/assertThrowsWith: renamedrunArgs/
assertThrowsArgs, becauseWithmeans an options struct everywhere
else.crypto.hkdf/pbkdf2/argon2id/scrypt: use
crypto.deriveKey(algo, secret, salt, length, crypto.KdfParams{...}), one
function for every key derivation with the algorithm first, like the rest
ofcrypto("hkdf-sha256","pbkdf2-sha256","argon2id","scrypt").
It has no default costs: a parameter the algorithm needs must be set.lists.range(a, b): usea..b; one that counted down (range(3, 0)) is
lists.range(3, 0, -1). The steppedrange(a, b, step)stays.convert.toString(n, radix): useio.sprintf("%d|base=16", n), the same
digits; rendering a number is presentation, which printf owns.convert.bytesFromString/stringFromBytes: useencoding.encode/
decode, same arguments (encoding.encode("utf-8", s)), which now take
UTF-8, UTF-16 and UTF-32 as well as the single-byte codecs.
The bundled modules, the examples and the docs already use slices,
replicate, "%v" and encoding.encode / decode; the bundled modules
that do now require >=0.27.0.
Language and interpreter
matchdestructures an indexed subject:match ($queue[$head])over a
list of Tree, amap of K to Treevalue, and chains such as
$grid[$i][$j]or$byName["x"].tree, with exhaustiveness checked when the
file loads, insidespawntoo. A call result is still refused (M29.28).
Standard library
Libraries (use NAME;):
-
strings:replicate(s, n), the new name ofrepeat, which is spelled
like a keyword (the pair matcheslists.replicate).join(parts)without a
separator joins with"", asbinary.joindoes.trimPrefix/
trimSuffixremove one exact affix;
trimSet/trimLeftSet/trimRightSet(s, cutset)strip any rune of a
cutset. The whitespacetrim*are unchanged (M29.7). -
lists:replicate(xs, n),ndeep copies ofxsconcatenated (over the
concatcap is"limit", checked before anything is built; M29.25);
sortWith(xs, cmp), a stable sort by anintcomparator for orders on
several keys (M29.27). -
json,toml,yaml:asFloats(v[, ptr])/asInts/asStrings
read a whole list in one call, each element asasFloat/asInt/
asStringreads it; about 10x faster than a per-element loop on a
3,072-number embedding (M29.8). -
decimal: the digit cap rises from 100,000 to 1,000,000 on the default
build (100,000 onjennifer-tiny), so 5^4^3^2 fits; parsing a long decimal
string is no longer quadratic (1,000,000 digits: about 2 s to 0.2 s)
(M29.26). -
crypto:deriveKey(algo, secret, salt, length, KdfParams)with
"hkdf-*","pbkdf2-*"(sha1/sha256/sha512),"argon2id"and
"scrypt", the checks and caps of the functions it replaces. -
encoding:encode/decodetake"utf-8","utf-16"/"utf-32"
(a byte-order mark; big-endian without one) and theirle/beforms
(fixed order, no mark). Decoding is strict: invalid UTF-8, a truncated
unit, an unpaired surrogate or a value outside Unicode is an error naming
the byte offset.codecs()lists them first. -
encoding:parseForm(text),parseCookies(header)and
parseMultipart(contentType, body) -> list of FormPartparse request text
in Go with bounded memory, on both binaries (M29.2). They are strict:
malformed input is kind"encoding", a reached cap"limit". -
io:%ftakesfill=0andgroup/sepon the integer part, as
%ddoes:%f|prec=3|pad=10|fill=0|sign=alwaysprints+00003.142
(M29.19). -
time: the numeric codes take printf'spadmodifier:%d|pad=0
prints the day unpadded,time.parsereads the same layouts (M29.24). -
fs:readSecretBytes(path) -> bytes/readSecretStringread a key or
token file only when no group or other permission bit is set and the owner
is the effective user or root (on a read-only mount, such as a container
secret, only group / other write is refused); over 1 MiB is"limit"
(M29.22). OS errors name each path once (fs.FUNC: PATH: CAUSE). -
intl:formatNumber(locale, value, digits)forint,floatand
decimal.Decimalwith CLDR separators and grouping, half-even rounding. -
i2c:writeRead(bus, data, n), a combined transfer with a repeated
start (I2C_RDWR); errors carry hints for the usual errno values, an
adapter timeout is"timeout". -
serial:Options.flowControl("none","rtscts","xonxoff") and
shared; full raw mode, rates up to 4,000,000, input parity checking with
parity on; a hangup is"closed"; errors name the path with a hint. -
spi: calls on one device are serialised,closewaits for a transfer
in flight.gpio: errno hints. -
kv: errors documented as kind"runtime".math/stats/
decimal: messages name the function (math.sqrt: ...).
Modules (import "NAME.j";):
amqp:qos(c, prefetchCount),publishMandatory(a returned message
makeswaitConfirmthrow scope"return", code 312), bad credentials are
anAmqpErrorwithreplyCode403;closediscards unread confirms.http:isCleartextRemote(url); a reused keep-alive socket that the
server closed resends an idempotent request (or one withIdempotency-Key)
once on a new connection.imap:fetchBytes,fetchPartialBytes;fetch*andflagsread the
FETCH carrying the requested UID and throw when there is none.pop:
retrieveBytes,topBytes,listSizes -> list of MessageSize(a
sizesposition is not the message number once one is deleted).jsonrpc:parseReply(body, status, id); the server answers a
malformed request-32600.ldap:connectWith(address, security, net.TLSOptions)/
startTlsWithfor a private CA; the server never returns or matches
userPassword, answers writes with code 53, serialises edits; search
replies are capped (16 MiB a message, 64 MiB a search,"limit").mcp: the HTTP client sendsMCP-Protocol-Versionand reads event
stream replies; the stdio client stops a server afterstdioTimeoutMs
(default 60 s,"timeout") and shuts it down with SIGTERM / SIGKILL; stdout
past 16 MiB is"limit".mqtt: a message arriving whilepublishQos1/subscribewait for an
ack is queued on theClientand returned first byreceive/poll(over
1000:"limit").redis:subscribe/psubscribe/unsubscribe/punsubscribe
return once the server confirmed; messages read meanwhile stay queued.s3: replies other than object downloads capped at 16 MiB; the
endpoint must be a barescheme://host[:port].sqlmigrate:migrate/rollbackMigrationshold a per-database
advisory lock (60 s wait, then"timeout").vcard: reads vCard 2.1 quoted-printable values in theirCHARSETand
group prefixes (item1.EMAIL).ical:DURATION, several
VCALENDARs, RFC 5545 recurrence;occurrencespast 100,000 steps is
"limit".webapi:deprecatedSince(Deprecationheader) besidedeprecate
(Sunset),identity,onError.label: ZPL writes^CI28(UTF-8) and^PW/^LLfrom the label size.log: control characters in values and text-form messages are escaped;
a field namedtime/level/msgis renamed in every format.screen:waitKeyreturns"eof"on every call after end of input.tengine:addreplaces a name already in the set.web,uri,multipart: form bodies, query strings, Cookie headers
and multipart bodies are parsed in Go (M29.2). A 3 MB&&&...form body
peaks at 26 MiB instead of 3.2 GB, a 1 MiB part header at 27 MiB instead of
1.6 GB; results for well-formed input are unchanged.web,webapi: route patterns are split once when registered, and the
guard matches against a precompiled table, so routing no longer re-splits
every pattern per request (the registry's/served about 40% more
requests a second).
Tooling
lint:L204no longer flagslen(...)in a string slot;L205no
longer flags an accumulator whose every call, recursive ones included,
updates in place ($v = f(..., $v, ...)on a function local outside a
try) or passes a constant literal such as[].args: help text in one aligned column across positionals, options
and subcommands.scripts/conventions-survey.jlists every deviation from the
conventions catalogue; its findings are kept in
docs/technical/conventions-findings.md(M29.23).
Docs
docs/technical/conventions.md, the stance 8 catalogue, and the recorded
exceptions indesign-decisions.md(M29.23).- Module doc examples run as written: those of the audited modules,
html,
sasl, and the mail examples (now withtransport.Security). - Editors: Zed and Helix need a tree-sitter grammar; JetBrains IDEs take the
TextMate bundle. The interpreter notes say atrybody has its own frame;
the profiler docs say rows sort byCUM, thenSELF.
Fixed
-
The zero
funcvalue (def f as func;) is null:$f == nullwas false,
so a program could not test whether a callback was set. -
io.printf%fwithsign=alwaysprinted+-0.0for-0.0. -
images.decode/infoon data that is no image say "not a PNG, JPEG or
GIF image" instead ofimage: unknown format;compress.unpackon a
truncated stream, or one followed by bytes that are no stream, says so
instead ofunexpected EOF. -
crypto.hkdfpast RFC 5869's maximum (255 x the hash size) names the
maximum in its message instead ofhkdf: hkdf: requested key length too large. -
mqttandredisdropped messages that arrived during an ack or
subscribe wait;redisreads were quadratic in the reply size, and a
timeoutMsof 0 left an earlier read deadline armed. -
amqp.waitConfirmcounted amultipleack as one confirm. -
flatdb.savecould lose an update between its check and the rename; it now
rechecks under a short save lock (<path>.savelock). -
ntpreported a Kiss-o'-Death sent with leap indicator 3 as unsynchronised,
and failed on a stray datagram instead of waiting for the reply. -
snmp.walkon v1 did not stop atnoSuchName. -
zmq.poll(sock, 0)blocked. -
webhook: with an empty secret a verify call could returnfalsebefore
throwing; it now throws first. -
ldap: a filter with trailing text ((uid=a)x) or an unescaped(was
accepted. -
smtp: an address could close its angle brackets and add ESMTP parameters
(a@example.com> NOTIFY=NEVER). -
imap: bytes a server sent behind its STARTTLSOKwere read after the
handshake; untagged lines duringAUTHENTICATEbroke the exchange. -
rest:Linkheaders are parsed per RFC 8288 (commas inside<...>,
severalreltypes, relative targets). -
font: a font with an out-of-rangeunitsPerEmornumberOfHMetrics, or
a cmap glyph id pastnumGlyphs, is refused as malformed. -
bloom.optimalcapskat 255 (a tinyfprgave a filternewrefused);
a deserialized filter's size is checked. -
tenginecloses its render budget store. -
Linear instead of quadratic: the
csvstreaming reader's quote check,
dotenvmulti-line values,mimeRFC 2231 parameters,rstunmatched
inline start-strings,doctreePDF quote fills,plotbars,pdf
outlines. -
doctreePDF: deep quote / list nesting drew text past the page edge, and
wide tables overflowed; both are now"limit"or sized columns. -
markdown: inline nesting past 32 levels dropped formatting silently; it is
now"limit". -
rst: a malformedcsv-tableheader is reported, a limit message is no
longer doubled, an escape after a start-string is content.myst: a
backtick in an info string, an indented fence line, fences in nested list
items and fences over 1000 characters. -
mactelnet:sendandrecvkeep their deadlines while other hosts send
datagrams; console output is capped at 1 Mi characters ("limit").
mikrotik: replies are capped ("limit"). -
oauth.loadturned a generic kind from reading the file into"oauth".
Test results
- Full Go test suite: passing (JUnit
report.xmlattached). - Interpreter code coverage: 78.0% (
coverage.htmlattached).
Artifacts
jennifer-0.27.0-darwin-amd64-UNSUPPORTED.tar.gzjennifer-0.27.0-darwin-arm64-UNSUPPORTED.tar.gzjennifer-0.27.0-linux-amd64.tar.gzjennifer-0.27.0-linux-arm64.tar.gzjennifer-0.27.0-windows-386-UNSUPPORTED.zipjennifer-0.27.0-windows-amd64-UNSUPPORTED.zipjennifer-0.27.0-setup.exejennifer-manual.pdf- the full documentation as a single PDF.jennifer-module-api.pdf- the module API reference as a single PDF.
Artifacts named -UNSUPPORTED are best-effort macOS / Windows builds (standard jennifer only, no TinyGo, unsigned, no support); see docs/user-guide/installing.md. The *-setup.exe is the same unsupported Windows build wrapped in an installer (PATH, .j association, bundled modules). Any of these may be missing if that build failed - it does not block the Linux release.