Skip to content

Maylang v0.15.0 — Fern

Choose a tag to compare

@github-actions github-actions released this 01 Nov 10:05
· 127 commits to main since this release
97cc806

Released 2026-11-01 UTC. Maylang narrows to one host and target, Linux
x86-64, and its values become fat: 16 bytes with a separate type word, so
Int is a full signed 64-bit integer and Floats are unboxed. Generated code
is much faster. Maps hash every key type, struct fields are cached per site,
hot locals and temporaries stay in registers (Floats in XMM registers), and
type proofs remove checks. Field caching alone makes n-body 11× faster,
and mayc compiles itself in under half the time it took in 0.14 (median
6.3 s instead of 15.4 s over five runs on the same machine). Bitwise
operators arrive, and the UI adapter and the VS Code extension get
sanitizer and extension-host tests.

Behavior changes

  • Only --target x86_64-linux is supported. The other targets, the core
    runtime, NodeOS, MayOS, the browser and stdlib/ml are frozen in
    frozen/, and selecting them fails with an explanation. The clang-llvm
    target and --emit-llvm are removed.
  • Int reaches ±2^63; overflow faults only beyond that. addr of a Float
    is a type fault, a List<Any> uses 16 bytes per element, and --values
    fails with an explanation.
  • &, |, ^, ~, << and >> work on 64-bit integers; a shift result
    that does not fit raises integer overflow instead of wrapping.
  • A function defined twice across the runtime and library sidecars is a
    compile error. The prelude's repeat and substring are removed;
    native.may provides them, as before.
  • The VS Code extension restarts the language server when
    maylang.serverPath or maylang.strict changes.

