Skip to content

Velt 0.6.0

Latest

Choose a tag to compare

@github-actions github-actions released this 07 Nov 19:38
· 162 commits to main since this release
3282544

Install

Linux and macOS:

curl -fsSL https://github.com/velt-lang/velt/releases/download/v0.6.0/get-velt.sh | sh

Windows (PowerShell):

irm https://github.com/velt-lang/velt/releases/download/v0.6.0/get-velt.ps1 | iex

Then run velt doctor. The toolchain brings its own linker: no Visual Studio Build Tools,
Xcode or C compiler needed
(Platforms and installation).

Breaking change: .vlt is now .velt

Source files move from .vlt to .velt, and a package's manifest from package.vlt to package.velt. Rename your files; a build that finds the old names says so. scripts/velt-ext.py in this repository does it for a checkout, and for a branch. The VS Code extension needs its new version for the new extension.

What's Changed

  • simd: f32x4/f64x2 mulAdd (fused, exact) and mulAddFast (may fuse) (#1981 step 7) by @andtii in #2020
  • lang: host functions (declare host("m") function) become wasm imports by @andtii in #1989
  • prelude: rotateLeft, rotateRight and swapBytes on every integer type (#1981 step 6) by @andtii in #2023
  • vir, codegen, opt: one registry of the runtime math operations (#1981 step 1) by @andtii in #1988
  • opt: fold runtime math operations on constants (#1981 step 2) by @andtii in #1993
  • vir: Rvalue::Intrinsic, pure operations as statements (#1981 step 3a) by @andtii in #1997
  • opt: numrep on math operations as statements (#1981 step 3b) by @andtii in #2003
  • docs: the intrinsics design (#1981) by @andtii in #2004
  • vir: lowering emits math operations as statements (#1981 step 3b) by @andtii in #2016
  • vir: MathOp::signature and Intrinsic::signature return a static slice, no allocation (#1981) by @andtii in #2017
  • velt_build_cache: one lock order for a shard, so collecting garbage and storing can't deadlock by @andtii in #2031
  • loader: conditional imports (#name specifiers resolved by build conditions) by @andtii in #1987
  • simd: i32x4.dotAdd, the int8 dot product (#1981 step 7) by @andtii in #2032
  • veltc: link to a temporary file and rename it into place, so concurrent velt test runs never start a half-linked program by @andtii in #2035
  • sema: the prelude's extend methods are checked when code reaches them (#1981) by @andtii in #2041
  • sema: two doc-comment links point at the veltlang.com reference pages by @andtii in #2042
  • wasm: tasks wait on host promises; the executor runs turns the host drives by @andtii in #2007
  • llvm, rt: i32x4.dotAdd is one sdot on arm64 CPUs with the dot product; --cpu's arm64 features and their start-up check (#1981 steps 5b, 7) by @andtii in #2033
  • prelude: checked, saturating and wrapping Add, Sub and Mul on every integer type (#1981 step 6) by @andtii in #2025
  • http-server: the idle-timeout test measures from before the last request by @andtii in #2046
  • vir, opt, codegen: math operations are statements only; the call-form paths go (#1981 step 3c) by @andtii in #2038
  • generators: editor diagnostics, a time limit and --no-generators, unforgeable host records by @andtii in #1966
  • std: fetch on JS hosts goes through the host's fetch (#http-transport) by @andtii in #2044
  • numrep: call_result no longer computes an argument fact it doesn't use by @andtii in #2053
  • sema, vir, runtime: read callbacks keep what they make as the same object, and storing the lock's parts outside a read is an error by @andtii in #1559
  • doc: the std type package declares its symbol keys (#2055) by @andtii in #2060
  • vir, codegen, std: f32.toBits() and f32.fromBits(), math operations no runtime defines (#2049 step 0) by @andtii in #2059
  • rt: function-property tables hash addresses with one multiply instead of SipHash by @andtii in #2068
  • vir, codegen: f16 and bf16 conversions as math operations, one instruction or a branchless sequence by @andtii in #2090
  • host: velt build --host ; hosts are packages, the glue's core is host-neutral by @andtii in #2047
  • sema: operator methods, a op b, -a and ~a call [Symbol.op] (#2050 steps 1-2) by @andtii in #2093
  • codegen (Cranelift): memory locals share stack slots when their live ranges are disjoint (#2048) by @andtii in #2064
  • sema: this-functions as values, generator types and expressions, then and reject for sigx (#942, #943, #379) by @andtii in #2073
  • cloudflare: R2, D1, KV, cache and Durable Object stubs as a package (#1738) by @andtii in #2131
  • ci: the merge queue's full check gets 75 minutes by @andtii in #2130
  • sema, vir, opt, llvm: std's inlining markers, inline() and noInline() (#1884) by @andtii in #2116
  • sema: compound assignment and indexing through operator methods (#2050 steps 3-4) by @andtii in #2094
  • vir, std: any objects convert to Record<string, V>; Array.prototype methods through any take the this apply/call/bind pass (#1219, #942) by @andtii in #2052
  • std, sema: velt/ops, operators in generic code (#2050 step 5) by @andtii in #2095
  • http-server: serve on a JS host, over std's velt/host/worker by @andtii in #2138
  • sema: casts, structural field reads and object unions on sigx's server path (#924, #930, #1185) by @andtii in #2133
  • Release blockers: memory safety, server state, catchable byte-buffer errors, JS evaluation order by @andtii in #2024
  • std, sema: operators on velt/simd vectors, BigInt and Duration (#2050 step 6) by @andtii in #2096
  • sema, vir: f16 and bf16, storage floats that compute in f32 by @andtii in #2108
  • lsp, ts-compat: operators in the editor and in the TypeScript subset (#2050 step 7) by @andtii in #2097
  • sema, vir, std: f16 and bf16 compound assignment, ++/--, toBits/fromBits, sort, and as from any by @andtii in #2153
  • sema: the BigInt mixed-operand note uses the operands as written by @andtii in #2167
  • std, vir, opt: numbers as text in Velt, built in registers and stored into the string (#1982) by @andtii in #1996
  • sema: a literal on the right of an f16/bf16 compound assignment is an f32; an any there needs as by @andtii in #2166
  • std: JSON numbers, StringBuilder numbers and toFixed in Velt (#1982) by @andtii in #2005
  • docs: design note for declared write effects (#854, #2014) by @andtii in #2180
  • veltc, ci: a Worker under workerd in the merge queue and nightly, with size, start-up and CPU budgets (#1739) by @andtii in #2185
  • http-server, docs: two comment lines wrapped at 100 columns by @andtii in #2193
  • docs: design note for native code through declare c and unsafe (#2187) by @andtii in #2200
  • vir, llvm, cl, std: integer vector sum() wraps in the lane type, sumWide() widens (#1981) by @andtii in #2194
  • rt, llvm, std, http-server: a panic in a request handler answers 500; catchPanic in velt/task (#2008) by @andtii in #2137
  • sema: f16 and bf16 compute as number: arithmetic in f64, a store rounds once (#2049) by @andtii in #2191
  • common, xtask: the hook table names the externs each hook replaces and its benchmark; a guard against new uses by @andtii in #2211
  • sema: generator widening, generator results of interface methods, object | undefined (sigx batch 5) by @andtii in #2171
  • loader: the program loader is its own crate, velt_loader, so tests and tools load programs as velt build does by @andtii in #2210
  • std, http-server: a received Request's signal aborts when the client goes away (#2074, part 1) by @andtii in #2215
  • vir: lowering a large function in linear time; compile-speed scale benchmark (#2189) by @andtii in #2202
  • registry-core: package and user names, semver versions and package archives in Velt, checked against vpm (#1740 step 1a) by @andtii in #2207
  • syntax, sema: m[i, j], an operator indexer with several keys (#2179) by @andtii in #2195
  • syntax, sema, fmt, tscompat: unsafe blocks, expressions and functions (#2187 step 1) by @andtii in #2201
  • vir: the counted-types passes only find the counted types; one pass lowers the program whole (#2189) by @andtii in #2221
  • codegen_llvm: cap how much LLVM's inliner grows a function by @andtii in #2224
  • docs: design for compiling each package once (a per-package build cache) by @andtii in #2236
  • registry-core: package.vlt read as vpm reads it, and semver requirements, checked against vpm (#1740 step 1b) by @andtii in #2214
  • ci: re-queue a merge-queue run that lost a runner by @andtii in #2238
  • common, sema: typed hook signatures in the hook table by @andtii in #2217
  • std cache, build cache: serve generator-written std code; BLAKE3 keys by @andtii in #2237
  • codegen_cl, opt: debug builds translate, compile and optimize functions on every core (#2189) by @andtii in #2233
  • llvm backend: remember clang --version in the build cache by @andtii in #2239
  • http-server: the idle-timeout tests leave the client no deadline by @andtii in #2219
  • vir, codegen: f32 sqrt; Math.sqrt of an f16 cast to f16 computes in f32 (#2049) by @andtii in #2246
  • std: velt/half, bulk f16/bf16 loading and conversion (#2049) by @andtii in #2260
  • std: cookies in velt/net/http: getCookies, setCookie, deleteCookie, getSetCookies (#2076) by @andtii in #2220
  • vir: class vtables hold clone/format/transfer glue only when the program uses it by @andtii in #2249
  • ci: macOS golden shards get 40 minutes by @andtii in #2272
  • vir: an any converted to an object type calls its slow path out of line (#2189) by @andtii in #2268
  • link: debug links against the shared runtime use lld or mold too (#2189) by @andtii in #2277
  • syntax, sema, vir, veltc: declare c functions with scalars, called from unsafe code (#2187 step 1) by @andtii in #2212
  • vir: typed hook call builders generated from the hook table by @andtii in #2218
  • std/fs: openRead(path, { start, end }), FileReader.openedStats() and realpath (#2077 step 1) by @andtii in #2281
  • docs: package cache design, from its review by @andtii in #2240
  • vir: one generated body per canonical instance, whatever the map's order by @andtii in #2245
  • vir, sema: literal moves read later in the literal, E of a callback that cannot fail (#2258, #2259) by @andtii in #2284
  • codegen_llvm: balanced codegen units for large programs by @andtii in #2230
  • syntax: an arrow may return a parenthesized function type by @andtii in #2273
  • ci: a merge queue run whose entry is gone cancels itself when a job gets a runner by @andtii in #2291
  • examples/hono-ssr: Hono JSX components rendered by Velt, byte-identical to Hono on Node (#2251) by @andtii in #2261
  • xtask: goldens, examples, packages and std code that does not talk to the OS run Linux only in the queue by @andtii in #2301
  • sema: typed hook call builders for the HIR calls sema writes by @andtii in #2234
  • vir, backends, std cache: statics with symbols and linkage; serve code reaching them by @andtii in #2247
  • lint: lint profiles and perf rules, velt check --perf and --fix by @andtii in #2269
  • syntax, sema: a non-null assertion as an assignment target (a[i]! += 1, x! = v) by @andtii in #2270
  • codegen_llvm: the inline caps count only calls LLVM would inline by @andtii in #2242
  • vir, codegen_cl: VIR verification on every core, once per debug build (#2189) by @andtii in #2267
  • vir: view loops versioned after the last counted-types pass; a loop copy keeps only the terms its tests need (#2189) by @andtii in #2232
  • sema: compound assignment and ++ through an f16/bf16 setter round once by @andtii in #2303
  • std, sema, vir: review follow-ups for velt/half and the sqrt fast path by @andtii in #2300
  • registry-core: the /api/v1 API over pluggable stores, in-memory adapters and the publish path policy (#1740 step 1c) by @andtii in #2282
  • docs: design for generic instances shared by shape (#2271 step 1) by @andtii in #2275
  • ci: the whole gate on Windows and macOS once a day and before a release, not after every merge by @andtii in #2302
  • vir, std, rt: integer printing always through std's hooks; velt_rt_str_from_{i64,u64} and velt_rt_strbuf_push_{i64,u64} deleted by @andtii in #2235
  • syntax, sema, vir, std: pointers, C types, buffers and strings cross to C functions (#2187 step 1) by @andtii in #2216
  • llvm: a partial vector load or store freezes its count by @andtii in #2311
  • registry-core: a publish reads its body outside the package's lock; a failed cache purge fails no write (#1740) by @andtii in #2313
  • std, sema, vir: CString, Out and OutPtr cross to C functions; C memory reads in Velt (#2187 step 1) by @andtii in #2227
  • xtask, ci: macOS checks only changes that really can differ there by @andtii in #2324
  • loader: the std index, kept in the build cache, with the (a1) rule (#2161 step 1) by @andtii in #2283
  • http-server: serveFile with conditional requests, Range and HEAD; streamed bodies with a Content-Length (#2077 step 2) by @andtii in #2288
  • nightly: the bench guard runs again and the type package compiles under tsc by @andtii in #2320
  • xtask: cache_key_tests give each test its own directory by @andtii in #2322
  • registry-conformance: a black-box suite every registry host must pass (#1740 step 2) by @andtii in #2325
  • veltc, codegen: each stage's data freed once the stage is done; memory in --timings by @andtii in #2278
  • registry-conformance: media types without parameters, real uploads for bad names, a trailing / on the URL (#1740) by @andtii in #2329
  • vpm, veltc, velt_link: allowNative, and C libraries per target in native.c (#2187 step 1) by @andtii in #2244
  • velt/db: ParamSink and writeParams, a statement's parameters for a driver written in Velt by @andtii in #2330
  • ffi: readBytes copies with memcpy, and readUtf8 checks the text once by @andtii in #2334
  • sema, vir: the integer hooks are checked where live code needs them (#2161 step 2) by @andtii in #2312
  • rt: due timers resume in timer order under Promise.all; a root that yielded waits for the next poll by @andtii in #2293
  • redis: the client in plain Velt on velt/net; the Rust crate is gone by @andtii in #2326
  • veltc: an unchanged build keeps the C libraries of its declare c functions by @andtii in #2337
  • syntax, sema, fmt, lsp: default exports and imports, and export * as ns (#1916) by @andtii in #2319
  • veltc, sema, std: unsafe code and the raw FFI API only in allowed native packages; the SAFETY lint (#2187 step 1) by @andtii in #2279
  • sema, vir: declare global namespaces, calling a function with properties through any, empty interfaces in intersections by @andtii in #2340
  • veltc, vpm: velt check lists the native code the program allows; allowNative in velt.lock.json (#2187 step 1) by @andtii in #2287
  • opt: an integer compared with a whole double below 2^53 is compared in integers by @andtii in #2309
  • tests, ci: the FFI pointer test links on Windows; a merge group checks what the entries it carries need by @andtii in #2346
  • llvm, veltc: macOS prefers the newest clang it finds; doctor says which and why by @andtii in #2328
  • vir, sema: an optional any member keeps its value when an any converts; Array.isArray of an unknown does not panic by @andtii in #2343
  • opt: fits(a, j) && fits(b, j) of one lane type and index is one test by @andtii in #2335
  • sema: a closure literal adapted to its parameter's type escapes when the callee keeps it (#2327) by @andtii in #2354
  • sema: stores by key and calls through function values in the HTTP handler check (#854 step 1) by @andtii in #2199
  • registry-core: no regular expressions, so it links as a Worker (#1740) by @andtii in #2355
  • std/net/http: new Request of a received request keeps its body readable by @andtii in #2357
  • vir, syntax: a C function saves errno only when its declaration asks by @andtii in #2361
  • sema, vir: the live set is a superset of what lowering builds (#2161) by @andtii in #2360
  • toolchain, vpm: the pinned zig that checks C headers; headers and unchecked in native.c (#2187 step 1) by @andtii in #2292
  • vtable_loads: solve Addrs in reverse postorder over the slots a fold can read by @andtii in #2362
  • sema, std: typeof of generic functions, Parameters and ReturnType, instanceof Promise of a dynamic value (sigx) by @andtii in #2366
  • fetch test: POSTs start after the server's close; pin the check before reuse by @andtii in #2377
  • nightly: the whole gate frees the runner's disk first by @andtii in #2384
  • registry-core: a package's lock is taken only by a caller who may write to it (#1740) by @andtii in #2380
  • ci: Linux programs link with the Rust toolchain's lld by @andtii in #2393
  • xtask: the parser's and formatter's corpus tests go through the changed files unless the tool changed by @andtii in #2397
  • tests: release panic locations on both backends, and no LLVM run the goldens already do by @andtii in #2400
  • vir, std: an any holding a primitive shares its box; record spreads copy the index (#2057, #2058) by @andtii in #2208
  • vir: generic instances shared by shape in debug builds, the array-view helpers (#2271 step 2) by @andtii in #2285
  • sema, std: inference defaults, infer-as-unknown, module destructuring, augmentation scope, flatMap, reduce(f), Number(any) (sigx terminal) by @andtii in #2305
  • std: the types of lib.dom that code shared with the browser names (sigx) by @andtii in #2369
  • ci: the workspace's crates compile through sccache by @andtii in #2410
  • tests: every_golden_compiles_with_variables checks a sample, every golden in the nightly by @andtii in #2407
  • std, rt: error-code names in Velt; velt_rt_err_code_name deleted by @andtii in #2382
  • sema: a value back from an any or given one more count is still the same object by @andtii in #2431
  • vpm: allowNative binds to a source; the root's entry wins, two transitive sources are an error (#2367 step 1) by @andtii in #2379
  • llvm: SIMD helpers inline into functions with CPU-extension features under LLVM 23 by @andtii in #2418
  • registry-cloudflare: registry-core on R2, D1 and a Durable Object (#1740 step 4) by @andtii in #2373
  • ci: clang's objects are kept between runs: the nightly gate saves them, Linux jobs restore them by @andtii in #2396
  • crypto: X25519, ChaCha20-Poly1305 and HKDF-SHA256 in Velt (#2392 step 1a) by @andtii in #2398
  • ci: merge queue runs read sccache's cache and don't write to it by @andtii in #2435
  • registry-core: a publish to another spelling of a published name doesn't take that package's lock by @andtii in #2439
  • sema: TypeScript's automatic JSX runtime: jsx, jsxs and Fragment through jsxImportSource by @andtii in #2280
  • vpm: a hardened extractor for .tar.gz and .zip archives fetched from a URL (#2367 step 2a) by @andtii in #2390
  • crypto: AES-GCM in Velt, bitsliced and constant time (#2392 step 1b) by @andtii in #2399
  • simd: f16x8 and bf16x8, widening to and narrowing from f32x4 by @andtii in #2386
  • veltc: declare c functions checked against their library's C headers, per target (#2187 step 1) by @andtii in #2295
  • crypto: AEADs seal and open in place without allocating (Aead interface) (#2392 step 2a) by @andtii in #2412
  • sema: unique symbol narrowing, discriminated-union literal casts, any fields converted field by field (sigx batch 6) by @andtii in #2205
  • simd: dotAdd and dotAddFast on f16x8 and bf16x8 by @andtii in #2387
  • veltc, vpm: installs compare C declarations with what their author checked; headers or unchecked required (#2187 step 1) by @andtii in #2310
  • ci: declare c checked against C headers through zig, only when a change touches the check by @andtii in #2318
  • sema: a function in shared(...) is called directly, on every thread, without a lock by @andtii in #2356
  • veltc: declare c const takes its value from the C headers, per target (#2187 step 1) by @andtii in #2372
  • std: dotF16 and dotBf16 in velt/half, dotI8 in velt/simd by @andtii in #2388
  • fmt: a line break next to a template in JSX braces is only layout by @andtii in #2448
  • vpm, veltc: a package's C sources built with the pinned zig, for any target (#2187 step 3) by @andtii in #2385
  • simd: AES round instructions on u8x16 (AES-NI, ARMv8 AES) with checks and targetFeature by @andtii in #2417
  • net: TLS 1.3 record layer, key schedule and wire codec in Velt (#2392 step 2b) by @andtii in #2413
  • packages: web, a router and middleware on http-server (#2078) by @andtii in #2363
  • web: rateLimit and bodyLimit middleware (#2078) by @andtii in #2376
  • all: source files move from .vlt to .velt; scripts/velt-ext.py moves open branches by @andtii in #2430
  • net: startTls, a TLS 1.3 client in Velt over any stream, without certificate checks for now (#2392 step 2c) by @andtii in #2414
  • rt: workerCount() stays the configured workers; spare workers report one of their indices by @andtii in #2462
  • sema: an imported module's promoted constants bring the constants their initializers read (#2409) by @andtii in #2464
  • crypto: compare an AEAD tag in one 128-bit comparison by @andtii in #2465
  • f16: what narrowing promises for a NaN round trip, and a golden of it by @andtii in #2467
  • fmt: the layout fuzz test seeds each file by its own path again by @andtii in #2469
  • std: workerCount and currentWorker's docs say what pinning does with the default executor by @andtii in #2472
  • velt_toolchain: each zig install unpacks into a directory of its own, also beside other threads by @andtii in #2477
  • net: a DER reader and an X.509 certificate parser in Velt (#2392 step 3a) by @andtii in #2425
  • std/compress: gzip, zlib and raw DEFLATE encoders in Velt, at levels 1 to 9, one-shot or streamed (#2075 step 1) by @andtii in #2466
  • syntax, sema, vir: a large array literal of numbers is one packed node (#2421) by @andtii in #2471
  • std/compress: Brotli encoder in Velt at qualities 0 to 11, one-shot or streamed; the gzip encoder's start-up cost down two thirds (#2075) by @andtii in #2491
  • vir: a SIMD vector in any compares by its bits in the equality glue; golden of vectors in any by @andtii in #2493
  • crypto, net: ECDH on P-256 in Velt; the TLS client retries with secp256r1 (#2392 step 3b) by @andtii in #2426
  • web: compress(), response bodies in Brotli or gzip as Accept-Encoding prefers, streamed (#2075) by @andtii in #2494
  • llvm: the CPU macro probes have a time limit, refusals last a day, objects are keyed by the clang behind a link by @andtii in #2500
  • sema, loader, lsp: number_text, number_float and record_any load when a hook needs them (#2161 step 3) by @andtii in #2345
  • docs: design for std calling WASI through declare c("c") on wasm32-wasip1 (#2408) by @andtii in #2461
  • crypto: ECDSA signature verification on P-256 in Velt (#2392 step 3c) by @andtii in #2428
  • sema: declare c struct, C structs as Copy values with C's layout (#2187) by @andtii in #2475
  • vpm, velt add: dependencies from a release archive at a URL, pinned by its SHA-256 (#2367 step 2b) by @andtii in #2470
  • sema: replaced-holder walks visit each type once per walk by @andtii in #2510
  • tests: the unref'd timer golden doesn't depend on how long two lines take by @andtii in #2514
  • vpm: the tree stamp's tests hold on Windows's clock by @andtii in #2519
  • vir: a CPU check this build answers false drops its branch in lowering by @andtii in #2511
  • tests: look for a compiler panic by its ICE: prefix, not by ICE anywhere by @andtii in #2512
  • vir, sema: an argument is read before the call when the callee can replace it by @andtii in #2489
  • std cache: what a served function reaches still counts by @andtii in #2526
  • syntax, sema, fmt, lsp: typed compile-time decorators, syntax and checks (#2203 step 2) by @andtii in #2321
  • sqlite: the driver calls the real SQLite through declare c, built with the package, and its Rust crate is gone by @andtii in #2347
  • crypto: AesGcm on the AES and carry-less multiply instructions, eight blocks at a time by @andtii in #2524
  • release: prepare 0.6.0 by @andtii in #2530
  • sema, vir: generic function types whose signature depends on their own type parameters by @andtii in #2505
  • crypto: ChaCha20 four blocks at a time in u32x4, Poly1305 in 64-bit limbs (#2392) by @andtii in #2525
  • http-server: a client going away stops a streamed body and aborts req.signal by @andtii in #2516
  • ci: the merge queue's lint-and-test job gets 100 minutes by @andtii in #2539
  • vir: a large static that is not text prints as hex by @andtii in #2541
  • sema, std: casts and conversions between overlapping object types as views (sigx) by @andtii in #2481
  • release: the gate before publishing leaves the WebAssembly goldens to the nightly, and gets 180 minutes by @andtii in #2546

Full Changelog: v0.5.0...v0.6.0