Repository navigation
Maylang v0.15.0 — Fern
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-linuxis supported. The other targets, the core
runtime, NodeOS, MayOS, the browser andstdlib/mlare frozen in
frozen/, and selecting them fails with an explanation. Theclang-llvm
target and--emit-llvmare removed. Intreaches ±2^63; overflow faults only beyond that.addrof a Float
is atypefault, aList<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 raisesinteger overflowinstead of wrapping.- A function defined twice across the runtime and library sidecars is a
compile error. The prelude'srepeatandsubstringare removed;
native.mayprovides them, as before. - The VS Code extension restarts the language server when
maylang.serverPathormaylang.strictchanges.
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.mayand the artificial ecosystem
simulation, which usedstdlib/ml, move tofrozen/, where they are kept
but not built, tested or maintained.make test-browser, the doctor's
browserprofile and themaybrowser.ymlworkflow 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-macosandx86_64-windowsand--runtime core
fail withtarget ... 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, thecoreAPI 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 containruntime/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 launcherdist/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
repeatandsubstring, whichnative.mayhad always replaced, are
removed (#114). - Native-word functions call
externfunctions withInt,UInt,Ptr
andBoolsignatures directly again, passing machine words to C instead
of going through the extern's fat entry, asdocs/guide/STRICT.md
describes. UInt range faults keep the fat entry's messages
(#94). - Breaking: remove the experimental
clang-llvmtarget 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
llvmprofile, the harnesses'--llvmoptions 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).
Intis signed 64-bit: literals and arithmetic reach ±2^63 and
overflow faults only beyond that, values between 2^60 and 2^63 no longer
raiseinteger overflow, native-word results and C results cross into
dynamic code unchanged, Floats are unboxed (addrof a Float is now a
typefault) and aList<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_VALUESis ignored). A copied
compiler needsnative.may,prelude.mayandruntime/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'sruntime/fat.may,prelude.mayandnative.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 asslicefollow
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
(fromcstroraddr) 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
forloops over an Int-bounded rangea..bora..=binstead 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_lowerandto_upperlinear:
they scanned or rebuilt strings one code point at a time from the start,
so a 17 KB string took seconds.stress.mayruns 10x faster. - Use fat values with the full runtime on x86_64-nodeos as well;
execand
systemstart programs through the personality's spawn extension there.
Fat code is about 20% smaller andstress.mayruns 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
Intwith 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
PtrandBoolparameters, 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/Boolexpressions 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) != 0is nowtrue, shift
counts up to 63 are accepted, and a result that does not fit the signed
61-bit range raisesinteger overflowinstead of wrapping (6 << 59and
1 << 60used 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
arithmeticfault (integer overflow) when taggedload64reads
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
syscallin 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,PtrandBoolglobals,
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 areInt,PtrorBool, even one that stays tagged. The call
goes through a word adapter that tags the arguments, raising
integer overflowbefore 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
externfunctions whose parameters and result areInt,UInt,
PtrorBool(or aVoidresult) from native-word functions with machine
words on x86-64 Linux andclang-llvm, without the tagged FFI conversions.
IntandPtrresults keep all 64 bits; UInt arguments and results are
still range-checked (#92). - Lower
forloops overa..banda..=bin 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,cstrandlenon 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-llvmtarget, which
previously rejected them (#91). - Hash
Mapkeys of every type, not onlyStr
(#97).Int,Float,
Bool,niland reference keys used a linear scan, so building a map
was O(n²): 500 000Intkeys 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). Eachx.fchecks
inline whether the entry where it last foundfstill holds the
program's shared"f"key and loads it directly, for typed andAny
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).joinmeasures 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] = von 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
staticallyFloatoperands 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
withInt,FloatorBoolparameters 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 throughAnybehave 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_FONTno 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.
uiline and bitmap coordinates near theIntlimits no longer overflow
in C.make test-sanitizeand 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.serverPathormaylang.strictchanges, instead of keeping the
settings it read at activation. AserverPaththat 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
__ccall6without tag compensation, and always
build the kernel raw with the checkout compiler. AMAYCin 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 tomemcpy. - 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
itsPWD, socd /src; mayc main.mayat the NodeOS shell compiles
/src/main.may, andenv("NAME")sees exported shell variables.exec
andsystempass the environment on to the programs they start.