Remaining limits

  • The compiler host and the only target are Linux x86-64; release bundles are
    Linux x86-64 only.
  • Long-running, allocation-heavy programs can still crash the full runtime's
    collector (#2).
  • Dynamic code is still well behind compiled languages; records are maps
    with per-site caches, and the remaining work is tracked in
    #101.
  • The compiler frontend uses mutable global state and is not re-entrant
    (#49).

Scope

  • Breaking: freeze the platform experiments and the experimental ML
    library while Maylang focuses on Linux x86-64
    (plan,
    #102). platform/maybrowser,
    platform/mayos, stdlib/ml (import "ml/..." no longer resolves), its
    reference pages, examples/ml_xor.may and the artificial ecosystem
    simulation, which used stdlib/ml, move to frozen/, where they are kept
    but not built, tested or maintained. make test-browser, the doctor's
    browser profile and the maybrowser.yml workflow are removed.
  • Breaking: mayc targets only x86_64-linux, with the full runtime and
    --raw (--runtime none). --target x86_64-nodeos, arm64-linux,
    riscv64-linux, arm64-macos and x86_64-windows and --runtime core
    fail with target ... is frozen / runtime core is frozen. The ARM64 and
    RISC-V backends and their RAW lowering (raw.may, raw_fat.may,
    raw_float.may), the Mach-O, PE and NXF formats, the NodeOS syscall gate
    and personality (runtime/nodeos.may), the core runtime
    (runtime/fat_core.may, runtime/fat_corelib.may, the core API page),
    their harnesses (core_runtime.py, portable_values.py,
    native_targets.py, nodeos.py) and target documentation move to
    frozen/. The remaining harnesses test x86-64 Linux only. Release bundles
    no longer contain runtime/fat_core.may. The compiler is 2.67 MB instead
    of 3.19 MB, and its x86-64 Linux output is byte-identical
    (#102).
  • Stop running cross-target emulation (core-emulation) and the Windows and
    macOS real-loader workflow (native-targets.yml) in CI, and freeze the
    WSL launcher dist/install.ps1; releases no longer publish it. Release
    bundles describe themselves as Linux x86-64 only
    (#102).

Compiler

  • Reject a second definition of a function in the runtime and library
    sidecars (runtime/fat.may, runtime/fat_linux.may, prelude.may,
    native.may, runtime/math.may) with an error naming both locations.
    The later definition used to replace the earlier one silently for every
    caller. User code may still shadow library functions. The prelude's
    repeat and substring, which native.may had always replaced, are
    removed (#114).
  • Native-word functions call extern functions with Int, UInt, Ptr
    and Bool signatures directly again, passing machine words to C instead
    of going through the extern's fat entry, as docs/guide/STRICT.md
    describes. UInt range faults keep the fat entry's messages
    (#94).
  • Breaking: remove the experimental clang-llvm target and
    --emit-llvm. mayc is its own toolchain and writes every executable
    itself; both now fail with an explanation. make test-llvm, the doctor's
    llvm profile, the harnesses' --llvm options and the runtimes' LLVM
    accommodations (a libc-supplied environment pointer and 256-byte handler
    slots) are gone, and the compiler's code is 290 KB smaller.
  • Breaking: compile every program with a runtime using fat values, 16
    bytes with a separate type word, instead of 3-bit tagged words, on every
    target (design: docs/design/FAT_VALUES.md).
    Int is signed 64-bit: literals and arithmetic reach ±2^63 and
    overflow faults only beyond that, values between 2^60 and 2^63 no longer
    raise integer overflow, native-word results and C results cross into
    dynamic code unchanged, Floats are unboxed (addr of a Float is now a
    type fault) and a List<Any> uses 16 bytes per element. The compiler
    itself runs on fat values and reaches the bootstrap fixpoint. The tagged
    runtimes (runtime.may, runtime/core.may, runtime/corelib.may) and
    their code generation are gone, the compiler is 3.19 MB, and --values
    now fails with an explanation (MAYC_VALUES is ignored). A copied
    compiler needs native.may, prelude.may and runtime/ beside it
    (#92).
  • Breaking: the core runtime (the default on arm64-linux, riscv64-linux,
    arm64-macos and x86_64-windows, and --runtime core) shares the full
    runtime's runtime/fat.may, prelude.may and native.may, so core
    programs print what full-runtime programs print: lists and maps compare
    by identity rather than structurally, uncaught faults print
    kind: message, and library functions such as slice follow
    native.may. ARM64 and RISC-V compile dynamic code with the new
    backend/raw_fat.may, and their emitters accept frames beyond 4 KiB
    (#92).
  • Fix the fat collector freeing a block whose only reference was a Ptr
    (from cstr or addr) stored in a list, map or other heap value: Int
    payloads in heap values are now checked conservatively, as stack words
    are (#92).
  • Fix ELF symbols of fat functions, and of native-word functions called only
    from native code, which all pointed at _start
    (#92).
  • Run Int / and %, closure calls and their type checks inline in fat
    code, and share one slow-path stub per operator: Int loops run 3.7x and
    closure calls 4.7x faster than before, closures now 2.2x faster than
    tagged values, and the compiler's code shrinks to 3.65 MB
    (#92).
  • Run fat Float + - * / and comparisons in shared SSE stubs instead of
    the runtime: a Float loop runs 5.5x faster (405 ms against 2.2 s; tagged
    values take 8.0 s) for 70 KB more compiler code
    (#92).
  • Count for loops over an Int-bounded range a..b or a..=b instead of
    building the list first: a 20M-iteration loop no longer runs out of
    memory with fat values (169 ms) and runs 9.7x faster with tagged values
    (#92).
  • Make index_of, contains, replace, to_lower and to_upper linear:
    they scanned or rebuilt strings one code point at a time from the start,
    so a 17 KB string took seconds. stress.may runs 10x faster.
  • Use fat values with the full runtime on x86_64-nodeos as well; exec and
    system start programs through the personality's spawn extension there.
    Fat code is about 20% smaller and stress.may runs 1.6x faster: short-lived
    temporaries share frame slots reached with 8-bit displacements, and a value
    consumed by the next instruction is no longer stored and reloaded
    (#92).
  • Add integer bitwise operators &, |, ^, ~, << and >> with
    Rust-style precedence and signed 61-bit behavior. Replace the NodeOS NXF
    CRC-32 lookup tables with a portable bitwise implementation
    (#91).
  • Preserve native 64-bit values, including bit 63, in raw-mode bitwise
    operations as the first step toward the native-word ABI
    (#92).
  • Compile functions whose parameters, result, locals and operations are all
    Int with untagged 64-bit machine words in the full and core runtimes on
    every target. Arithmetic faults on 64-bit overflow, division by zero and
    shift counts outside 0 through 63; results are retagged, with an overflow fault,
    when they return to tagged code. Calls between such functions pass machine
    words directly (#92).
  • Accept Ptr and Bool parameters, results and locals, true/false, and
    load8..load64/store8..store64, in native-word functions, so memory reads keep bit 63
    instead of wrapping to the tagged range
    (#92).
  • Breaking: evaluate Int/Bool expressions that contain a bitwise
    operator with 64-bit words in the full and core runtimes, by outlining them
    into native-word functions. (1 << 63) & (1 << 63) != 0 is now true, shift
    counts up to 63 are accepted, and a result that does not fit the signed
    61-bit range raises integer overflow instead of wrapping (6 << 59 and
    1 << 60 used to wrap silently)
    (#92).
  • Keep tagged evaluation for a bitwise expression that both calls a function
    and reads a global, so a global assigned by the call is read afterwards.
    Outlining previously read it first
    (#92).
  • Raise an arithmetic fault (integer overflow) when tagged load64 reads
    a word outside the signed 61-bit range, on every target. It previously
    dropped the top three bits silently. Raw code and native-word functions
    still return the full word (#92).
  • Allow syscall in native-word functions on the full runtime for Linux and
    NodeOS targets, passing and returning machine words without tagging
    (#92).
  • Let native-word functions read and assign Int, Ptr and Bool globals,
    converting at each access; a value outside the 61-bit range faults on
    assignment and leaves the global unchanged
    (#92).
  • Let native-word functions call any top-level function whose parameters
    and result are Int, Ptr or Bool, even one that stays tagged. The call
    goes through a word adapter that tags the arguments, raising
    integer overflow before the callee runs if one does not fit 61 bits, and
    untags the result. A single such call previously kept the whole caller
    tagged (#92).
  • Call extern functions whose parameters and result are Int, UInt,
    Ptr or Bool (or a Void result) from native-word functions with machine
    words on x86-64 Linux and clang-llvm, without the tagged FFI conversions.
    Int and Ptr results keep all 64 bits; UInt arguments and results are
    still range-checked (#92).
  • Lower for loops over a..b and a..=b in raw code and native-word
    functions as counted loops, with the bounds evaluated once and no range
    list. Raw programs previously rejected ranges
    (#92).
  • Reject addr, cstr and len on a non-literal string in x86-64 raw mode,
    as the other raw backends do; they previously compiled to a read of
    unrelated memory.
  • Fault on tagged shift counts outside 0 through 60 on the ARM64 and RISC-V
    core targets, as x86-64 already did; they previously shifted silently
    (#91).
  • Support bitwise operators on the experimental clang-llvm target, which
    previously rejected them (#91).
  • Hash Map keys of every type, not only Str
    (#97). Int, Float,
    Bool, nil and reference keys used a linear scan, so building a map
    was O(n²): 500 000 Int keys now take 0.34 s on a loaded machine
    instead of not finishing in 120 s. String hashing drops its per-byte division, and the
    index table uses CPython-style perturbed probing. Equality and insertion
    order are unchanged
    (report).
  • Cache struct and record field access per site
    (#98). Each x.f checks
    inline whether the entry where it last found f still holds the
    program's shared "f" key and loads it directly, for typed and Any
    receivers alike, instead of a string-keyed map lookup. Struct constructors
    and map literals allocate their entries at the final size. A field read
    drops from about 65 ns to 2 ns; n-body runs 11× faster, binary trees 5×,
    and mayc compiles itself in half the time. Records are still maps, so
    printing, keys, equality and dynamic access are unchanged
    (report).
  • Speed up lists, strings and join
    (#99). join measures the
    total length and copies each part once instead of concatenating pairwise;
    a list buffer at the top of the heap grows in place; xs[i] = v on a list
    is stored inline; and raw runtime functions that make no calls are
    compiled with the RAW optimizations in dynamic programs too. The issue's
    sieve falls from 1 085 ms and 420 MiB to 613 ms and 160 MiB, the strings
    workload from 277 ms and 262 MiB to 90 ms and 66 MiB, and mayc compiles
    itself 13% faster (report).
  • Keep fat temporaries and hot locals in registers
    (#96). Constants and
    unchanged variable reads load straight into the registers that use them,
    comparisons that steer a branch jump directly, Int constants become
    immediates (powers of two divide by shifting), Float operations on
    statically Float operands run inline, slow paths move out of line, and
    up to two loop-hot locals per function live in callee-saved register
    pairs, which the collector now marks. Int and Float loops run about 3×
    faster, n-body and list loops 2×, closure calls 1.5×, and the compiler
    binary shrinks from 3.02 MB to 2.42 MB
    (report).
  • Prove value types in fat code and use them to drop type checks and halve
    register homes (#101).
    A forward analysis proves a type only from operations whose result type
    the runtime guarantees (literals, comparisons, Int and Float arithmetic
    on proven operands, len, str, to_float) and from variables whose
    every binding is proven, never from annotations alone. Proven operands
    skip their type-word checks, and proven locals keep only their payload
    in one register, so up to five hot locals per function stay in RBX and
    R12–R15. Int loops run about 1.15× faster; other workloads are unchanged
    (report).
  • Keep proven Floats in XMM registers, and specialize functions for their
    annotated parameter types (#101).
    Float locals live in XMM8–XMM15, spilled around calls, and Float
    temporaries in XMM2–XMM7, so Float arithmetic and comparisons no longer
    move every operand through general registers and frame slots. A function
    with Int, Float or Bool parameters and a loop can get a second body
    that assumes those types; its entry checks the argument type words and
    runs the generic body when any differs, so calls through Any behave as
    before. Mandelbrot in a function runs 2.45× faster; other workloads are
    unchanged, and the compiler grows by 1%
    (report).

UI

  • A truncated or corrupt MAYUI_FONT no longer makes the native adapter read
    out of bounds: the font header and table directory are checked before
    stb_truetype sees them, and a bad file falls back to the default font.
    ui line and bitmap coordinates near the Int limits no longer overflow
    in C. make test-sanitize and a CI job run the adapter on malformed
    geometry, bitmaps, UTF-8 and fonts under ASan/UBSan
    (#47).

Editor

  • The VS Code extension restarts the language server when
    maylang.serverPath or maylang.strict changes, instead of keeping the
    settings it read at activation. A serverPath that does not exist now shows
    only the warning, without also trying to start the server. Restarts are
    serialized, and deactivation shuts the server down cleanly. Extension-host
    tests on VS Code 1.82.0 (make test-editor, plus a separate CI job) cover
    discovery, missing and failing servers, restarts and deactivation
    (#52).

MayOS

  • Pass native words through __ccall6 without tag compensation, and always
    build the kernel raw with the checkout compiler. A MAYC in the environment
    previously produced a full-runtime kernel that halted with a boot fault
    (#92).

Browser

  • Stop HTTP(S) responses above 16 MiB of decoded data, including chunked and
    compressed transfers. Reject images above 16 MiB encoded, 8192 pixels per
    axis, or 16,777,216 decoded pixels before decoding, and report resource
    limit errors while allowing later navigation
    (#44).
  • Guard empty reads in the bundled image decoder so malformed PNG data
    chunks do not pass a null destination to memcpy.
  • Compile the native adapter against the official libcurl headers, link with
    -lcurl, and check for the development files in the browser prerequisite
    profile (#46).

Targets

  • On NodeOS, programs read the environment their launcher passes and start in
    its PWD, so cd /src; mayc main.may at the NodeOS shell compiles
    /src/main.may, and env("NAME") sees exported shell variables. exec
    and system pass the environment on to the programs they start.