Repository navigation
0.26.0
Pre-releaseJennifer 0.26.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 breaking release that tidies the standard library before 1.0: functions take
an algorithm, format or codec name first, crypto has one function per
operation, and errors carry kinds and structs ("limit", "net", "closed",
net.NetError, rest.HttpError, ...) instead of message text. Parsers and
network clients are stricter throughout. New are the decimal and images
libraries, the doctree, rst, myst, soap, webdav and zmq modules, and
nine bundled vendor clients are deprecated in favour of @jennifer/* decks.
Upgrading jvc. jvc 0.1.0 does not run on 0.26.0, so it cannot update
itself afterwards (jvc app update fails with bytesFromString: codec ... is not supported). Update jvc to 0.2.0 before installing 0.26.0, or afterwards run
0.2.0 once from its tag to replace the installed copy:
git clone --depth 1 --branch 0.2.0 https://github.com/jennifer-language/jvc /tmp/jvc
jennifer run /tmp/jvc/bin/jvc app update jvcBreaking changes
- Name first.
hash.compute(algo, b),hash.hmac(algo, message, key),
crc.compute,compress.pack/unpack,encoding.toText/fromText/
encode/decode,convert.bytesFromString/stringFromBytes,
archive.pack/unpack/unpackWith,crypto.hkdf/pbkdf2,
stats.proportionCi,testing.report; in modulesjwt.sign(alg, claims, key)and everyjwt.verify*,barcode.encode,feed.build,log.new/
toStderr/toFile,ldap.password,ldap.bindSasl(conn, algo, ...),
sasl.scramStart,acme.challenge,webhook.timestamped*. Move the name
argument to the front (after a handle). (M28.41) crypto: one function per operation, the algorithm first:encrypt/
decrypt(algo, ..., key, nonce, aad),sign/verify,keypair/
publicKey,encapsulate/decapsulate,wrap/unwrap. Use
encrypt("aes-gcm", ...)with your own 12-byte nonce instead of the
two-argument form,keypair("ed25519")instead ofsignKeypair,
sign("rsa-sha256", ...)instead ofrsaSign/ecdsaSign(andverifyfor
their*Verify),keypair("rsa2048")/keypair("p256")instead of
rsaGenerateKey/ecGenerateKey,"mlkem768"instead ofmlkem*, and
hash.equalinstead ofhmacEqual. Oldencryptboxes still open. (M28.40)markdownrenders throughdoctree.markdown.parsereturns a
doctree.Node; usedoctree.render("html", doc)instead of
markdown.render(doc, "html"), anddoctree.renderPdf/renderPdfDoc/
pageBreak/pdfDefaultsand the node accessors likewise. Theto*
shortcuts stay. The reader is now CommonMark 0.31.2, so some output differs.- Removed:
oauth.google/oauth.microsoft(use@jennifer/oauthextor
oauth.discover);feed.fetch(usehttp.get, thenfeed.parse). webapi.limitertakesfunc(key, limit) -> ratelimit.Result, notbool.- Error kinds. Match the kind, never the message:
- a reached cap is
"limit":httpbody / header / chunk caps,
net.readAll, thejson/toml/yaml/xml/asn1nesting and node
caps, and the receive caps and budgets of the bundled modules (M28.54,
M28.55, M28.68); also the size and count caps ofbinary(make,join,
split,readInts/readFloats),asn1.encode,crypto.randBytes,
regexpatterns andstrings.repeat, the open-stream caps ofhash,
crcandcompress, the per-call caps ofnet.readN/readBytes/
recvFrom(256 MiB),io.readBytes/readChars/readLine,fs,
lists,linalg,mlandos.spawn,multipart.parse(1000 parts),
memcache(64 KiB line, 64 MiB value),amqpframes (64 MiB),myst
csv-tables (20,000 cells) andrstsubstitutions (all were"runtime"or
the module's kind); - a closed channel (
send,recv,recvTimeout,select), a late
httpdreply and amemcacheclose mid-reply are"closed"; a malformed
mqttpacket is anMqttError;snmpandwebdavpass the generic
kinds on; no reply from anntpserver or ansnmpagent is"timeout"
(was"ntp"/"snmp"); - a socket failure (refused, reset, DNS, TLS) is
"net", always a
net.NetError(was"runtime"); anhttpserver closing before any reply
is aNetError(was"http"), a reply cut short is"closed"(M28.65); - a cancelled task is
"cancelled";net.readNshort ofnbytes, and a
peer closing mid-read inamqp,mqtt,imap,pop,redis,
websocketandmikrotik, is"closed"(M28.73, M28.74); jsonrpc,oauth,soapandtelegrampass the generic kinds on instead
of rewrapping them;amqp,snmp,ntpandwebdavpass"net"on.
- a reached cap is
- Module error structs. The protocol clients (
acme amqp graphql imap jsonrpc ldap mcp memcache mqtt ntp oauth pop redis rest s3 smtp snmp soap webdav zmqand the deprecated ones) throw one struct each (rest.HttpError,
smtp.SmtpError, ...), kind and message unchanged. A parameter typedError
no longer accepts them; type it with the module's struct. (M28.51 to M28.53) - Value nesting cap. A literal, index, field or append write nesting a value
past 1000 container levels (64 onjennifer-tiny) throws"limit". (M28.37) - Invalid UTF-8 is an error where outside data becomes a
string:ioand
fstext reads,os.run/os.waitoutput (use the newos.runBytes/
waitBytes),xmlandyamlinput;httpdanswers400. - Stricter parsing: base32 / base64
encoding.fromTexttakes only
canonical text (no line breaks, exact padding) (M28.43);csvrefuses
malformed quoting and ragged records, and writes CRLF;yamlrefuses YAML
1.1 numbers (012,1_000: quote them) and mismatched core tags;xml
enforces well-formedness and namespace well-formedness (M28.34);
convert.toFloattakes plain decimal only;json.asIntrefuses1.0;
asn1.printableString/ia5String,uri.parse,validate.url/email
andos.spawnoptions are checked;logrejects an unknown format or level
instead of falling back to text / info. - New caps:
compress.unpackoutput (256 MiB default),fs.readString/
readBytes(256 MiB),lists.push/concat(4,194,304 elements),regex
patterns (32 KiB, 50,000 instructions),jsonrpcbatches (1000),
password.generate(4096); 32 MiB forbinary,fs,archiveand
compressonjennifer-tiny. - Refused for safety: non-
http(s)URLs andhttpstohttpredirects in
http(opt in withOptions.allowInsecureRedirect); headers outside a safe
allowlist on a cross-origin redirect (M28.59);jwtHMAC keys under 32 / 48 /
64 bytes;totpsecrets under 80 bits; emptywebCSRF andwebhook
secrets;sessionTTLs below 1; unsafe names inhtml.render; invalids3
bucket names and empty keys, andpresignexpiries outside 1..604800 s;
negativegpiopins;acmechallenge tokens that are not base64url; a
soapDOCTYPE behind a leading comment;./..members inwebdav
listings; anmqttremaining length over 4 bytes; anES*JWK on another
curve injwt; Unicode whitespace invalidate.email/url;xml
attributes without whitespace between them;totp.generateSecretNunder 10
bytes; a SCRAM success inpop,smtpandimapwithout a verified
server-final (the server never proved it knows the password); a SCRAM
iteration count below 4096 or anm=extension insasl(SASLprep is not
applied); anldap.bindwith a DN and an empty password (an unauthenticated
bind; anonymous bind is unchanged); Unicode format characters (\p{Cf}:
bidi controls, zero-width, BOM) invalidate.email/url; anES*PEM key
on another curve and aleewayoutside 0..86400 injwt; a
# pragma-jennifer-versionbound with a pre-release or build suffix
(>=0.25.0+junk, also lint L303). - Behaviour:
asn1.encodesortsSETchildren (DER);ansiwrappers
reset only their own attribute;jennifer test --filteronly narrows the
test*functions;webapiignores anAcceptrange whoseqis not a
qvalue in 0..1 (it counted as 1); the bundled modules that use a 0.26.0 feature now require
>=0.26.0, so a copied one does not load on 0.25.x.
Deprecated
- The bundled
discord,gotify,influxdb,mactelnet,mikrotik,
prometheus,slack,statsdandtelegrammodules, removed in 0.28.0.
Each continues as a deck with the same surface:jvc add "@jennifer/NAME",
thenimport "@jennifer/NAME/" as NAME;. (M30.1)
Language and interpreter
for (def b in $data)iteratesbytes, binding each byte as anint. (M28.49)- A literal of a bundled module's struct may omit fields (
jwt.Policy{iss: $i}). # pragma-jennifer-version: >=0.25.0 <0.26.0takes an exclusive upper
bound; a-devbuild passes every floor and fails every bound. (M28.42)- Generic error kinds
"limit","timeout","closed","net",
"cancelled","value";testing.assertThrowssees a thrown struct's kind. task.cancelwakestime.sleep, channel operations, socket reads (TCP and UDP, and so
httprequests),serial.readand module code.- Faster rune positions on ASCII strings; borrowing survives calls into module
functions that cannot re-enter the host.
Standard library
Libraries (use NAME;):
binary:bitXor/bitAnd/bitOr/bitNot;readInt/
readUint/readFloat/readInts/readFloats(order, b, ...).channel:recvTimeout(ch, ms). (M28.48)crypto: AES block modes (blockEncrypt), RSA-OAEP, X25519agree,
ChaCha20-Poly1305 / XChaCha20-Poly1305,"nacl-sealedbox",hashPassword/
verifyPassword(argon2id, bcrypt, scrypt),argon2id/scrypt. (M28.58)decimal(new): exact base-10 arithmetic with explicit rounding modes.fs:mkfifo;writeNewtakes bytes, refuses a symlink, leaves no
partial file.os:unsetEnv,hasEnv,runBytes/waitBytes.hash: SHA-3 and BLAKE2 incompute,hmacandstream.httpd:rawQuery;etaganswers412to a conditional write.images(new): PNG / JPEG / GIF decode and encode, an immutable RGBA
images.Image,crop,resize,rotate,dither,draw, pixel access.json:encodeWith(v, EncodeOptions{indent, sortKeys, rawHtml, canonical})(RFC 8785),mergePatch(RFC 7386),decodeWith(s, DecodeOptions{maxDepth, maxNodes}), enums encode by variant;typeOf(v, ptr)returns"missing"(alsotoml,yaml). (M28.68)kv:keys(store[, prefix]);openFilecreates0600, one store per path.
maps:without(m, keys).strings:count(s, sub).math/stats/ml: accuracy at large parameters (Loader's form for
tPdf,binomialPmf,poissonPmf), exactmath.logat integer powers.net:NetError{op, reason, sent, replied},abort(conn). (M28.65, M28.71)serial:setReadDeadline/setWriteDeadline. (M28.46)xml: namespaces (localName,namespace,lookupPrefix,attrNS,
elementNS,setAttrNS, prefix maps and*:namein paths). (M28.34)
Modules (import "NAME.j";):
doctree(new): the document tree behindmarkdown,rstandmyst,
with HTML, XHTML, ANSI and PDF renderers.markdown: CommonMark 0.31.2 plus GFM tables, task lists, footnotes,
definition lists, alerts and attributes.rst,myst(new): reStructuredText and MyST readers with
directives, roles andcheck(src)diagnostics.soap(new) SOAP 1.1 / 1.2 client and server;webdav(new) client;
zmq(new) ZeroMQ over ZMTP 3.1 without libzmq.flatdb:openWith,getOr,saveWith(pretty,backup),
updateWith,lockWith.graphql:withTimeout,withRetries(queries only),withBackoff,
errorCodes.http: Digest auth (sendDigest,digestAuthorization), HTTP-date
Retry-After(M28.69), stricter request and response framing.jwt:signWithKid,jwksKeys,Policy.leeway.ldap:
escapeFilterValue.s3:errorOf(resp).session:exists,
rotate.validate:checkValue,ensure/ensureValue.oauth: Authorization Code with PKCE,devicePoll,clientAssertion,
jwtBearer, OIDCdiscover*,Config.tls. (M28.47)pdf: GIF and native PNG decoding,imageFrom(name, images.Image).web/webapi:web.remoteHost,web.rawQuery;
webapi.limitKey,negotiate,Retry-Afteron 429.websocket:connectOptionswith headers, subprotocols and TLS trust.
Tooling
lint:L116flags a string slot holding only a literal (M28.76);
L104accepts error-shaped structs (M28.50);L205also catches struct and
bytesaccumulators;L303checks pragma ranges; acatchbinding is
untyped, so passing it to a struct-typed parameter is noL110.profile --allocsranks copies by bytes with the copied type and reports
module-boundary rebuilds.- CI:
scripts/*.jare formatted and linted; a release whose changelog
heading still says "unreleased", in any case, fails. - Editors: a Chroma lexer draft (Forgejo, Gitea, Hugo); the other grammars
handle dotted names, docblocks, nested slots anduse.
jennifer-tiny
- A stack guard turns deep recursion into the catchable
"limit""call stack
too deep" instead of corrupting memory. (M28.72) jennifer-tiny-devaddsfmt,lint,profile,test,tokensand
astto the TinyGo build (make build-tinygo-dev). (M28.75)- The
golang.org/x/cryptoalgorithms run here too. CI uses TinyGo 0.44.0.
Packaging and images
- New
alpineimage (:alpine,:<version>-alpine). Theslimandalpine
images bundlejvc(ARG JVC_REF,0.2.0); every image carries
/usr/bin/jennifer-tiny-dev, which the release archives and packages do not. - A release is gated on jvc's suite against the candidate and published from
GitHub only. - Release notes are the tag's section of this file; a tag without one, or still
marked "(unreleased)", fails the release. (M28.24) - New dependency
golang.org/x/crypto: +216 KiB onjennifer, +188 KiB on
jennifer-tiny.
Fixed
rst: the substitution budget counts all eight expansion levels, so a chain
that only passes the node cap at the deepest level is refused up front
("limit") instead of being expanded first.mcp.serveStdioanswers a line overio.readLine's cap with one parse error
and skips the rest of that line; its tail was read as the next request.
(io.readLine's"limit"consumes only up to the cap; the next call
continues the line, now documented.)memcache: the 64 KiB reply-line cap no longer counts the CRLF.images: the pixel cap follows the allocation cap (64 Mpx, 8 Mpx on
jennifer-tiny, which allowed 256 MiB canvases before), and resizing keeps
its filter buffer within 256 MiB (32 MiB on tiny) by working in strips,
instead of up to about 1 GiB.decimal: parsing and arithmetic share one exact 100,000-digit limit, so
every value'stoStringparses back (1e100000did not); over it is
"limit".http: aRetry-Afterof delay-seconds with leading zeros (0000001) is
read correctly instead of as the 30 s cap.html: a refused tag or attribute name is quoted and escaped in the error
message, so it cannot inject lines into a log.- A thrown module struct keeps its
alias.Structidentity. (M28.56) - A module's function passed as a func value to a higher-order builtin
(lists.map, ...) now runs in its module (it failed withunknown struct),
and a struct thrown through a module func value keeps its module identity. archive.unpack: a member's declared size no longer preallocates beyond what
the input can hold, so a tiny archive declaring a huge member fails without a
large allocation.lint: a parameter that shares a top-level variable's name is typed as the
parameter (a falseL110).- A module struct field typed with the module's own enum accepts that enum
from the importing program. - A timed-out
term.readByteTimeoutraced a laterio.readLine;termand
ionow share one stdin reader. (M28.38) - Deeply nested values crashed
jennifer-tinyand overflowed the default
binary's stack. (M28.37) - Markdown PDF output put a space between inline markup and adjacent
punctuation. (M28.77) jennifer fmtread the-after]as unary minus;jennifer profile
countedCUMmore than once for recursion and module calls.smtpnormalises bare CR / LF before dot-stuffing (SMTP smuggling).httpresolves a relativeLocationper RFC 3986 and closes a keep-alive
socket after a failedexchange; a positivetimeoutMsnow also bounds the
connect (it was always 30 s); aSessioncloses onConnection: closeand
on HTTP/1.0 without keep-alive; an uncapped body over 256 MiB is read in
pieces.yaml.encodedouble-quotes the multi-line strings it wrote as a block it
could not read back (a leading line break was lost).mcp.serveStdioanswers a non-UTF-8 line with a parse error instead of
exiting;popCAPA no longer hides a close, timeout or cap;oauth
comparesstatein constant time;jwterrors no longer echo the raw
kid;multipart.buildWithquotes a non-token boundary;s3decodes XML
entities in one pass.markdownparses long*/_runs in linear time (they were quadratic);
pdf.bookmark/addFont/addImageno longer copy the whole document.webapi.guardchecked aHEADrequest against no route (letting it
through) or another route's spec; it now uses theGETroutewebserves.httpd.serveFilelisted a directory without anindex.htmleven with
dirListingoff;setHeaderrefusesTransfer-Encoding, andresponda
Content-Lengththat does not match the body.ansinested wrappers lost the outer style;kvstoreincrWindowwas not
atomic on redis;flatdbdid not fsync before rename;oauth.savewrote the
token before restricting the file to0600.cron.nextmissed schedules more than five years ahead;ntpmisread
timestamps past the 2036 rollover;crypto.verifythrew on an Ed25519
signature of the wrong length.mikrotikmissed a cancelled stream's!trap;mactelnetleaked its
socket on a timeout. (M28.74)
Test results
- Full Go test suite: passing (JUnit
report.xmlattached). - Interpreter code coverage: 77.4% (
coverage.htmlattached).
Artifacts
jennifer-0.26.0-darwin-amd64-UNSUPPORTED.tar.gzjennifer-0.26.0-darwin-arm64-UNSUPPORTED.tar.gzjennifer-0.26.0-linux-amd64.tar.gzjennifer-0.26.0-linux-arm64.tar.gzjennifer-0.26.0-windows-386-UNSUPPORTED.zipjennifer-0.26.0-windows-amd64-UNSUPPORTED.zipjennifer-0.26.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.