Skip to content

Releases

umay 0.3.1

Choose a tag to compare

@github-actions github-actions released this 17 Nov 13:41

Full Changelog: v0.3.0...v0.3.1

umay 0.3.0

Choose a tag to compare

@github-actions github-actions released this 17 Nov 12:12

Full Changelog: v0.2.0...v0.3.0

umay 0.2.0

Choose a tag to compare

@agnogad agnogad released this 17 Nov 07:52

Added

  • Cross-target compilation. --target selects the system to emit code for;
    without it the compiler builds for the host.
    • x86_64-unknown-linux-gnu (ELF, System V)
    • x86_64-apple-darwin (Mach-O, System V)
    • x86_64-pc-windows-gnu (COFF, Microsoft x64)
  • --emit-object-only on build: assemble and stop, linking nothing.
    Producing an object for another system was already possible but always reported
    as a failed build, because the link that followed could not succeed. A caller
    who only wants the object -- to link it elsewhere, or to inspect it -- is now
    a success. Both object paths are printed, and run --emit-object-only is a
    usage error rather than a build with nothing to run.
    • Regression test emitting_an_object_alone_succeeds_for_a_target_that_cannot_be_linked
      checks the exit status, both printed paths, that both files really are Mach-O,
      that no executable appeared, and that run refuses the combination.
    • --target was also missing from umay --help; both flags are documented now.
  • asm --emit-object-only prints the assembly and leaves the object in
    dist/. asm printed text and kept nothing, so a caller who wanted an object
    had to run build, which links, which a cross target cannot do. Without the
    flag asm still writes nothing -- a command that quietly starts leaving files
    behind is a worse surprise than one needing a flag.
    • The printed assembly is byte-for-byte what asm prints alone; the flag only
      appends the line naming the object.
    • Regression test asm_leaves_an_object_only_when_asked fails if the flag is
      ignored on asm (dist/main.o missing), and it also checks that the
      unflaggged run creates no dist/ at all.
  • --emit-object-only prints the command that links its output. Leaving the
    last step to the reader only helps if the instructions are right, and the flags
    differ per system (-no-pie, -mconsole, -lws2_32); a wrong one is a link
    error about something else. The compiler knows them, so it says them:
    built dist/both.o
    built dist/umay_runtime.o
      link it with: x86_64-w64-mingw32-gcc -o dist/both.exe dist/both.o dist/umay_runtime.o -mconsole -lws2_32
    
    Where the command cannot work on this host, it says that instead of suggesting
    it silently: (`cc` here links ELF, not Mach-O; this needs a linker that writes Mach-O).
    • Regression test the_printed_link_command_works_as_printed runs the printed
      line through a shell and runs the result. It fails if the command omits a
      runtime object, or writes the executable somewhere build would not (both of
      which happened while writing it: -o main rather than -o dist/main). The
      "links ELF, not Mach-O" wording is checked too, so the caveat cannot go back to
      blaming a missing program when the program is present and simply wrong-format.
  • An emitted Windows object links and runs outside this compiler. The flag's
    whole claim is that the objects are usable elsewhere, and only the end of that
    chain proves it. an_emitted_windows_object_links_and_runs_elsewhere links
    dist/main.o and dist/umay_runtime.o by hand with x86_64-w64-mingw32-gcc
    -- the command a user would type -- and runs the result under Wine, checking it
    prints its own output. Verified: 21 and socket ok, so sockets link and work
    through the hand-built path too.
    • Skips cleanly when MinGW or Wine is absent, rather than failing on a machine
      that cannot do the check.
    • Fails if either object is missing, which is the way this can actually break.
  • A target that cannot be linked here says so, and says where the object is.
    umay build --target x86_64-apple-darwin on Linux used to hand a Mach-O object
    to the host's linker and print its complaint about file formats. It now reports
    the formats involved, names the object it produced and leaves it on disk --
    which is the half of the job that did succeed.
    • The rule is the linker's format, not the host's: x86_64-w64-mingw32-gcc
      links COFF from Linux, and an earlier version of this check refused it.
    • Regression test an_unlinkable_target_reports_where_its_object_went fails if
      the rule goes back to comparing against the host's format.
  • A Windows object is checked for linkability too. Same idea as the macOS
    check, read from the real COFF symbol table: WinMain must be exported, every
    UMAY name one object leaves undefined must be defined by the other, and every
    remaining name must be one MinGW's CRT or Win32 actually exports.
    • Regression test a_windows_object_leaves_only_what_mingw_provides_undefined
      fails if a binding is misspelt (CreateThread written as CreateTread).
    • This replaced a guessed-prefix list in windows_references_match_their_definitions
      that could not tell a C library name from a typo.
  • A macOS object is checked for linkability without a Mac. The symbol table is
    read back from the assembled object: _main must be defined and global, every
    name the program leaves undefined must be one UMAY's runtime defines, and every
    C library name the runtime leaves undefined must be one macOS actually has.
    • Regression test a_macos_object_leaves_only_its_own_runtime_undefined fails if
      a binding is misspelt (write written as wrote), which is the fault class
      the check exists for.
  • umay_pipe works on Windows. It binds CreatePipe instead of POSIX
    pipe. Both ends are stored eight bytes wide on every system, because a POSIX
    descriptor is a small integer and a Windows handle is pointer-sized: the
    platform layer widens the narrow one, so the portable body that forks and reads
    a pipe has one shape to write against.
  • Threads work on Windows. thread_spawn hands one value to another thread
    and gets one answer back; how differs -- POSIX forks and reads a pipe, Windows
    starts a CreateThread and asks it for its exit value. umay_thread_spawn
    picks, so thread_spawn itself holds no system-specific code and its Send
    check is unchanged.
  • A generic value can have its address taken. &value as *const A is the only
    way to reach a value whose type is a parameter, and it is what the cross-thread
    hand-off needs. It was refused twice over: the cast had no rule, and the parser
    read &v as T as &(v as T).
  • A Windows --target x86_64-pc-windows-gnu build now runs. The standard
    library's system-specific names moved into stdlib/platform/, so a Windows
    object binds WinSock and CreateThread instead of POSIX accept and
    pthread_create, and links against ws2_32.
    • Verified end to end: umay build --target x86_64-pc-windows-gnu produces a
      real PE32+ executable for MS Windows (console), x86-64, and under Wine it
      prints the right answers, opens a socket and binds a port.
  • Only the prelude a program reaches is emitted. A four-line "hello" used to
    emit 160 function bodies -- the JSON parser, the HTTP helpers, the hash map --
    because the whole prelude is compiled with every program. Walking the call graph
    from main (and from every function whose address is taken, since an indirect
    call cannot be resolved statically) leaves a handful. compute builds in
    0.063 s instead of 0.092 s and its binary is 23 KB instead of 79 KB.
  • compiler/src/target.rs: one description of what differs between systems —
    symbol spelling, object format, calling convention, assembler and linker
    invocations, and which runtime platform layer to compile.
  • The Windows x64 calling convention in the backend: four argument registers
    in their own order, 32 bytes of shadow space, aggregates returned through a
    hidden pointer at any size, and %rsi/%rdi preserved across calls.
  • The runtime split into a portable body and per-system layers under
    runtime/platform/. On Windows, where fork does not exist, the checked
    fan-out runs on CreateThread; the Send guarantee is unchanged because the
    front end settles it before either call.
  • compiler/tests/cross_target.rs: asserts each target's assembly is accepted by
    a real assembler for its object format and yields the right object kind with
    _main defined, and that the Linux output did not change.

