ae v0.0.4000
Vladimir Panteleev
thecybershadow.lists at gmail.com
Tue Nov 24 14:31:22 UTC 2026
*ae* (***a**lmost **e**verything*) is an auxiliary
general-purpose D library. It is used by
[DFeed](https://github.com/CyberShadow/DFeed) (forum.dlang.org),
[btdu](https://github.com/CyberShadow/btdu),
[CyDo](https://github.com/CyberShadow/CyDo),
[Dunamis](https://github.com/CyberShadow/dunamis), and most of my
D projects in general.
Among many things, it implements an asynchronous event loop,
several network protocols, and various utility code to complement
the D standard library (Phobos).
https://github.com/CyberShadow/ae
The library's Git repository has reached another round number of
commits, so as [last
time](https://forum.dlang.org/post/omgbgqkvsimsczdjzrtf@forum.dlang.org), here is an overview of what's new, in case someone finds something useful for their D adventures. Please see [the README document](https://github.com/CyberShadow/ae#overview) for an overview of what can be found in the library, and [ae.dpldocs.info](https://ae.dpldocs.info/ae.html) for the documentation.
### What's new in *ae*?
Notable additions within the last 1000 commits:
#### Networking
-
[`ae.net.asockets`](https://github.com/CyberShadow/ae/blob/master/net/asockets.d) gained two new event loop backends: **epoll**, now the default on Linux, and **IOCP** on Windows (with support for `AcceptEx`/`ConnectEx`, named pipes, and asynchronously waiting for process exit). libev remains the default on other platforms when available, and `select` is still the fallback. Also new: asynchronous DNS resolution, scatter/gather sends, `TCP_NODELAY` by default, and a number of debugging aids (`ASOCKETS_DEBUG_IDLE` reports what is keeping the event loop busy when it's been idle for too long, `ASOCKETS_DEBUG_SHUTDOWN` reports what is keeping it from exiting, and `ASOCKETS_SLOW_EVENT_HANDLER` flags handlers which block it).
-
[`ae.net.db`](https://github.com/CyberShadow/ae/tree/master/net/db) contains new asynchronous, event-loop-integrated database clients for **PostgreSQL** (including SCRAM-SHA-256 authentication and TLS), **MySQL/MariaDB**, and (experimentally) **SQLite**, sharing a common query API with typed parameters and lazily-iterated results. The PostgreSQL module is now used in production, via Dunamis.
-
[`ae.net.dbus`](https://github.com/CyberShadow/ae/tree/master/net/dbus) is a native asynchronous D-Bus client and service host. It lets you call methods on and export objects using D interfaces, subscribe to and emit signals, own bus names, and automatically serves introspection and properties for exported objects. This should be helpful for extending your favorite Linux desktop using D.
-
[`ae.net.jsonrpc`](https://github.com/CyberShadow/ae/tree/master/net/jsonrpc) is a JSON-RPC 2.0 implementation. Clients and servers can be generated from D interfaces, and run over HTTP, stdio, newline-delimited JSON, or LSP-style `Content-Length` framing on any `IConnection`.
-
[`ae.net.http`](https://github.com/CyberShadow/ae/tree/master/net/http) gained a WebSocket client and server (with `permessage-deflate` compression), Server-Sent Events, chunked transfer encoding on requests, request queuing/pipelining in the HTTP client, and content negotiation for error responses. The server is no longer tied to TCP, and can listen on any transport described by the new [`ae.net.endpoint`](https://github.com/CyberShadow/ae/blob/master/net/endpoint.d) (such as UNIX sockets or Windows named pipes).
-
[`ae.net.ssl.schannel`](https://github.com/CyberShadow/ae/blob/master/net/ssl/schannel.d) is a new TLS backend using Windows' native SChannel, so ae programs on Windows can use TLS over plain sockets without shipping OpenSSL. The [`ae.net.ssl`](https://github.com/CyberShadow/ae/blob/master/net/ssl/package.d) API was extended with portable ways to configure TLS (cipher suites, minimum/maximum protocol versions, PKCS#12 identities, PSK, SNI, STARTTLS), and OpenSSL 3 is supported.
- Smaller additions include a
[SOCKS5](https://github.com/CyberShadow/ae/blob/master/net/socks/socks5.d) client (chainable with HTTP and TLS connectors), X11 extensions and authentication in [`ae.net.x11`](https://github.com/CyberShadow/ae/blob/master/net/x11/package.d), and a minimal experimental [Matrix](https://github.com/CyberShadow/ae/tree/master/net/matrix) client.
#### Serialization
-
[`ae.utils.serialization`](https://github.com/CyberShadow/ae/tree/master/utils/serialization) has been rewritten into a format-agnostic framework built around a source/sink protocol: any source (a D value, a parser, an in-memory tree) can be connected to any sink (a D value, a writer, a filter). Supported formats include JSON (including a fiber-based streaming parser that can be fed data in arbitrary chunks), BSON, CBOR, MessagePack, TOML, XML, CSV, SDLang, YAML (via dyaml), bencode, structured INI, and even .NET Remoting Binary Format; there is also a sink which generates D literals. Data can be captured and replayed using an inspectable tree (`SerializedObject`) or a compact opaque buffer (`SerializationSponge`). Values the sink does not need are skipped by the source without being decoded. The classic `ae.utils.json` API is now a thin compatibility layer on top of the new framework.
#### Concurrency and asynchronous programming
-
[`ae.utils.promise`](https://github.com/CyberShadow/ae/tree/master/utils/promise) has grown into a package. [`ae.utils.promise.await`](https://github.com/CyberShadow/ae/blob/master/utils/promise/await.d) adds a fiber-based `async`/`await`-like API, and `awaitSync` allows synchronously waiting for a promise in non-asynchronous code. Also new are `all` (heterogeneous), `race`, `allSettled`, `PromiseQueue`, `sleep`/`sleepUntil`, `threadAsync` to run code in a thread and get a promise for the result, and `AsyncQueue` for passing data between threads.
-
[`ae.utils.statequeue`](https://github.com/CyberShadow/ae/blob/master/utils/statequeue.d) orchestrates expensive asynchronous transitions towards a goal state which may change at any time (e.g. starting/stopping a service in response to user requests).
-
[`ae.utils.parallelism`](https://github.com/CyberShadow/ae/blob/master/utils/parallelism.d) provides simple, eager parallel versions of common algorithms (map, reduce, sum, equal, filter).
-
[`ae.sys.fswatch`](https://github.com/CyberShadow/ae/blob/master/sys/fswatch.d) is a small cross-platform file system change notification facade (inotify on Linux, `ReadDirectoryChangesW` on Windows, polling elsewhere).
#### Memory and data structures
-
[`ae.sys.data`](https://github.com/CyberShadow/ae/blob/master/sys/data.d) was overhauled. `Data` is now a typed `TData!T` (with `Data` being `TData!ubyte`), and is usable from `@safe`, `pure`, `nothrow` and `@nogc` code. Small allocations now use the C heap instead of whole OS pages.
-
[`ae.utils.vec`](https://github.com/CyberShadow/ae/blob/master/utils/vec.d) is an `std::vector`-like type with deterministic lifetime, which also supports non-copyable types. `DataVec` (a `Vec` of `Data`) replaced `Data[]` across the networking code.
-
[`ae.utils.functor`](https://github.com/CyberShadow/ae/tree/master/utils/functor) is a library for composing functors, i.e. callable structs which carry their state with them. These allow using range algorithms and callbacks with closures without GC allocations. [`ae.utils.text.functor`](https://github.com/CyberShadow/ae/blob/master/utils/text/functor.d) builds on it to allow lazily formatting strings in `@nogc` code.
-
[`ae.utils.rangeassoc`](https://github.com/CyberShadow/ae/blob/master/utils/rangeassoc.d) is an associative array which maps contiguous key ranges (intervals) to values. It has been useful for representing calendar data for bitemporal systems.
-
[`ae.utils.math.mixed_radix`](https://github.com/CyberShadow/ae/blob/master/utils/math/mixed_radix.d) encodes sequences of bounded numbers, or entire structs, into a single integer and back. [`ae.utils.math.combinatorics`](https://github.com/CyberShadow/ae/blob/master/utils/math/combinatorics.d) implements the combinatorial number system, which does the same for combinations.
-
[`ae.utils.mapset`](https://github.com/CyberShadow/ae/tree/master/utils/mapset) (from the previous announcement) received significant improvements to its visitor, and [`ae.utils.mapset.vars`](https://github.com/CyberShadow/ae/blob/master/utils/mapset/vars.d) adds a helper which makes code exploring all states look like code operating on regular variables.
#### Miscellaneous
-
[`ae.utils.funopt`](https://github.com/CyberShadow/ae/blob/master/utils/funopt.d) (which turns a D function signature into a command-line interface) can now generate man pages, and supports `Nullable` options and `--version`.
-
[`ae.utils.path.glob`](https://github.com/CyberShadow/ae/blob/master/utils/path/glob.d) implements fast compiled glob expressions.
-
[`ae.utils.time`](https://github.com/CyberShadow/ae/tree/master/utils/time) gained `AbsTime` (a zero-overhead, `std.datetime`-compatible wall-clock timestamp, without `SysTime`'s time zone baggage), calendar durations (months/years), and `@safe` parsing/formatting into `Date`, `TimeOfDay` and `DateTime`.
-
[`ae.utils.auth.scram`](https://github.com/CyberShadow/ae/blob/master/utils/auth/scram.d) and [`ae.utils.digest.pbkdf2`](https://github.com/CyberShadow/ae/blob/master/utils/digest/pbkdf2.d) implement SCRAM-SHA-256 authentication and PBKDF2.
- New debugging facilities: `AE_DEBUG_FD_LEAK` (via `ae:fdtrack`)
records where leaked file descriptors were opened, and
`AE_DEBUG_DATA_LEAK` records where live `Data` instances were
allocated, and dumps them grouped by allocation site when memory
runs out.
As always, breaking changes (commits prefixed with `[BREAKING]`)
include a rationale and instructions on how to update affected
code, so `git log --grep=BREAKING` should be a decent upgrade
guide.
Thanks for reading!
More information about the Digitalmars-d-announce
mailing list