veko-lang.org
Download Free EPUB 3.0

Part II · Standard Library, PQC, Networking, Async, Durable State & Desktop UI

Chapter 8

Networking, Hybrid PQC TLS 1.3, Web, Zero-FFI SQLite & ORM, Databases & HTTPS Packages

Connected io/Stream protocols, HTTP/2, SSE, JWT/OAuth2/TOTP, Zero-FFI SQLite 3 & ORM, WAL KV, Postgres, Redis, and veko-lang.org VKP1 packages

Veko Language and Runtime
Veko Language and Runtime

This guide explains how to build connected applications, web services, authentication flows, zero-FFI databases, and cryptographically signed 'VKP1' package bundles in pure Veko across all three execution tracks (--vm / .vko, sandboxed --wasm via vvm, and standalone --native binaries across win-x64, win-arm64, linux-x64, linux-arm64, and macos-arm64).

NETWORKING, WEB & DATABASES

Unified io/Stream Stack, Hybrid PQC TLS 1.3, Web Router & Zero-FFI Databases

End-to-end network services, HTML5 rendering, and wire-native database drivers running across all three runtimes.

TRANSPORT & SECURITY LAYER io/* + net/dns + net/tls13 HTTP, WEB & REAL-TIME LAYER web + html + net/websocket + http2 PERSISTENCE & PACKAGING db/kv + db/postgres + db/redis + vkp Encrypted stream HTTP/1.1 HTTPS / WSS State & sessions SQL & cache Polymorphic I/Oio/Stream Capability Recordio/fs + io/net + io/open Secure TransportDNS & Hybrid PQC TLS 1.3RFC 8446 + X25519MLKEM768 Web Tierweb Router & HTML5 DSLMiddleware + auto-escaped html ProtocolsHTTP Client, HTTP/2 & WSnet/client + http2 + websocket Embedded StoreEmbedded db/kv EngineCRC-32 WAL + put-sealed External DBsPostgres v3, Redis & SidecarSCRAM-SHA-256 + RESP2/3
Component & ModuleArchitectural Role
io/Stream Capability Record
lib/io.vk + lib/io/net.vk
Record-of-closures interface unifying TCP sockets, files, and in-memory test buffers.
DNS & Hybrid PQC TLS 1.3
lib/net/dns.vk + lib/net/tls13.vk
Resolves DNS records over UDP/TCP and negotiates TLS 1.3 with X.509 chain verification.
web Router & HTML5 DSL
lib/web.vk + lib/html.vk
Routes parameterized paths (:id, *splat) through composable middleware and typed HTML5 nodes.
HTTP Client, HTTP/2 & WS
lib/net/client.vk + lib/net/websocket.vk
Provides redirect-following HTTP/1.1 batching, HTTP/2 HPACK framing, and RFC 6455 WebSockets.
Embedded db/kv Engine
lib/db/kv.vk
Crash-safe append-only log-structured key-value database with positioned pread/pwrite.
Postgres v3, Redis & Sidecar
lib/db/postgres.vk + lib/db/redis.vk
Speaks PostgreSQL v3 extended query wire protocol and Redis RESP directly over io/Stream.

1. OS Platform Layer (os/*, time/unix, net/*) & .exec Capability

Veko provides a uniform, deterministic Platform Abstraction Layer (PAL) across Windows, Linux, macOS Apple Silicon, the ORO VM, and the vvm Wasm 3.0 sandbox:

Wall-Clock Time & Positioned File I/O

BuiltinArityCapabilityPurpose
time/unix0.clocksCurrent UTC wall-clock Unix epoch timestamp in nanoseconds (i64)
os/stdin / os/stderr1 / 1.fsRead up to N bytes from standard input / write text to standard error
os/exit1—Terminate the current process with integer exit code code
os/cwd / os/temp-dir0 / 0.fsQuery current working directory or host temporary directory
os/stat / os/read-dir1 / 1.fsInspect file metadata ({ size, is_dir, mtime_ns }, returns err if missing) or list directory entries
os/remove / os/rename1 / 2.fsDelete a file/empty dir or atomically rename src to dst
os/open / os/close2 / 1.fsOpen a file handle ('r', 'w', 'rw', 'a') and close it cleanly
os/pread / os/pwrite3 / 3.fsPositioned random-access read (fd off len) and write (fd off bytes)
os/fsync / os/truncate1 / 2.fsFlush dirty buffers to stable storage / truncate file to exact byte length

Networking Primitives (net/*)

BuiltinArityCapabilityPurpose
net/connect-tcp/timeout3.netNon-blocking TCP connect enforcing a duration deadline (host port 2s)
net/set-timeout2.netApply per-socket read/write I/O timeout duration (sock 5s)
net/udp-bind2.netBind a UDP datagram socket (net/udp-bind '127.0.0.1' 0)
net/udp-send-to4.netSend a UDP datagram (sock host port payload_bytes)
net/udp-recv-from2.netReceive a UDP datagram ({ data, host, port }; also supports /timeout)
net/poll2.netPoll a block of socket handles for readability with a duration timeout
net/resolve1.netResolve a hostname to a block of IP address strings

Least-Privilege .exec Capability Gate

Subprocess execution (os/exec) is gated by its own dedicated .exec capability rather than .fs. Projects that only read/write files or open sockets cannot spawn external processes unless veko.vk explicitly grants .exec:

VEKO
{
    name       = 'my-service'
    root       = 'src'
    allow-caps = [.fs .clocks .net]   // os/exec is statically denied at check/compile time
}

2. Connected Streams (io/fs, io/net, io/open) & UUID v7

Every transport in Veko adapts cleanly to the io/Stream interface so higher-level protocols (net/http2, net/websocket, web, db/postgres, db/redis) work identically over memory buffers, files, TCP sockets, or post-quantum TLS 1.3 streams.

VEKO
use [io, ifs = io/fs, inet = io/net, iopen = io/open, rnd = rand]

// RFC 9562 time-ordered UUID v7 (monotonically sortable by UTC millisecond timestamp)
req_id = rnd/uuid-v7

// Positioned file stream with explicit fsync
mut wf = ifs/open-write 'data/out.bin'
_ = io/write-all mut wf (bytes/from-str 'hello veko')
_ = ifs/sync wf
_ = io/close mut wf

// Unified URI dispatch (`mem://`, `file://`, `tcp://`, `tls://`, `http://`, `https://`)
mut st = iopen/open 'file://data/out.bin'
payload = io/read-all mut st
_ = io/close mut st

3. DNS, Hybrid Post-Quantum TLS 1.3, HTTP/2, WAN QUIC HTTP/3 & WebSockets

All networking protocols are implemented in 100% pure Veko with zero external crypto or TLS DLLs:

  • net/dns: RFC 1035 wire query encoder (encode-query), response decoder (decode-response), /etc/hosts & /etc/resolv.conf parsers (parse-hosts, parse-resolv-conf), UDP resolver (query-udp), and host lookup (resolve-host). io/net/resolve-ipv4 resolves hostnames using .net only (zero .fs capability required).
  • net/tls13 & crypto/x509 (Hybrid Post-Quantum X25519MLKEM768 + 8 Built-In Public CAs + Custom Roots + Deadlines):
    • Enable hybrid post-quantum key agreement (0x11EC = X25519 + FIPS 203 ML-KEM-768) by passing pqc = true in tls13/connect options, with full TLS 1.3 cipher suite negotiation across AES-128-GCM-SHA256 (0x1301), AES-256-GCM-SHA384 (0x1302), and ChaCha20-Poly1305-SHA256 (0x1303).
    • Validates X.509 chains out of the box against 8 built-in public CA roots (ISRG Root X1, ISRG Root X2, ISRG Root YE, DigiCert Global Root G2, GTS Root R1, Amazon Root CA 1, USERTrust RSA Certification Authority, and USERTrust ECC Certification Authority) plus optional custom enterprise trust anchors (ca_file, ca_pem, or extra_roots_pem) across Ed25519 (0x0807), ECDSA P-256 (SHA-256, 0x0403), ECDSA P-384 (SHA-384, 0x0503), RSA PKCS#1 (SHA-256/384/512), and RSA-PSS (SHA-256 0x0804, SHA-384 0x0805, SHA-512 0x0806), with automatic mtime-based CertReloader hot-reloading and 5s server handshake wall-clock deadlines.
  • net/http2: RFC 9113 HTTP/2 connection layer over io/Stream (client-open, server-accept, request, serve-conn-opts), flow-controlled io/Stream DATA response streaming, and H2ServerOpts DoS protections (max_concurrent_streams, CONTINUATION & HPACK dynamic table caps, and CVE-2023-44487 RST_STREAM Rapid Reset GOAWAY(ENHANCE_YOUR_CALM) enforcement).
  • net/http3: Pure-Veko RFC 9000/9001/9002/9114 QUIC v1 + HTTP/3 UDP client and server (request, serve-h3) featuring contiguous interval-merging ReassemblyBuf stream/CRYPTO reassembly (for multi-packet PQC Initial ClientHellos and out-of-order WAN datagrams), RFC 9000 Appendix A.3 packet number reconstruction (reconstruct-pn), multi-range encode-ack-ranges, 25ms PTO retransmission with cwnd pacing, and post-ClientFinished HANDSHAKE_DONE.
  • net/websocket: RFC 6455 WebSocket upgrade handshake (client-handshake, server-handshake, pure-Veko SHA-1 accept-key) and masked/unmasked framing (write-frame, read-frame).
VEKO
use [tls13 = net/tls13, h2 = net/http2, h3 = net/http3]

// 1. Multiplexed HTTP/2 over hybrid X25519MLKEM768 TLS 1.3 (built-in public CA roots)
mut cconn = tls13/connect 'veko-lang.org' 443 {
    alpn = 'h2'
    pqc  = true
}
mut tst = tls13/tls-stream cconn
mut h2c = h2/client-open mut tst
resp = h2/request mut h2c 'GET' '/api/v1/health' 'veko-lang.org' {} (bytes/with-cap 0)
_ = tls13/close mut cconn

// 2. Native QUIC v1 HTTP/3 over WAN UDP :443
h3_resp = h3/request 'veko-lang.org' 443 'GET' '/api/v1/health' {} (bytes/with-cap 0)

4. Web Micro-Framework (web) & Authentication (auth/jwt, auth/oauth2)

Web Micro-Framework (lib/web.vk), Streaming Bodies & Multi-Worker HTTPS

web provides a composable HTTP/1.1, HTTP/2, and HTTP/3 router with :param and *wildcard segments, automatic RFC-compliant HEAD dispatch on GET and static routes (preserving Content-Length with zero body bytes), middleware chains, built-in security headers (use-security-headers), 413 Payload Too Large header/body guards (max_header_bytes, max_body_bytes), multipart/form-data parsing, traversal-safe static file & 206 Partial Content Range serving (mount-static, serve-static-range), and streaming responses:

  • Streaming Responses (io/Stream & Positioned Files): Use web/stream-response (fixed Content-Length), web/chunked-response + web/encode-chunk (Transfer-Encoding: chunked), or web/stream-file / web/stream-file-range. Static files and byte ranges larger than 256 KiB automatically stream in 64 KiB positioned os/pread chunks across HTTP/1.1 and flow-controlled HTTP/2 DATA frames with constant memory footprint.
  • Non-Blocking Reactor & Multi-Worker HTTPS: web/serve-reactor multiplexes persistent HTTP/1.1 keep-alive connections (max_connections, max_reqs_per_conn) on a single OS readiness poller (epoll/kqueue/IOCP), while web/serve-https and web/https-accept-loop + web/https-worker-loop scale TLS 1.3 + HTTP/2 + HTTP/1.1 across bounded shared-nothing spawn worker pools.

For building full web applications in 100% pure Veko, lib/html.vk provides both a homoiconic Hiccup-style block DSL ([.div { class = 'card' } [ [.h2 ['Title']] ]]) and a typed component builder (html/Node, html/el, html/div, html/document) that compose seamlessly together with automatic XSS escaping, HTML5 void-tag handling, and javascript:/vbscript: URL sanitization. Pair directly with web/view and web/page:

VEKO
use [html, web]

service-card = fn [name str, tags block] html/Node [
    html/article { class = 'card' } [
        (html/h2 {} [(html/text name)])
        [.ul (map tags fn [t] [ [.li [t]] ])]
    ]
]

mut app = web/new-app
web/use-security-headers mut app
web/mount-static mut app '/assets' 'public'

web/get mut app '/dashboard' fn [req web/Request] web/Response [
    viewer = web/query-get req 'user' 'guest'
    web/page 200 'Veko Dashboard' [] [
        [.header [ [.h1 ['Control Plane']] [.p ['Signed in as: ' viewer]] ]]
        [.main [ (service-card 'edge-proxy' ['tls13-pqc' 'http2' 'http3']) ]]
    ]
]

web/get mut app '/releases/:archive' fn [req web/Request] web/Response [
    // Streams >256 KiB archives & 206 Range requests in 64 KiB positioned chunks
    web/serve-static-range 'downloads' (web/param req 'archive' '') (web/header req 'Range' '')
]

When you prefer string-based templates (e.g., emails or config generation), lib/template.vk renders {{ var }} (auto-escaped in render-html, unescaped via {{{ raw }}}), {{#if cond}}...{{else}}...{{/if}}, and {{#each list}}...{{/each}}.

Unified Pure-Veko HTTP/HTTPS Client (lib/net/client.vk)

net/client provides a single ergonomic HTTP/1.1 + HTTPS (TLS 1.3 / PQC + built-in public CA roots) client working identically across --vm, --wasm, and --native with get, head (zero-body HEAD handling alongside 204/304), post-json, request-batch, get-many, keep-alive ConnPool, automatic redirect following (301/302/303/307/308), timeouts, and transparent gzip/deflate response decompression:

VEKO
use [hc = net/client]

head_r = hc/head 'https://veko-lang.org/' (hc/RequestOpts { timeout = 5s })
resp   = hc/get 'https://veko-lang.org/api/v1/health' (hc/RequestOpts { timeout = 5s, pqc = true })
data   = hc/json-body resp

JWT (auth/jwt), OAuth 2.0 PKCE (auth/oauth2) & TOTP 2FA (auth/totp)

  • auth/jwt: Signs and verifies compact RFC 7519/7515 JWTs using HS256 (sign-hs256 / verify-hs256), EdDSA Ed25519 (sign-eddsa / verify-eddsa), and post-quantum ML-DSA-65 (sign-mldsa65 / verify-mldsa65). Validates exp, nbf, iss, and aud against live UTC time/unix via validate-claims, and extracts Bearer headers with parse-bearer.
  • auth/oauth2: Generates RFC 7636 PKCE S256 verifier/challenge pairs (generate-pkce, verify-pkce), CSRF state tokens (generate-state), authorization URLs (authorize-url), and form-encoded token exchange / refresh payloads (token-exchange-body, refresh-token-body).
  • auth/totp: RFC 4648 Base32 (b32-encode, b32-decode), RFC 4226 hotp, RFC 6238 totp-at / totp-now / verify-now (constant-time comparison with skew window), and otpauth-uri provisioning links.
VEKO
use [jwt = auth/jwt, dsa = crypto/mldsa, oa = auth/oauth2]

// Post-quantum ML-DSA-65 JWT with live expiration check
kp = dsa/keygen .mldsa65
now_s = (time/unix) / 1000000000
tok = jwt/sign-mldsa65 kp.sk { sub = 'alice', iss = 'veko.local', exp = now_s + 3600 }
ver = jwt/verify-mldsa65 tok kp.pk
_ = jwt/validate-claims ver.claims (jwt/ClaimOpts { issuer = 'veko.local' })

// OAuth 2.0 PKCE S256
pkce = oa/generate-pkce

5. Zero-FFI Database Stack (db/sqlite, db/kv, db/postgres, db/redis, db/sidecar)

Veko talks to embedded and networked databases—including genuine SQLite 3 files—with zero native C client libraries or FFI:

Zero-FFI SQLite 3 B-Tree Engine, Crash-Safe Journal, Indexes & JOINs (db/sqlite)

lib/db/sqlite.vk implements a 100% pure-Veko reader and writer for standard "SQLite format 3\0" 4096-byte slotted B-tree .sqlite / .db files across --vm, --wasm (.fs only — zero .ffi and zero .clocks!), and --native:

  • Crash-Safe 'VKJRNL01' Hot Rollback Journal & Incremental Page Commits: sq/save and COMMIT write pre-images of dirty 4096-byte pages to <db>-journal with CRC-32 verification (os/fsync), patch only modified pages via positioned os/pwrite + os/fsync, and unlink the journal under <db>-lock advisory coordination. If a power loss or crash interrupts a commit, sq/open (sq/recover-journal) automatically verifies and replays <db>-journal before opening.
  • Multi-Page 0x02/0x0a B-Tree Indexes & $O(\log N)$ Seeks: Writes genuine multi-level interior (0x02) and leaf (0x0a) index B-trees (plus overflow page chains for large payloads) and executes $O(\log N + K)$ binary-search equality and range scans (=, >, >=, <, <=, BETWEEN) via sq/seek-index-btree and sq/seek-table-rowid.
  • Relational INNER JOIN & LEFT JOIN (SQL & Homoiconic sq/q): Supports multi-table aliases, qualified u.col projections/predicates/aggregates, INNER JOIN, and null-extending LEFT JOIN in both sq/query-sql and sq/q:
VEKO
use [sq = db/sqlite]

users = sq/define-table 'users' (quote [
    id     i64 .pk
    email  str .unique
    region str .index
    score  i64 = 0
])

orders = sq/define-table 'orders' (quote [
    id      i64 .pk
    user_id i64 .index
    cents   i64 = 0
])

mut db = sq/open 'data/app.sqlite'
_ = sq/migrate mut db users
_ = sq/migrate mut db orders
uid = sq/insert mut db users { email = 'ada@veko-lang.org', region = 'ca-central-1', score = 98 }
_ = sq/insert mut db orders { user_id = uid, cents = 4900 }

// Homoiconic LEFT JOIN query with qualified projections
rows = sq/q db (quote [
    select [u.email o.cents]
    from users u
    left-join orders o on [u.id == o.user_id]
    where [u.score >= 90]
    order-by [u.score .desc]
    limit 10
])
_ = sq/close mut db

Files written by db/sqlite (sq/open, sq/save, sq/to-bytes) are genuine SQLite 3 binary databases directly readable by the standard sqlite3 CLI and DB Browser for SQLite, while enforcing Veko's .secret firewall on every SQL query and parameter.

Embedded Crash-Safe Transactional KV Store (db/kv)

Built directly on positioned os/{open,pread,pwrite,fsync,truncate,rename,close} with a CRC-32-verified WAL, automatic tail truncation on crash recovery, atomic batches, log compaction, sorted prefix scans, codec/vbin typed storage, and optional AES-256-GCM at-rest encryption (crypto/seal):

VEKO
use [kv = db/kv]

mut store = kv/open 'data/app.vkkv'
_ = kv/put-val mut store 'node:1' { host = 'eu-west-1', active = true }
_ = kv/put-sealed mut store 'vault/token' enc_key32 (bytes/from-str 'secret-value')
_ = kv/compact mut store
keys = kv/scan-prefix store 'node:'
_ = kv/close mut store

PostgreSQL v3.0 TLS, Prepared Extended Queries & Connection Pool (db/postgres)

Pure-Veko PostgreSQL v3.0 protocol client and bounded connection pool (PgConfig, PgPool) supporting PostgreSQL SSLRequest ('S') upgrade to net/tls13, RFC 5802/7677 SCRAM-SHA-256, MD5, and CleartextPassword authentication, binary Extended Query $1, $2... Parse/Bind/Describe/Execute/Sync (query-params, exec-params, named prepare/query-prepared statement caching), savepoint-aware with-tx, and closure-free channel-backed PgPool (new-pool, acquire, release, with-conn with SELECT 1 health checks and auto-reconnect):

VEKO
use [pg = db/postgres]

cfg = pg/PgConfig {
    host     = 'db.internal'
    port     = 5432
    user     = 'veko'
    password = (os/getenv/or 'PG_PASS' [''])
    database = 'appdb'
    tls_mode = .require
}

pool = pg/new-pool cfg 8
rows = pg/with-conn pool fn [mut conn pg/PgConn] any [
    pg/with-tx mut conn fn [mut tx pg/PgConn] any [
        pg/query-params mut tx 'SELECT id, email FROM users WHERE region = $1 AND active = $2' ['ca-central-1' true]
    ]
]
_ = pg/close-pool pool

Redis RESP3 TLS Client, Transactions & Pool (db/redis) & Sidecar RPC (db/sidecar)

  • db/redis: Full RESP3/RESP2 encoder/decoder (supporting strings, blobs, integers, booleans, doubles, big numbers, verbatim strings, maps, sets, attributes, and push frames), RedisConfig (connect with optional TLS 1.3 + ACL AUTH user pass + HELLO 3 negotiation), MULTI/EXEC/DISCARD with-tx transactions, pipelines, and channel-backed RedisPool (new-pool, with-conn with PING liveness validation and auto-reconnect).
  • db/sidecar: CRC-32-verified 'VKSC' binary codec/vbin RPC framing (encode-req, decode-req, encode-resp, decode-resp, call-exec) for integrating external database engines cleanly via .exec-gated subprocesses without in-process FFI.

6. Signed 'VKP1' Package Bundles (pkg/vkp, veko pkg, & trust-keys)

Veko packages multi-module libraries into single-file 'VKP1' binary archives secured by:

  1. Canonical path confinement (rejecting .., leading /, \, and NUL bytes) and strict lexicographical entry sorting,
  2. Per-module SHA-256 digests combined into a deterministic binary SHA-256 Merkle root,
  3. Cryptographic signatures using Ed25519, post-quantum ML-DSA-65, or hybrid dual signatures (both Ed25519 and ML-DSA-65 in the same bundle).

CLI Packaging & Verification (veko pkg)

POWERSHELL
# Pack a directory of .vk modules into a signed VKP1 bundle
veko pkg pack vendor/stats --name=veko-stats --version=1.0.0 --ed25519-seed=<64-hex> -o vendor/stats.vkp

# Inspect manifest, Merkle root, entries, and signer public keys
veko pkg inspect vendor/stats.vkp

# Verify against an explicit trust anchor
veko pkg verify --trust=ed25519:<64-hex-pubkey> vendor/stats.vkp

Installing from veko-lang.org or Decentralized HTTPS (veko pkg add & ~/.veko_modules)

Bare 'name@version' specs resolve from the official https://veko-lang.org/pkg/<name>/<version>.vkp registry (overrideable via VEKO_REGISTRY), while 'https://...' URLs fetch decentralized third-party bundles over pure-Veko TLS 1.3 into ~/.veko_modules and pin their SHA-256 + Merkle root in veko.lock:

POWERSHELL
veko pkg search rag
veko pkg info vec_rag
veko pkg add cloud_s3@1.0.0
veko pkg add openapi@1.0.0
veko pkg add ai_mcp@1.0.0
veko pkg add https://packages.example.org/veko/metrics-0.3.0.vkp
veko pkg verify-lock

Official veko-lang.org Ecosystem Packages (30 Signed .vkp Libraries)

Alongside the 95 embedded VKFS standard library modules, https://veko-lang.org/packages publishes 30 Ed25519-signed pure-Veko .vkp libraries across six production tiers, each bundling full API documentation (README.md), a self-contained runnable example (examples/demo.vk), and 1-click browser WebAssembly 3.0 Playground execution:

TierPackage (veko pkg add ...)Exported ModulesSummary
Tier 1cloud_s3@1.0.0cloud_s3AWS Signature V4 signing, presigned GET/PUT URLs, and S3 / R2 / MinIO object client.
Tier 1data_formats@1.0.0data_formats, data_formats/yaml, data_formats/xmlYAML 1.2 subset codec, XML/XHTML DOM & query helpers, RSS 2.0, and Atom 1.0 feeds.
Tier 1openapi@1.0.0openapi, openapi/schemaHomoiconic [ ... ] data validator, JSON Schema Draft 2020-12, OpenAPI 3.1, and HTML API Explorer.
Tier 1smtp_mail@1.0.0smtp_mailMultipart MIME composer, Ed25519 DKIM signer/verifier, SMTP STARTTLS/TLS client, and Resend/Postmark JSON.
Tier 1webauthn@1.0.0webauthn, webauthn/policyFIDO2 / WebAuthn Passkey verifier (CBOR COSE P-256 & Ed25519) + homoiconic RBAC/ABAC policy engine.
Tier 2grpc_proto@1.0.0grpc_proto, grpc_proto/protoProtocol Buffers v3 wire codec (varint, zigzag, fixed32/64), homoiconic schema, and 5-byte gRPC framing.
Tier 2cluster_raft@1.0.0cluster_raft, cluster_raft/swimDeterministic Raft leader election, replicated log & quorum commit + SWIM gossip failure detector.
Tier 2mq_streams@1.0.0mq_streams, mq_streams/nats, mq_streams/kafkaNATS Core/Headers wire protocol & wildcard subjects + Kafka RecordBatch v2 (CRC32C) & Produce/Fetch codecs.
Tier 2db_drivers@1.0.0db_drivers, db_drivers/mysql, db_drivers/clickhouseMySQL v10 binary handshake, native & caching_sha2 auth, and ResultSet decoder + ClickHouse Zstd JSONEachRow.
Tier 2resilience@1.0.0resilienceBounded ORO LRU+TTL cache, GCRA rate limiter, 3-state circuit breaker, backoff, and channel singleflight.
Tier 3ai_mcp@1.0.0ai_mcpJSON-RPC 2.0 Model Context Protocol (2025-03-26) server & client with homoiconic tool schemas, stdio, and HTTP.
Tier 3ai_llm@1.0.0ai_llmUnified multi-provider chat, tool-calling, structured output, and SSE delta parser (Gemini, Anthropic, OpenAI, Ollama).
Tier 3vec_rag@1.0.0vec_rag, vec_rag/bm25, vec_rag/chunkerEmbedded HNSW vector index + int8 quantization, stemmed BM25 full-text search, RRF hybrid RAG, and SQLite persistence.
Tier 3dataframe_parquet@1.0.0dataframe_parquet, dataframe_parquet/arrowTyped columnar DataFrames, homoiconic filter/join/group-agg pipelines, Arrow IPC, and Zstd columnar zone-map codec.
Tier 4payments_ledger@1.0.0payments_ledger, payments_ledger/stripeMinor-unit Money math, penny-exact allocation, transactional SQLite double-entry ledger, and .secret Stripe/LemonSqueezy SDK.
Tier 4graphql@1.0.0graphql, graphql/parserZero-codegen homoiconic GraphQL schema, query/fragment parser, batching Dataloader, and HTML5 GraphiQL Explorer.
Tier 4browser_cdp@1.0.0browser_cdpChrome DevTools Protocol (CDP) JSON-RPC session multiplexing, DOM/Page/Network automation, and net/websocket E2E runner.
Tier 4ldap_saml@1.0.0ldap_saml, ldap_saml/scimEnterprise SAML 2.0 SP AuthnRequest & signed Assertion verifier, OIDC JWKS matcher, and SCIM 2.0 /Users & /Groups sync.
Tier 5oci_k8s@1.0.0oci_k8s, oci_k8s/k8sDaemonless ko-style distroless OCI image builder & registry v2 pusher plus typed Kubernetes manifests & WATCH client.
Tier 5noise_tunnel@1.0.0noise_tunnel, noise_tunnel/socks5Noise Protocol (NN & IKpsk2 X25519+ChaChaPoly) encrypted multiplexed tunnels and RFC 1928/1929 SOCKS5 proxy codec.
Tier 5iac_fleet@1.0.0iac_fleetHomoiconic quote [...] Infrastructure-as-Code resource DAG, topological plan diffing, and .secret-redacted provisioning.
Tier 5wasm_plugin_sdk@1.0.0wasm_plugin_sdkMulti-tenant Wasm 3.0 host-guest plugin ABI (VKPW), fuel/memory caps, host-call allowlists, and audit trail.
Tier 6crdt_sync@1.0.0crdt_syncHybrid Logical Clocks (HLC), PNCounter, LWW-Map, OR-Set, RGA collaborative text CRDT, and room presence sync.
Tier 6iot_mqtt@1.0.0iot_mqtt, iot_mqtt/modbus, iot_mqtt/mdnsMQTT 3.1.1/5.0 wire codec & embeddable broker, industrial Modbus TCP registers, and mDNS/DNS-SD .local discovery.
Tier 6web_live@1.0.0web_liveHomoiconic HTML virtual-DOM differ, keyed patch ops, SSE morphing frames, and typed HTMX helpers.
Tier 6jobs_cron@1.0.0jobs_cron, jobs_cron/cron5-field cron parser & next-tick calculator + crash-safe Zero-FFI db/sqlite persistent job queue.
Tier 6doc_media@1.0.0doc_media, doc_media/markdown, doc_media/pdf, doc_media/img, doc_media/sshGFM Markdown-to-HTML, zero-dep PDF 1.4 generator, RGBA32 image transforms, and OpenSSH Ed25519 & SSHSIG.
Tier 6http_router@1.2.0http_routerComposable prefix-grouped web/App routers, CORS middleware, sliding-window rate limiters, and request IDs.
Tier 6veko_ui_kit@1.0.0veko_ui_kitAccessible Light-First HTML5 KPI cards, data tables, status pills, alerts, breadcrumbs, tabs, and modals.
Tier 6sqlite_orm_ext@1.0.0sqlite_orm_extBase64URL cursor pagination, schema migration versions, audit logs, JSON/CSV export, and DDL diffing.

Consuming Verified .vkp Dependencies in veko.vk

Declare .vkp bundle dependencies alongside trust-keys in veko.vk. The compiler verifies the SHA-256 Merkle root and cryptographic signatures against trust-keys in memory before loading any module AST — unsigned, tampered, or untrusted bundles are rejected automatically:

VEKO
{
    name       = 'my-app'
    root       = 'src'
    allow-caps = [.fs .net]
    trust-keys = [
        'ed25519:a1b2c3...'
        'mldsa65:d4e5f6...'
    ]
    deps = {
        stats = 'vendor/stats.vkp'
    }
}

7. Everyday Batteries (datetime, utf8, fs, slog, archive/*, codec/toml, net/ip, semver, diff, retry)

All everyday utility libraries follow Veko's consistent Subject-Verb-Object (SVO) convention (parse/format, encode/decode, pack/unpack, ? predicates, /or recovery):

ModuleCapabilitiesKey APIs
datetimePure (.clocks for now-utc)DateTime, now-utc, from-unix, to-unix, parse-rfc3339, format-rfc3339, format-http, add-days, with-offset, weekday, leap-year?
utf8Zerovalid?, decode-rune, encode-rune, rune-count, runes, from-runes, multi-byte-safe rune-slice
fs.fsexists?, dir?, file?, mkdir-all, remove-all, walk-dir, glob-dir, copy-file, write-atomic, RAII with-temp-dir
slog.clocks/.fsLogger, new-json, new-kv, with-level, with-fields, format-line, emit, emit-stream, debug/info/warn/error
archive/tarZeroPOSIX USTAR TarEntry, pack, unpack, pack-gz, unpack-gz (path-confined + checksum verified)
archive/zipZeroPKZIP ZipEntry, pack, unpack (STORE + DEFLATE via compress/deflate + CRC-32)
codec/tomlZeroTOML v1.0 decode & encode ([tables], nested tables, arrays, inline tables, comments)
net/ipZeroIPv4 & IPv6 parse, canonical RFC 5952 format, parse-cidr, contains?, v4?, v6?, loopback?, private?
semverZeroSemVer 2.0.0 parse, format, compare, bump-{major,minor,patch}, satisfies? (^, ~, >=, <, comma AND)
diffZeroLCS line diff diff-lines, equal?, format-unified (--- a / +++ b)
retry.clocksRetryOpts, backoff-delay, run (exponential backoff + jitter), token-bucket RateLimiter (limiter-new, allow?)

8. Runnable Examples & Doctests

Explore and verify every library in this guide across all three execution tracks:

POWERSHELL
# 1. Connected I/O streams, UUID v7, DNS, Hybrid PQC TLS 1.3 (X25519MLKEM768) & HTTP/2
veko run --allow-net --allow-listen --allow-private-net examples/21_io_streams_dns_and_pqc_tls.vk

# 2. Web micro-framework, HS256/EdDSA/ML-DSA-65 JWT, OAuth2 PKCE & RFC 6455 WebSockets
veko run --allow-net --allow-listen --allow-private-net examples/22_web_server_websocket_and_jwt.vk

# 3. Embedded crash-safe KV store, PostgreSQL SCRAM-SHA-256, Redis RESP3 & Sidecar RPC
veko run --allow-net --allow-listen --allow-private-net examples/23_zero_ffi_databases_kv_pg_redis.vk

# 4. Signed VKP1 package bundles (Merkle tree + Hybrid Ed25519 & ML-DSA-65 + tamper rejection)
veko run examples/24_signed_vkp_package_bundles.vk

# 5. Everyday batteries: datetime, utf8, fs, slog, tar.gz/zip, toml, net/ip, semver, totp, diff & retry
veko run examples/25_batteries_datetime_fs_archives_and_toml.vk

# 6. Pure-Veko HTML5 component DSL (`html`), safe templates (`template`), `web/page` & unified `net/client`
veko run --allow-net --allow-listen --allow-private-net examples/26_pure_vk_html_components_and_http_client.vk

# Run all embedded doctests across the networking, web, database, and package libraries
veko doc --test io/fs io/net io/open net/dns net/websocket net/http2 net/client net/ip auth/jwt auth/oauth2 auth/totp web html template db/kv db/redis db/sidecar pkg/vkp datetime utf8 fs slog archive/tar archive/zip codec/toml semver diff retry