Added

  • GitHub Actions CI. Every push and pull request runs cargo test --locked
    and a release build. Tagged v* releases additionally build the checksummed
    artifact with scripts/release.sh and keep it as a workflow artifact.
  • A LICENSE file. Cargo.toml declared MIT OR Apache-2.0, but the texts
    were not in the repository or the release tarball. Both are now included.

Fixed

  • The differential generator stopped creating conflicting assignments.
    It emitted s.f = f(&mut s, ...), s.f = s.g + 1, and assignments to
    variables borrowed elsewhere in the same body. Those are either genuine
    conflicts or valid programs beyond the checker's field-wise borrow model, so
    long fuzz runs reported compiler errors that were really generator faults.
    The AST regression checks 2000 generated programs; CI still builds and runs
    30 of them end to end.
  • A parenthesized comparison was read as generic arguments. The lookahead
    accepted a ) inside <...>, so (p < q) > r became p<q>(...) and failed
    with E0330. It now tracks groups opened inside the argument list; a ) or
    ] that closes an outer group ends the scan. Differential seed 1573 found
    it, and parenthesized_comparison_is_not_generic_args pins the fix.
  • macOS C calls now use Mach-O's leading underscore. Foreign symbols were
    emitted bare, as ELF and Win64 require, so the Mach-O linker looked for
    malloc instead of _malloc and reported every libc function undefined.
    The assembler now prefixes foreign symbols only for Mach-O, and the object
    test rejects a bare C name. The CI smoke job also runs on macos-15-intel;
    an arm64 runner cannot link this x86_64 ...
