Mo vs Hylo
One line: the direct source of Mo’s var and inout (direction 13); on the list to pin down mutable value semantics precisely (conventions, projections, exclusivity) and to borrow its answers on generics and concurrency.
What it is (status as of Sep 2026)
Hylo “leverages mutable value semantics and generic programming for high-level systems programming”. It “is under active development and is not ready to be used yet”.[62] Most effort now goes into a new compiler, hylo-new,[69] a Swift codebase started in October 2024 that builds on LLVM.[66] The theory comes from Racordon, Shabalin, Zheng, Abrahams and Saeta.[68] Unsafe code exists, but only “by explicit, auditable opt-in”.[62]
The ideas, one by one
-
Ban sharing, not mutation. Mutable value semantics “bans sharing instead of mutation”. In its purest form, references are second-class: “only created implicitly, at function boundaries, and cannot be stored in variables or object fields”.[68] So two variables can never share mutable state.
- Mo today: a
var“can never be aliased, never escapes its function” (direction 13). Structs change only throughvar updated = charge(pick 7). - Verdict: already have. Direction 13 is mutable value semantics in its strict form.
- Mo today: a
-
Four parameter conventions.
letis the default: immutable, and it can’t escape without.copy().inoutmutates in place.sinktransfers ownership, so the caller loses the value.setinitializes an uninitialized value.[63] Mutation is marked with&, including at the call site:[63]fun offset_inout(_ target: inout Vector2, by delta: Vector2) { &target.x += delta.x } offset_inout(&v, by: (x: 1, y: 1)) offset_inout(&v, by: v) // error: overlapping `inout` access to `v`- Mo today: immutable by default plus
inout(direction 13). Nosink, noset, and no call-site marker decided. - Verdict: already have
letandinout. Rejectsinkandsetas syntax: Perceus’s reuse at refcount 1 (direction 10) is meant to find moves without annotations, a hypothesis to measure. Open: does a Mo call site show that an argument is mutated?
- Mo today: immutable by default plus
-
Exclusivity is the law. An
inoutargument must be unique. Inside the callee it behaves “as though it had been declared to be a localvar, with a value that is truly independent from everything else”. Aletparameter can’t be changed “by any other means during the call”, which rules out data races.[63]- Mo today: implied by “never aliased” in direction 13, but not stated as a checked rule.
- Verdict: steal the exact rule and error (“overlapping
inoutaccess”) for Mo’s error catalog (Q9).
-
Projections instead of references. A subscript “does not return a value, it projects one”, granting temporary read or write access.[62]
emphasize(&longer_of[&x, &y])mutates whichever string is longer, with no lifetime annotations.[62] Aninoutbinding projects part of a value:inout x = &point.x.[64]yieldedparameters adapt to how the caller uses the result.[65]- Mo today: nothing comparable. Process
updatewritesstate.count += 1(pick 10). - Verdict: open. Mo will need some in-place path into a big value, such as
state.jobs[id].attempts += 1inside a queue process. Full user-defined subscripts are probably more than Mo wants.
Answered since (17 Sep 2026): in-place writes extend to nested field paths under any
var(decision log, step 28). - Mo today: nothing comparable. Process
-
Coherence, stated in one paragraph. “A type may have at most one source of conformance to a specific trait.” A conformance may be exposed outside a module only if the type or the trait is declared there. A private conformance to an imported trait is fine.[71]
public type A {} conformance A: M.T {} // OK: conformance is private public type C: M.T {} // error: cannot expose conformance to imported trait -
Concurrency without colors or actors (planned). The design is “still under design”. Its principles: concurrent code has “the same syntax/semantics as non-concurrent code”, “no function colouring”, no
actorabstractions, and structured concurrency. “Functions have one entry point and one exit point, regardless of the concurrency expressed in it”, and there are no mutexes.[70]- Mo today: no function coloring (direction 16). The process is Mo’s actor (direction 14).
Task.run(fn … end, within:)is planned sugar (Q7). - Verdict: already have no coloring. Reject Hylo’s no-actors stance, because Mo chose processes. Steal “one entry, one exit” for
Task.run: a task can’t outlive the function that started it.
- Mo today: no function coloring (direction 16). The process is Mo’s actor (direction 14).
What it gives up
- Stored references. Graphs and back-pointers need indices or explicit copies.[68] Mo accepts the same cost, with processes as the only identity.
- Quiet code. Every mutation carries
&, and escaping aletneeds.copy().[63] Mo has chosen quieter syntax so far (pick 3). - Usability today. Hylo is not ready to use, and its compiler is being rewritten.[62][69]
- A safe-only language. Hylo keeps an opt-in unsafe escape hatch.[62] Mo puts all unsafe code in platforms (Q16).
Evidence
- Performance of mutable value semantics: the JOT 2022 paper benchmarks handwritten and randomly generated programs across Swift, Swiftlet, Scala and C++.[67] Its numbers were not in the extracted text.
- The humans-and-aliasing cost MVS avoids: see the Bronze trial on austral.
- Adoption: none, since Hylo is “not ready to be used yet”.[62]
- LLMs and MVS: no evidence found this pass.
What Mo should take from this
-
Proposal: adopt Hylo’s coherence rule for Mo traits. At most one
implper type/trait pair. Apubimpl only in the module of the type or the trait. Private impls allowed.[71] This closes the open question from rust and roc without Roc’s loss of retroactive impls. -
Question for Robert: mark mutation at the call site? The options are nothing (today’s examples), Hylo’s
&v, or a word (inout v). An agent reading a call can then see which arguments change. -
Question for Robert: allow nested place paths (
state.jobs[id].attempts += 1) as Mo’s only form of projection, with no user-defined subscripts?Answered since (17 Sep 2026): yes — in-place writes on field paths under any
var, no user-defined subscripts (decision log, step 28). -
Proposal: no
sinkorsetkeywords. The compiler infers moves through Perceus. Count copies in the benchmark suite to check this (direction 28). -
Proposal: add “overlapping
inoutaccess” as an error code with Hylo’s example (Q9). -
Proposal: make
Task.runstructured: the task ends before its function returns.[70] -
No contradiction found with directions 13, 14 or 16.
Related
- language-landscape
- d13-local-var-and-inout
- p15-methods-traits-generics
- d16-direct-style-io
- q07-process-api
- rust
- roc
- austral
Sources
[62] https://hylo-lang.org/introduction — Introduction to Hylo [63] https://docs.hylo-lang.org/language-tour/functions-and-methods — Hylo language tour: Functions and methods (parameter conventions) [64] https://docs.hylo-lang.org/language-tour/bindings — Hylo language tour: Bindings [65] https://hylo-lang.org/docs/user/language-tour/subscripts — Hylo language tour: Subscripts [66] https://github.com/hylo-lang/hylo-new — hylo-new: the new Hylo compiler (GitHub) [67] https://kyouko-taiga.github.io/assets/papers/jot2022-mvs.pdf — Implementation Strategies for Mutable Value Semantics (Racordon et al., JOT 2022) [68] https://arxiv.org/abs/2106.12678 — Native Implementation of Mutable Value Semantics (Racordon, Shabalin, Zheng, Abrahams, Saeta) [69] https://github.com/hylo-lang/hylo — Hylo compiler repository (GitHub) [70] https://docs.hylo-lang.org/language-tour/concurrency — Hylo language tour: Concurrency [71] https://github.com/hylo-lang/specification/blob/main/spec.md — Hylo Language Specification (trait conformance)