Documentation
Changelog
All notable changes to Eskiu are documented in this file.
The format is based on Keep a Changelog, and the project follows the compatibility rules in docs/lang/stability.md.
[0.17.0] - 2026-11-26
Details
Added
-
--dev, the profile to develop with: every--safecheck and the-Walllints, at the default-O0(an explicit--safe=LISTor-O<n>still applies). In a package,eskiuc build --dev,eskiuc test --devandeskiuc run --dev [-- ARGS]use it. Both compilers. -
eskiuc COMMAND --help(or-h) prints the usage of every command (new,add,build,run,test,fetch,fmt,repl,doctor) and does nothing else.fmt --helpopened a file named--help,new --helpcreated a package by that name, andbuild --helpandtest --helpneeded aneskiu.toml. -
--timeprints the wall time of each compile phase, the link and the total on stderr, asESKIU_TIME_PHASES=1did (which still works), now with the link and the total. -
An object cache, on by default (
--no-cache,ESKIU_NO_CACHE=1orESKIU_CACHE=0turn it off): a compile that writes an executable or object file reuses the object of an earlier compile with the same sources (every imported file, the standard library and packages included), compiler, target and flags, so only parsing and the link run again; the warnings are printed again. A program in a package (a directory with aneskiu.toml) keeps its objects in the package's.eskiu-cachedirectory, which ignores itself in git; any other file uses the platform's cache directory (~/Library/Caches/eskiuon macOS,~/.cache/eskiuon Linux,%LOCALAPPDATA%\eskiu\cacheon Windows);ESKIU_CACHE_DIRoverrides both. At most 1 GiB per directory (ESKIU_CACHE_SIZE), least recently used out first.--timeshows hits and misses (docs/dev/compile-speed.md). -
eskiuc testruns several tests at a time (-j N, default half the cores), selects tests by name (eskiuc test inv 'combat_*'), kills a test that runs past--timeout(default 60 s), and prints one JSON object per test with--json. A test ends aspass,fail,build-failed,timeoutorcrashed(by a signal); its output goes tobuild/tests/NAME.logand is shown when it fails. Exit code 0 when all pass, 1 when one does not, 2 for a wrong command line.
Changed
-
A redefinition (struct, union, enum, function, global, type alias, interface, extern) is followed by a note at the earlier declaration,
note: FILE:LINE:COL: 'Event' is first defined here, which names the module when that file is a stdlib module's ((in <json>)) or a dependency's ((in package 'ui')); in--diagnostics=jsonit is a note of the error. The errors that only follow from the clash (a member, an argument count or a struct literal written for the other declaration, a method on its result) are no longer reported, and a second function body with another signature is one error, not two. Both compilers. -
A syntax error at text a macro produced is followed by a note that names the macro, its module and definition, and what it expanded to:
const int CLOCK_MONO = 3;afterimport <time>;gave onlyExpected declaration, got INT_LIT; nownote: ... 'CLOCK_MONO' is a macro (from <time>, defined at .../time.esk:53) and expands to '6' here; rename yours or #undef it. Both compilers. -
A failed
--safecheck prints one line to stderr with the file, line and column of the operation and what went wrong (main.esk:12:20: index 7 out of bounds for length 4,integer overflow in '+',null pointer dereference,slice [2..9] out of bounds for length 5), flushes stdout and aborts. It used to trap with no message (SIGTRAP); the program now ends with SIGABRT (exit status 134 in a POSIX shell, 3 on Windows). A--freestandingbuild still traps without a message. The check itself is unchanged (a compare and a branch); the report is one shared function per object file. Both compilers print the same report. - Under
--safe, slicing a raw pointer or astring(p[lo..hi]) checks the pointer for null in the self-hosted compiler too, aseskiucdid. - Editors: the VS Code extension and the language server (Neovim, Helix, Zed, the
IntelliJ plugin) share one implementation (
editor/vscode/project.jsandfeatures.js), so they find the same program, report the same diagnostics and give the same answers. The server takes the extension's settings (compilerPath,compilerFlags,entryPoint,checkOnType,checkDelay) ininitializationOptionsorworkspace/didChangeConfiguration, waitscheckDelayafter an edit like the extension, and reports why a rename is refused. The IntelliJ plugin has settings for the entry point, checking while typing and the delay. - Editors: find references and rename cover every file of the program, from the declaring file or from any file that uses the symbol; a symbol declared outside the program's files (the stdlib, a package) is not renamed.
- Editors: saving a file checks the other open files again (what it declares changes what they see). Columns after non-ASCII text are right (the compiler counts bytes, editors UTF-16 units).
- A wrong command line exits with code 2 in every command, with one message format:
error: unknown option '--x' (see 'eskiuc --help'), orerror: CMD: ...for a command. An unknown compiler option, a bad option value (-O9,--safe=nope) and a missing input exited with 1. A failed compile, link or test is still 1 (docs/lang/build.md, "Exit codes"). The self-hosted driver does the same.
Fixed
-
A keyword used as a name (
in,fn,match, a type name) is reported asexpected a name, found keyword 'in'in every position: a for-in loop variable (for (in in xs)) and a lambda's parameter now say so too in both compilers, and the self-hosted compiler no longer saysExpected parameter name,Expected struct nameorExpected enum member namethere; it also putsIn struct 'S':before an error in a struct member, as the C++ compiler does. -
<args>: an option registered without dashes (ArgParser_option_int(&p, "w", "width", ...)) was never matched, silently. A name without dashes now means the same as with them: a one-letter one is the short option (-w), a longer one the long option (--width). -
A record or array over 16 bytes is copied in memory (memmove, memset or memcpy from a constant), never loaded and stored as one value. An assignment such as
*self = State{}of a record holding arrays of records made LLVM build thousands ofinsertvalues and its instruction selection then took a minute at -O2 for one file of a game (67.5 s to 2.4 s). Programs behave the same. - Editors check a file in its program: the root is the
entryPointsetting, else themainof the nearesteskiu.toml, else the top of the file's importers, when it reaches the file throughimport "...". A file that used a function declared in a file imported earlier by the program, not by itself, was checked from a sibling that imports it and showed a false "undefined function". Unsaved text is passed with--overlay, also for a file imported indirectly, and only the file's own diagnostics are shown; a syntax error in another file that stops the program is shown as a note instead of a clean file. --definition-at,--references-atand rename: a local with the name of a function or a global no longer takes the global's place (the function's declaration found nothing and its calls resolved to the local, so a rename changed the local). Both compilers.
Removed
- The browser playground: the site's playground page, the home page's link to it and the
playground/service. Running native code sent by anyone needed a sandboxed server of its own; the quickstart installs the compiler in a minute instead, and agents run code through the MCP'seskiu_run.
[0.16.3]
Details
Security
-
<eventloop>on Windows and WebAssembly grows its poll set as descriptors are registered. It was a fixed table of 4096 (Windows) or 1024 (WebAssembly) entries, and a registration past its end wrote out of bounds. -
fetch_last_error()keeps one message per thread. Every failed fetch wrote one global buffer, so two threads failing at once could corrupt the heap. -
The HTTP/1.1 servers and
http_recvanswer 400 to a head overHTTP_SERVE_MAX_HEAD(64 KiB) however it is split into reads. The limit was checked only while the end of the head was still missing, so a longer head could get through. -
fs_temp_fileandfs_temp_dirreject a prefix with a/or\(EINVAL). The prefix was joined to the temporary directory as given, so"../x-"created the file or directory outside it. -
The preprocessor stops a file whose macros expand to more than 16 MiB of replacement text with an error. A duplicating macro nested a few dozen times took time and memory exponential in its size. Both compilers.
-
Lowering a generic async function no longer builds and sorts the list of all 2^n subsets of its n type parameters to write an awaited type in terms of them (out of memory from about 28 parameters, undefined from 32). The subsets are walked in the same order, at most 65536 of them. Both compilers.
-
eskiu.tomlrejects a control character (tab, newline, ...) in a dependency'sgit,revorpath, andeskiu.lockis never written with one. A tab or newline in a path dependency's name went into the tab- and newline-separated lock as is and could add or replace an entry for another package. -
A web build copies a package's
[web]assets only from inside the package: an asset that is a symbolic link, or lies under one, is skipped with a warning, and so is a symbolic link inside an asset directory. A dependency could list a link to any file the user can read and have it copied into the published output. The self-hosted driver also rejects an asset spelled with..or as an absolute path, aseskiu.tomldoes. Both compilers. -
A
[native.NAME]archive whoselibdirectory is a symbolic link, or holds one that leads out of the archive, is refused, when it is unpacked and when a build uses the cached copy. The SHA-256 check covers the archive's bytes, not what a link in it reaches, so such an archive made the build link from (and on macOS rewrite and re-sign libraries in) a directory outside it. The self-hosted driver no longer follows a link when it rewrites a.dylib. Both compilers. -
The playground runs a program's output through a cap as it is read, kills the program's whole process tree when it ends or times out (and any process that left it), and runs nothing unless its container has no network (
--network none, the API on a Unix socket; seeplayground/README.md). Output was buffered whole before the cap, a forked process outlived its request, and programs could reach the network. -
The VS Code extension honors Workspace Trust: in a workspace you have not trusted it ignores the workspace's
eskiu.compilerPath,eskiu.compilerFlagsandeskiu.entryPointand does not run abuild/eskiucfrom it. The standalone language server searches the workspace for a compiler only when its client says it is trusted, and the IntelliJ plugin only for trusted projects. Opening a repository could run a program it shipped. -
CI: every workflow's token is read-only except the job that creates the release, actions are pinned by commit, and each marketplace token reaches only the step that publishes with it.
[0.16.2]
Details
Changed
-
A struct, union or array parameter over 16 bytes passes between Eskiu functions as a pointer to a copy the caller makes, on every target and every call path (direct, method, generic, interface, function value, closure, async). By-value semantics are unchanged. LLVM no longer spreads such a record into one argument per field at each call, so a call that takes a large struct literal is much smaller: a
Row(Style{padding: 8}) {}element of the ui package costs about 105 bytes of WebAssembly instead of 468. A struct literal starts as a copy of its type's constant default value and stores only the fields it gives. Extern C functions,exportentries and C callbacks keep the C ABI. Both compilers. Objects built by 0.16.1 do not link with ones built by 0.16.2: rebuild everything. -
Warnings are reported in every file of the program's own, not only in the root file: a file imported from under the program's directory (the nearest one above the root file with an
eskiu.toml, else the root file's) is linted like the root file. The standard library and dependencies are still libraries and are not linted. A package's modules imported from itsmain.esk, and a ui app's sources (which the ui tool's generated entry imports), now get-Wformat,-Wdeprecatedand the-Wallchecks. Both compilers.
Fixed
- The self-hosted compiler names the location in "cannot assign to read-only location 'b'", as eskiuc does.
-Wallno longer reports a variadic function's...as an unused parameter. Both compilers.
[0.16.1]
Details
Added
*T constandconst *T const, the star-first spellings of a const pointer (T* const,const T* const): the same type, in both compilers. The docs and the Book write pointers star first throughout (*T,const *T,*T const), and the spec says how to make a device's registers volatile without volatile fields.-Wformatchecks the calls of a printf-style function the program declares: a variadic function or extern whose last fixed parameter isstring fmt(such as ui'stextf), as it checks printf's. Both compilers.
Fixed
- WebAssembly: a program that throws or catches links with newer emsdks, which no longer link
in C++ mode by default when the driver is emcc (
__cxa_begin_catchand__cxa_end_catchwere undefined): eskiuc passes-sDEFAULT_TO_CXX=1with exceptions. Both compilers. - A
--targetbuild for WebAssembly (emscripten), Android, iOS or visionOS whose toolchain is missing says so (emcc was not found: install Emscripten ...) instead of falling back to the host's cc and its "unrecognized option" errors. <fetch>: HTTPS loads OpenSSL 4 (libssl-4-x64.dll,libssl.so.4,libssl.4.dyliband Homebrew'sopenssl@4) when OpenSSL 3 is not there. MSYS2 ships OpenSSL 4.1, so on Windows anhttps://request failed withFETCH_ERR_NO_TLS.- Self-hosted compiler: a member access through a const pointer (
P* const q, thenq.v) emitted invalid IR, and reassigning a localint* constwas not an error.
[0.16.0]
Details
Added
-
visionOS targets:
--target arm64-apple-xros1.0(and-simulator) links throughxcrun -sdk xros/xrsimulatorwith no$CC, and predefinesTARGET_OS_IPHONEandTARGET_OS_VISION, in both compilers (docs/dev/cross-compile.md). -
Editors: go to definition, find references, rename and hover work on a type name wherever a type is written (parameter, return, local and field types,
*T,?*T,T[],T[N], generic arguments, casts,sizeof(T), struct literals, constraints, alias targets) and at the type's declaration, for structs, unions, enums, interfaces and aliases. Hover shows the declaration (struct Point). Both compilers. -
<fetch>:FetchOptions.body_sent, when set, points at a counter the request stores the body's bytes sent so far in as they go, for upload progress (a recording to a server, a large POST).
Changed
- The compiler's sources (C++ and the self-hosted compiler) are split into files of about
600 lines by topic, and the stdlib's larger modules keep their parts in private
directories (
stdlib/_fetch/,stdlib/_json/, ...) that tools skip. No behavior change.
Fixed
- Editors (VS Code, IntelliJ, any LSP client): a file that is a part of a module
(
import "part.esk";) is checked in its module, so it sees the types and names the module declares before it. Diagnostics, hover, go to definition, references, completion and signature help work in parts, also nested ones and parts in other directories (editor/vscode/flatten.js).
[0.15.1]
Details
Added
install.sh --with-ui(ESKIU_WITH_UI=1forinstall.ps1) also installs theuitool from eskiu-packages/ui's release, checked against its SHA256SUMS;install.ps1keepsui.exeacross an update ofeskiuc.- The site has a page for coding agents (
agents.html: install,--diagnostics=json,ui agent web --json,ui test, theghcr.io/eskiu-lang/agentimage and the MCP server) and anllms.txt. ESKIU_SYSTEM_LIBS=SDL3,...links the system's copy of a library a package ships in[native.NAME]instead of downloading the archive (*names every one). The build looks forlibNAMEinLIBRARY_PATH,pkg-config's directory for it and the usual library directories. A build for this machine whose download fails (offline) links the system's library when there is one, with a warning, instead of stopping. Both compilers.- A package can list files a web build needs next to its page:
[web] assets = ["web/gpu-naga.wasm"]in itseskiu.toml. Awasm32-unknown-emscriptenbuild in that package, or in one that depends on it, copies them into the output's directory. Older compilers reject the table, so a package that adds it needs 0.15.1.eskiu.tomlarrays of strings may span lines. eskiuc build FILE.eskbuilds that file of the package (an example, a tool) with the package's dependencies, tobuild/FILE, in place of the package's main.
Changed
eskiuc doctorreports SDL3 the way a build gets it: the[native.SDL3]archive of a package (the current one or one already fetched), cached or still to download, else the system'slibSDL3, with what to do when there is neither. It used to look for SDL3's C headers, which no build uses.- The LLVM code generator marks scalar parameters and results of Eskiu functions
noundef, and a functionnounwindwhen nothing it does can throw. Code at-O2is unchanged on the test corpus;-O0objects are about 4% smaller.
Fixed
- Compiling a file of a package directly (
eskiuc src/main.esk, whatuiruns) usedeskiu.lockas it was after a dependency was edited ineskiu.toml(switched from git to a localpath, or to another rev), so the old source was built untileskiuc fetch. It now resolves the dependencies again when the lock does not match the manifest, aseskiuc builddoes. - A program of several input files failed to parse when an import of a later file used a
type or a generic that an earlier file's imports declared:
eskiuc a.esk b.eskreportedExpected ';'atreturn Ok<GpuSurface, string>(s);. Whateskiuc build file.eskran before (the package's main and the file, as one program) hit it in the gpu package. - A generic function instantiated while compiling another function saw that function's
locals, so
List_pushorList_freefailed to compile in a function with a local namedfree("Call target is not a function", with no location). Errors at a call in the code generator now give the file, line and column, and say when a variable hides a function. --targetfor the other macOS architecture on a Mac (x86_64-apple-macosx11.0from Apple silicon, or arm64 from an Intel Mac) linked the object as the host's architecture and failed; the driver now links it withcc -target(or$CC -targetwhenCCis set and does not select a target itself).- An output in a directory that did not exist yet (
-o build/app.html,-c -o,--emit-header) failed in the C driver, emcc or the file write; the compiler now creates that directory first, in both compilers.
[0.15.0]
Details
Added
--diagnostics=jsonprints errors and warnings on stderr as JSON lines, one object per diagnostic: severity, a stableidper kind (undefined-variable), message, file, line, column, the range of the token there, the warning's flag and "did you mean" hints as their own fields, and the notes that go with it. It carries the same diagnostics as the text form, which stays the default. Both compilers print the same JSON; the format and the id list are in docs/dev/diagnostics.md.src_file(),src_line()andsrc_col()as a parameter's default value give the position of each call that leaves the argument out, so a library can record where it is called from (void Text(string s, int line = src_line())). Each is a constant at the call, with no cost in code that does not use them.HttpLimits.max_bodysets the largest request body the HTTP/1.1 and HTTP/2 servers accept (defaultHTTP_SERVE_MAX_BODY, 1 MiB; a body past it is answered 413), so a server taking uploads no longer needs its own copy of the stdlib.- A shared library (
.so,.dylib,.dll) withexportfunctions now offers only those: the rest of the program and the standard library it uses are hidden, with no linker version script or.deffile. log_set_rotation(max_bytes, keep)in<log>rotates the log file by size, keepingkeepold files (app.log.1the newest).exportbefore a function definition makes it a C entry point: C, Rust or any language that calls C calls it by its name with the target's C calling convention, structs and unions by value included, while Eskiu code calls it as before.--emit-header FILEwrites the C declarations of a program's exported functions and of the types they reach (records with their bitfields and packing), soeskiuc lib.esk -o liblib.aandeskiuc lib.esk --emit-header lib.hgive C a library and its header. Both compilers, every back end (LLVM, and the EIR C and ARM64 ones).- Prebuilt binaries for Intel Macs (
eskiuc-macos-x86_64.tar.gz), whichinstall.shpicks on an x86_64 Mac. - On Windows,
install.ps1also installs llvm-mingw (checked against a pinned SHA-256) into the install'stoolchainfolder when no C driver is on PATH, so programs link with no separate toolchain install (ESKIU_TOOLCHAIN=1forces it,0skips it).eskiucfinds a toolchain there when none is on PATH, and with llvm-mingw it links exceptions against libc++ instead of libstdc++. eskiuc doctorlists what the machine has for each kind of build (the C driver, git, curl, tar, OpenSSL, SDL3, Emscripten, the Android NDK, the iOS SDK, devkitARM) and what to install for what is missing.-ffp-contract=fastlets the compiler fuse a multiply and an add into one fused multiply-add (rounded once); without it each floating-point operation rounds, so results stay the same on every target. Both compilers.-fstrict-aliasinggives the optimizer C's aliasing rule (scalar type-based alias information): a store of one scalar type is assumed not to change a value of another. Unions, bytes and a variable read through a pointer cast keep aliasing everything. Off by default; both compilers.eskiuc fmt --width Nalso breaks code lines longer than N after the commas of their outermost bracketed list; without it the formatter's output does not change.<json>:json_parse_doc(src)parses into aJsonDocwhose nodes and strings live in one arena, about three times faster thanjson_parseplusJsonValue_free; the document is read-only andJsonDoc_freefrees it.- The self-hosted compiler links a package's
[native.NAME]libraries, fetching and checking them as the C++ compiler does. - The self-hosted compiler has the EIR backends:
eskiuc-esk --emit-cand--emit-asmwrite the same C and ARM64 assembly aseskiuc, andeskiuc-esk --backend=eirbuilds programs through them (assembly on arm64 outside Windows, C with any$CCelsewhere), without clang or LLVM. --backend=eirat-O0on arm64 assembles its output itself: an integrated ARM64 assembler writes the Mach-O or ELF object, with no external assembler (LangArena's 50 benchmarks build in 2.0 s instead of 4.6 s).ESKIU_EIR_EXTERNAL_AS=1uses the system C driver instead.--emit-asmrejects the options its assembly cannot honor (-O1and up,--safe,--mcpu, ...), as--backend=eirdoes on that path; they were ignored.tests/index.shprints the test catalog from each test's first comment, andrun.shfails on a test without one.
Changed
- The compiler is faster: the
uikit gallery's-O0object (about 47,000 lines of IR, nearly all of it theuilibrary and the stdlib) builds in 0.29 s instead of 0.47 s, and type-checks in 0.06 s instead of 0.19 s. The parser no longer throws an exception to back out of a statement it first tried as a declaration or of a comparison it first tried as a generic call, a program withoutasyncis type-checked once instead of twice, and AST node kinds are compared instead ofdynamic_cast. A compiler built with the plaincmake -S . -B buildis now a Release build (it was unoptimized, and three times slower).ESKIU_TIME_PHASES=1prints the time of each phase; docs/dev/compile-speed.md has the breakdown and how to profile. <regex>searches with a lazily built DFA for where the match ends and one over the reversed pattern for where it starts, and finds the groups over the match only, with a bounded backtracker (the Pike VM when the match is long): two to three times faster on log-like text and about 12% faster on short, dense matches with groups (a{{(.*?)}}template), with the same results (checked against the Pike VM alone by a test and the regex fuzz target). A pattern with an assertion that can repeat in a loop without consuming ((?:^|a)*) runs on the Pike VM alone.- TLS (
<tls>servers and<fetch>'s HTTPS client) asks for TLS 1.2 or newer and turns off compression and renegotiation, whatever the OpenSSL defaults; a server whose key does not match its certificate is refused when the context is made. The client loads OpenSSL and makes its shared contexts once, also from several threads at once. - The kernel demo's heap is a first-fit allocator, so
freegives memory back. --backend=eirtakes-Oon every target: at-O1and up it writes C and compiles it at that level (always with-fno-strict-aliasing), arm64 included, and only an-O0build on arm64 goes through the ARM64 assembly, which has no levels. Every run test on the C list behaves the same at-O2(EIR_OPT=2 tests/eir/check.sh, in CI on Linux).- Building against an LLVM without RTTI (the llvm-project release tarballs) stops at
configure time with an explanation instead of failing to link. LLVM's headers are
included as system headers, and the compiler's own sources build without warnings (CI
builds with
-DESKIU_WERROR=ON). fetch_basicandfetch_asyncuse numeric addresses only; the host name cases moved tofetch_dns, whichESKIU_RESOLVER_TESTS=0skips withdns_connect.- CI runs the Windows build on pull requests and on
main, the EIR C backend on Linux, and fails when the editor modes exceed their time budget; a release fails when its Windows build does.
Fixed
- The playground's rate limit trusts
X-Forwarded-Foronly from the proxies inTRUSTED_PROXIESand takes the first untrusted hop from the right, so a client cannot reset its limit with a forged header (pull request #1, from MarioACo). - Windows paths: an import of
C:/...orC:\...is absolute (it was joined to the importing file's directory), and a file path written with backslashes keeps its directory for its relative imports. Both compilers. - A
?:with anullarm inside a generic function (key == null ? null : copy(key)) no longer fails with an invalid phi: the literal is a pointer even where the checker records no type for it. - The EIR builders (C++ and self-hosted) treated a prototype as an
externuntil its definition was built: a call written before the definition passed a closure argument as a C function pointer (the C++ compiler rejected the program, the self-hosted one built a binary that crashed), which broke building the self-hosted compiler through EIR. A prototype of a function the program defines is now an ordinary function. - The self-hosted EIR builder printed its errors and went on, exiting 0; it now stops with status 1 as the C++ one does.
- A thread started under the EIR backends kept 8 bytes until it was joined (a thread that
detaches itself leaked them): the handle is now the
pthread_titself, as with LLVM. <fetch>'s host lookup thread detaches itself instead of detaching through the handlethread_createreturns, which is opaque (a crash with the EIR backends on Linux).- The kernel demo's allocator masks IRQs around its free list: a preempted task could corrupt it.
[0.14.1]
Details
Added
- Native EIR backends that skip LLVM's code generator:
--emit-asm(ARM64),--emit-c(C99),--emit-obj, and--backend=eir, which builds through the normal driver (#pragma link, implied libraries,-c,.a,eskiuc run). Exceptions, threads andexception_textrun on a small C runtime. Options that only change LLVM's output (-O,--safe,--freestanding, ...) are errors under it. Seedocs/dev/eir-backends.md. tests/eir/check.shruns the run tests through a backend (astests/run.shdoes, C companions included) and fails when a test that passed stops passing; CI runs it on macOS.- The self-hosted compiler's
--test-eiris a port of the C++ EIR builder and prints the same text for every run test;tests/selfhost/eir_parity.shgates it in CI. - The EIR backends pass structs and unions by value to and from C functions and hand C a
function taking or returning one (or a
va_list) through a thunk with the C signature. <csv>:CsvReaderreads a CSV one row at a time with no String per field (CsvReader_init,CsvReader_next,CsvReader_field, ...): each row's fields are NUL-terminated in a buffer the reader reuses.csv_parseis now built on it, so both read every input the same way (checked against the previouscsv_parseover 300000 random inputs). Summing three columns of a 100000-row CSV takes half the time it does throughcsv_parse.String_append_bytes(s, p, n)(s.append_bytes(p, n)) appendsnbytes from a pointer, NULs included; it was only available as an internal function.<regex>:Regex_search_at(&re, text, len, start, &m)searcheslenbytes from offsetstart, andRegex_iter/RegexIter_nextgo through every match as Go'sFindAlldoes (after an empty match the search moves on one code point).
Fixed
- A field of a packed struct (
packed,#pragma pack(N), or a struct inside one) was read and written with its type's alignment although its address may not have it, which LLVM may turn into wider or paired accesses (and which traps on 32-bit ARM). Each such access now carries the alignment its address is known to have (1 underpacked, at most N underpack(N)), in both compilers. -O2and-O3now run LLVM's loop and SLP vectorizers, as clang does; the pipeline had them off. CLBG n-body runs in about half the time.- A C math
externwith the C signature (double sqrt(double),float powf(float, float), ...) is declared as reading and writing no memory, so the optimizer can hoist, merge and inline it (sqrtbecomes an instruction):fabs/floor/fmin/... on every target, the functions that may seterrnoonly on Darwin, where clang defaults to-fno-math-errnoand libm never sets it. Not under--freestanding. <json>:JsonValue_pushwalked the whole array on each call, so building an array of n elements took O(n^2) time (80000 elements: 4.3 s, now under 0.1 s).JsonValue_lenand a loop overJsonValue_at(v, i)are linear too.<json>stringifies numbers with its own shortest round-trip algorithm (Ryu) instead ofprintfandstrtod, and copies plain strings in place: building and stringifying a document is about 2.5 times faster (LangArena Json::Generate 2.2 s to 0.9 s). The text is byte for byte the same as before (checked over 82 million values).json_parsereads a number of up to 15 significant digits with a decimal exponent within 10^±22 straight from the text with one exact multiplication or division (the doublestrtodgives), and the rest withstrtodin place, instead of copying each number into a String foratof; plain runs inside strings are copied at once. Parsing a document of numbers is about 1.4 times faster.<map>:Map<V>keeps each key's hash, so a lookup compares hashes before strings and a removal or a growth no longer rehashes the keys it moves; lookups and removals are up to twice as fast. The iteration order is unchanged.<base64>encodes about 3.6 times and decodes about 4.7 times faster (500 KB buffers: encode 1.53 s to 0.42 s, decode 1.50 s to 0.32 s, ahead of Go'sencoding/base64). Each character is looked up in tables that give its bits already in place, and word-aligned buffers are read and written a word at a time. Results and errors are the same as before for every input.- EIR: a cast between
floatanddouble, or between a pointer and an integer, now emits its conversion; a closure call converts its arguments to the parameter types; a top-level function used as a closure goes through a__fnptr_thunk; an extern's function parameter receives a C function pointer;continueinside aswitchno longer crashes the compiler; a repeated prototype no longer defines the function twice. --test-eiroutput is deterministic: records are laid out in declaration order and as the program first names them (no longer every generic instance the checker saw, in hash order), and a vtable global prints its functions instead of an uninitialized operand. The async lowering names its temporaries in the same order whichever C++ compiler builteskiuc.- EVM: integer
/and%by zero stop the program instead of yielding 0, andptrtoint,inttoptr,fptruncandfpextare executed. - EIR integers follow C everywhere: the builder makes the promotions and usual arithmetic conversions explicit and every backend holds a value normalized to its type; constant expressions fold with the type checker's rules.
- EIR lowering now covers
alloc_with, struct and union layout as C lays it out (bitfields, unnamed bitfields,#pragma pack), generic enum instances, field defaults,for-in, labeledbreak/continue,deferscoping,errdeferon?,dbg, operators and locals inside generic instances, and evaluates an assignment's target once and first. <regex>had no way to search from an offset: searchingtext + offranstrlenon every call, so finding all matches was quadratic, and it lost the text before the cut, so^,\band\Bwere wrong there.Regex_search_atkeeps that text as context and reports offsets into the whole text.<regex>searches are much faster: the search skips text where no match can start (by the bytes a match can begin with, and by a byte every match must contain), its scratch memory is allocated once per compiled regex instead of on every call (a search running while another thread holds it allocates its own, so aRegexcan still be searched from several threads at once), and threads that cannot read the next byte are dropped. A log-scanning benchmark went from 25.2 s to 1.8 s and a template one from 7.4 s to 3.1 s.
[0.14.0]
Details
Added
catch (_)catches any exception without binding a variable; it is the last catch of atry.exception_text(), inside any catch, describes what was caught as the uncaught-exception report does (int 7,string "boom"). The text belongs to its catch block, also across anawaitin anasyncfunction, and a function of the program's own namedexception_texthides the builtin.[native.NAME]packages for iOS (ios-arm64,ios-arm64-simulator,ios-x86_64-simulator) and Android (android-arm64,android-x86_64), and for any--targetbuild: the archive for the target's platform is fetched and linked as for the host.
Fixed
--target x86_64-w64-mingw32passed structs to C functions with the System V convention instead of the Windows x64 one, so a call into a DLL could crash. Every--targetis now normalized first (x86_64-w64-windows-gnu).- A build for iOS or Android no longer embeds an rpath to this machine's package cache.
[0.13.0]
Details
The first public release. Code that compiles with 0.13.0 keeps compiling in every 0.13.x (stability.md).
The language
- C syntax and C integer rules: promotions, the usual arithmetic conversions,
boolas!= 0, element-counting pointer subtraction,sizeofof a type or an expression, octal, hex and binary literals with_digit separators. - Run-time integer behavior is defined at every optimization level: overflow wraps, a
shift count is taken modulo the width, a zero divisor traps,
MIN / -1wraps, and float to integer saturates. - Structs with methods and dot syntax, field defaults, unions, bitfields and packed structs laid out as the target's C compiler lays them out; enums whose members are constant expressions; type aliases.
- Generics with inferred type arguments and interface bounds (
<T: Ord>), generic structs with inline methods, and dot calls on generic instances (list.push(8)). - Trailing blocks: a call statement may end in a block, passed as its last argument, so
Column(style) { ... }isColumn(style, void() { ... }). - Structural interfaces as first-class values, sum types with exhaustive
match, closures with escape analysis, operator overloading, labeledbreak/continue,?:,do/while,staticlocals and multidimensional arrays. - Default parameter values (
void connect(string host, int port = 443), struct literals of constants included:V3 up = V3{0.0, 1.0, 0.0}) anddbg(e), which prints an expression's source and value to stderr and yields the value. deprecated("use X")on functions, and "did you mean" hints on misspelled names.- Scripts: a file may have statements at the top level, which run in order as an implicit
mainwith the arguments inargcandargv; its top-level variables are globals the functions can see.
Memory and safety
- No garbage collector:
alloc<T>(zeroed memory) andfree, and explicit allocators in<alloc>(bump, arena, pool, first fit) and<sysheap>. deferanderrdefer, slices (T[]), checked nullable pointers (?*T) with flow-sensitive narrowing,must_use,constreceivers, and an opt-in--safebuild that traps on out-of-bounds indexes, signed overflow and null dereferences, each category on its own with--safe=bounds,overflow,null.- Locals,
alloc_withblocks and sum-type values start at zero. - Warnings on by default for common mistakes (string comparison by address, printf
formats, the address of a packed member, dangling local addresses, huge locals, an
ignored
Result, anawaitwhile a mutex is locked), with-Wall,-Wextra,-Werrorand-w.
Concurrency and errors
async/awaiton any expression and in every control-flow construct, with cancellation,spawn,select2/join2, timers and channels over an event loop.- Threads (
thread_create/thread_join) and atomics (<atomic>: 32-bit, 64-bit and pointer cells, fetch operations, relaxed forms, fences). try/catch/finally/throw; an uncaught exception prints its type and value.Result,OptionandEitherwith the?operator.Resultwith?is the way to report an expected failure, and?passes an error up through functions whoseResulttypes differ only in the success type;throwis for unrecoverable errors (spec §6.10).
C interop and targets
externfunctions and variables, with structs and unions passed and returned by value in the target's C ABI (AArch64, x86-64 SysV and Windows, 32-bit ARM, 32-bit x86, wasm32), callbacks (also ones taking a Cva_list),va_listand variadic functions.<ctypes>:size_t,ssize_tandc_longforexterndeclarations, passed at the target's C width (32 bits on 32-bit targets), so one declaration is right everywhere.- Inline assembly with outputs, inputs and clobbers;
volatileaccesses;intrinsic. #pragma linkand implied libraries, so no-lm,-lc++or-lpthreadflags.- macOS, Linux and Windows hosts; cross-compilation with
--target(including bare-metalnonetriples and--freestanding);-O0to-O3. - WebAssembly:
wasm32-unknown-emscripten(linked byemcc) and WASI. The standard library and async runtime run there (an event loop overpoll()), and exceptions work on emscripten through its runtime. - Android (
aarch64-linux-android24, armv7, x86_64; linked with the NDK's clang) and iOS (devices and the simulator; linked throughxcrun). - Static (
.a,.lib) and shared (.so,.dylib,.dll) library outputs, for apps that link Eskiu code from Xcode, Gradle or emscripten builds. --subsystem=windowslinks a Windows program that opens its own window without a console.
Standard library
- Collections (
List,Map,HashMap,Set), strings and bytes, math, sorting, random numbers, regex (RE2 syntax over UTF-8), time and calendars, UUIDs. <sort>is libc++'sstd::sort,std::partial_sortandstd::nth_element(sort<T>,sort_partial<T>,sort_nth<T>), so code ported from C++ orders tied elements the same way;List_reserve,List_resizeandList_copy_fromin<list>.- Files, directories, globbing and temp files (
<fs>), child processes (<process>), environment and.envfiles, DNS, sockets, URLs. - JSON, CSV, base64, hashes (SHA-256, SHA-1, MD5, HMAC-SHA256), multipart forms.
- An HTTP client (
<fetch>, with HTTPS through the system OpenSSL), and HTTP/1.1, HTTP/2 and TLS servers, blocking and async. - Command-line helpers: argument parsing (
<args>), terminal colors (<term>), logging (<log>) and console input. _resultforms of the calls that report a status code ornull, so?works with the standard library:fetch_result,fetch_with_result,fs_read_text_result,fs_write_text_result,fs_append_text_result,json_parse_result,process_run_result,sh_result.<libc>declares the common C library for code that wants it directly.
Tools
eskiuc run file.eskand#!/usr/bin/env -S eskiuc runshebangs.eskiuc repl, an interactive session over the LLVM JIT (macOS and Linux).- A package manager:
eskiuc new,add,build,run,testandfetch, with git and path dependencies pinned ineskiu.lock. - A package can ship the native libraries it binds:
[native.NAME]ineskiu.tomllists a prebuilt archive per platform with its SHA-256, which the first build that links the library downloads and checks into~/.eskiu/native; the build links against it with no-L. eskiuc fmt: one statement per line, consistent spacing and indentation (type arguments asList<int>), without changing a program's tokens.- Editor support for VS Code-based editors and JetBrains IDEs: errors as you type, completion, hover, signature help, go to definition, find references, rename, outline, formatting and quick fixes.
Self-hosting
- The compiler is also written in Eskiu (
selfhost/), built aseskiuc-esk, and checked against the C++ compiler over the whole test corpus and against itself through a three-stage bootstrap. Both compilers give the same diagnostics and warnings.
Known issues
eskiuc replis not available on Windows: the JIT does not register the unwind tables Windows exceptions need.eskiuc runworks there.
eskiu