Read more

umay 0.1.0

Choose a tag to compare

@agnogad agnogad released this 17 Nov 07:52

The first release: a language, a compiler, a standard library and a toolchain,
all working end to end. This version is the MVP that Phase 9 of the roadmap
defines — every phase from architecture to stabilization is done.

Language

  • Statically typed, natively compiled systems language with ownership and
    borrow checking and no garbage collector.
  • Modules from files (mod name;), with dependencies reachable as modules.
  • Generics with inline trait bounds, traits and impl blocks, Option/Result
    as ordinary enums, exhaustive match, ? error propagation.
  • Explicit, checked as casts, no implicit numeric conversion.

Compiler

  • Lexer and recursive-descent parser with error recovery and a nesting guard.
  • Semantic analysis: interning type context, three-pass checking so declaration
    order never matters, local inference, exhaustiveness checking.
  • HIR and MIR with a set of optimisations.
  • Custom x86_64 backend: instruction selection, linear-scan register allocation
    with honest handling of fixed registers, and an assembler printer. No LLVM,
    no Cranelift.
  • Ownership and borrow checking, drop elaboration.
  • Diagnostics as data: stable codes, one rendering for humans and one for
    machines, umay explain CODE for every code.

Standard library and runtime

  • Written in UMAY and compiled by the same backend (ADR 0010): strings, Vec,
    HashMap, JSON over counted bytes, TCP, files and processes, and a
    concurrency model with Send/Sync checked at the spawn boundary.

Toolchain

  • umay check | build | run | asm | ast | mir | fmt | lint | explain | doctor | new | clean | lock | metadata | version.
  • A language server that runs the compiler rather than a copy of it: live
    diagnostics, hover, go-to-definition (including across modules), completion,
    outline and formatting over JSON-RPC.
  • A deterministic formatter that rewrites the gaps between tokens and nothing
    else.
  • A content-addressed build cache keyed on the compiler's own binary, the source
    bytes and the module tree, so a stale artifact is impossible and an unchanged
    rebuild recompiles neither the program nor the runtime.
  • upm: a manifest (umay.toml), a lockfile (umay.lock), resolution of the
    whole dependency graph, and fetching from a registry named by UMAY_REGISTRY,
    with every fetched package pinned by SHA-256.

Known gaps

  • where clauses and let-else are not parsed; a program that uses them is a
    clear syntax error. Use inline bounds and match.
  • pub is accepted but there is no cross-module visibility enforcement yet.
  • Attributes are parsed and carried but have no semantics; an unused one is
    W0010.
  • Zig is not part of the build-time comparison in docs/measurements.md because
    it was not installed on the measurement machine; it is named, not dropped.