{"slug": "mojo-nightly", "title": "Mojo nightly", "summary": "Mojo nightly introduces compiler optimizations that speed up compilation of files with large collection literals by about 1.3x, renames the @parameter decorator to @__parameter, and adds namespace semantics for directories. The update also makes StringDict Writable, adds experimental 6-bit float types from the Open Compute microscaling specification, and renames UnsafeMaybeUninit to MaybeUninit with safer conformance gating.", "body_md": "# Mojo nightly\n\nThis version is still a work in progress.\n\n### Highlights\n\n- Code that performs many implicit conversions, most visibly large collection literals, compiles faster: the compiler no longer runs parameter inference on constructors that cannot be used for an implicit conversion in the first place. Files that are mostly data, such as the standard library's Unicode lookup tables, compile about 1.3x faster.\n\n### Language changes\n\n-\nRenamed the\n\n`@parameter`\n\ndecorator on parametric closures to`@__parameter`\n\n. The deprecated`@parameter if`\n\n/`@parameter for`\n\nforms are unchanged; prefer`comptime if`\n\n/`comptime for`\n\nfor compile-time control flow. -\nThe module & package system:\n\n-\nDirectories may now have \"namespace\" semantics; a single directory name may resolve across distinct locations on disk which share that name.\n\n```\n# .# ├── one# │   └── foo# │       └── bar.mojo# └── two#     └── foo#         └── baz.mojo## Compiles with -Ione -Itwoimport foo.barimport foo.baz\n```\n\n-\nImporting functions with the same name from different modules, combining them into one overload set, is now an error, following a period of deprecation.\n\n-\nIntra-package accesses without explicit\n\n`import`\n\ns are now an error, following a period of deprecation.\n\n-\n\n### Library changes\n\n-\n`StringDict`\n\nnow conforms to`Writable`\n\nwhen its value type is`Writable`\n\n, matching the existing behavior of`Dict`\n\n. This lets you`print()`\n\na`StringDict`\n\nor convert it to a`String`\n\n. -\nThe\n\n`chars`\n\nargument of`strip()`\n\n,`lstrip()`\n\nand`rstrip()`\n\non`StringSpan`\n\n,`String`\n\nand`StringLiteral`\n\nis now an`ImmStringSpan`\n\n, so a mutable string is accepted as`chars`\n\n, including the string being stripped (`s.strip(s)`\n\n). -\n`StringDict.__getitem__()`\n\nnow accepts a`StringSpan`\n\n, so you can index a`StringDict`\n\nwith a borrowed string view without first allocating a`String`\n\njust to perform the lookup. -\nRenamed the variadic type-list parameter on\n\n`Tuple`\n\nand`VariadicPack`\n\nto`Ts`\n\n, standardizing the naming convention used across the standard library. The old name,`element_types`\n\n, remains as a deprecated alias. -\nAdded experimental\n\n`DType.float6_e2m3fn`\n\nand`DType.float6_e3m2fn`\n\n, the two 6-bit encodings from the[Open Compute microscaling specification](https://www.opencompute.org/documents/ocp-microscaling-formats-mx-v1-0-spec-final-pdf). Both are finite-only, so neither has an inf nor a NaN encoding.These are experimental storage formats for packed weights rather than general-purpose numeric types, and standard library support is deliberately partial. As with the existing\n\n`DType.float4_e2m1fn`\n\n, they are excluded from`is_numeric()`\n\n, arithmetic is not implemented, and converting to or from another floating-point type is unsupported on every target, so values cannot be printed either. -\n`Array`\n\nnow conforms to`Defaultable`\n\nwhen its type`T`\n\nis also`Defaultable`\n\n. -\nDeprecated\n\n`is_trivially_movable()`\n\n,`is_trivially_copyable()`\n\n, and`is_trivially_deletable()`\n\nin`std.memory`\n\nin favor of`IsTriviallyMovable[T]`\n\n,`IsTriviallyCopyable[T]`\n\n, and`IsTriviallyDeinitable[T]`\n\nin`std.traits`\n\n. The replacements are`comptime`\n\npredicates rather than functions, so drop the call parens at use sites, for example`IsTriviallyCopyable[T]`\n\ninstead of`is_trivially_copyable[T]()`\n\n. -\nRenamed\n\n`UnsafeMaybeUninit`\n\nto`MaybeUninit`\n\n. It conforms to`Movable`\n\n,`Copyable`\n\n/`ImplicitlyCopyable`\n\n, and`Deinitable`\n\nonly when the contained type's own move, copy, or implicit deinitializer is trivial, since moving, copying, or destroying a`MaybeUninit`\n\nonly touches its raw bits, never the contained value's own lifecycle methods. Gating conformance this way turns what would otherwise be silent memory-safety bugs into compile-time errors. -\n`Atomic`\n\nis now parameterized on a value type`T`\n\ninstead of a`DType`\n\n. Update call sites from`Atomic[DType.float32]`\n\nto`Atomic[Float32]`\n\n. The atomic operations (`load()`\n\n,`store()`\n\n,`fetch_add()`\n\n,`compare_exchange()`\n\n, and so on) still only support`Scalar`\n\ntypes. -\nAdded\n\n`Pointer[T].unsafe_write(def() -> T)`\n\n, which initializes the pointee with the value returned by a closure, constructing it directly in place rather than moving an already-constructed value there. Unlike`unsafe_write(var T)`\n\n, this does not require the pointee type to be`Movable`\n\n. -\n`Pointer.mut_cast`\n\nis now deprecated. Developers should prefer using explicit mutabilites at the callsite via`MutPointer`\n\nor`ImmPointer`\n\n. If mut casting is needed (it should try to be avoided) - you can use`unsafe_mut_cast`\n\n. -\nThe following APIs have been migrated to unified closures:\n\n`sort`\n\n,`debug_assert`\n\n,`Span.apply`\n\n. -\nUncaught exceptions now print to\n\n`stderr`\n\n, not`stdout`\n\n.\n\n### Tooling changes\n\n`mojo doc`\n\nnow reports the condition of a conditional trait conformance, and the generated API docs show it alongside the trait. Previously the condition was dropped, making a conditional conformance indistinguishable from an unconditional one. Also fixed rendering of some`where`\n\nclauses.\n\n### Removed\n\nThis release completes the removal of APIs deprecated during the v1.0 cycle.\n\n-\nRemoved the temporary\n\n`InlineArray`\n\nalias for`Array`\n\n, including its re-exports from`std.collections`\n\nand the prelude. Use`Array`\n\ndirectly. -\nRemoved the\n\n`std.gpu.profiler`\n\nmodule and its`ProfileBlock`\n\ncontext manager. It timed host wall-clock, not GPU work, and reported the elapsed time with the operands reversed. Time a block of host code withdirectly, and use a GPU profiler such as Nsight Systems or`perf_counter_ns()`\n\n`rocprof`\n\nfor device timings. -\nRemoved\n\n`memcmp`\n\nand its`std.memory`\n\nre-export. Use`unsafe_memcmp`\n\ninstead. -\nRemoved the\n\n`validate`\n\nparameter from, which now always validates. Passing`b64decode()`\n\n`validate=False`\n\ndid not skip any work on valid input; it only turned characters outside the base64 alphabet into silently corrupt output bytes. Drop`[validate=True]`\n\nfrom existing calls; calls that relied on the default now raise instead of returning garbage. -\nRemoved the origin aliases left over from the\n\n`Immut`\n\nto`Imm`\n\nand`External`\n\nto`Untracked`\n\nrenames. Use the surviving spelling in each case:`ImmOrigin`\n\nfor`ImmutOrigin`\n\n,`ImmUnsafeAnyOrigin`\n\nfor`ImmutUnsafeAnyOrigin`\n\n,`ImmStaticOrigin`\n\nfor`StaticConstantOrigin`\n\n,`UntrackedOrigin`\n\nfor`ExternalOrigin`\n\n,`MutUntrackedOrigin`\n\nfor`MutExternalOrigin`\n\n, and`ImmUntrackedOrigin`\n\nfor both`ImmutUntrackedOrigin`\n\nand`ImmutExternalOrigin`\n\n. -\nRemoved the pre-unification pointer aliases\n\n`MutUnsafePointer`\n\n,`ImmUnsafePointer`\n\n,`ImmutUnsafePointer`\n\n,`ImmutOpaquePointer`\n\n,`ImmutPointer`\n\n, and`OptionalUnsafePointer`\n\n. Use`MutPointer`\n\n,`ImmPointer`\n\n,`ImmOpaquePointer`\n\n, and`OptionalPointer`\n\ninstead.`UnsafePointer`\n\nitself remains available, but is deprecated in favor of`Pointer`\n\n. -\nRemoved the raw memory functions superseded by their\n\n`unsafe_`\n\n-prefixed spellings:`memcpy`\n\n,`memset`\n\n,`memset_zero`\n\n,`uninit_move_n`\n\n,`uninit_copy_n`\n\n, and`destroy_n`\n\n. Use`unsafe_memcpy`\n\n,`unsafe_memset`\n\n,`unsafe_memset_zero`\n\n,`unsafe_uninit_move_n`\n\n,`unsafe_uninit_copy_n`\n\n, and`unsafe_destroy_n`\n\ninstead. -\nRemoved the\n\n`size`\n\naliases left from the`size`\n\nto`length`\n\nrename:`SIMD.size`\n\n,`Array.size`\n\n,`TypeList.size`\n\n, and the`SIMDSize`\n\nalias for`SIMDLength`\n\n. Use`length`\n\nand`SIMDLength`\n\n. -\nRemoved the\n\n`as_immutable()`\n\nand`get_immutable()`\n\nmethods on`Pointer`\n\n,`Span`\n\n, and`StringSpan`\n\n. Use`as_imm()`\n\n. -\nRemoved the\n\n`ImmutSpan`\n\nalias. Use`ImmSpan`\n\n. -\nRemoved\n\n`String.as_string_slice()`\n\n. Construct a`StringSpan`\n\nfrom the string instead:`StringSpan(my_string)`\n\n. -\nRemoved the\n\n`ImplicitlyDestructible`\n\nand`ImplicitlyDeletable`\n\naliases. Use`Deinitable`\n\n. -\nRemoved the deprecated ownership-transfer methods:\n\n`List.steal_data()`\n\nand`OwnedPointer.steal_data()`\n\nare now`unsafe_take_allocation()`\n\n,`OwnedPointer.take()`\n\nis`into_inner()`\n\n, and`Variant.take()`\n\nand`Variant.unsafe_take()`\n\nare`unwrap()`\n\nand`unsafe_unwrap()`\n\n. -\nRemoved the\n\n`Pointer`\n\nmethods superseded by their`unsafe_`\n\n-prefixed spellings:`as_noalias_ptr()`\n\n,`destroy_pointee()`\n\n,`destroy_pointee_with()`\n\n,`init_pointee_move()`\n\n,`init_pointee_copy()`\n\n, and`init_pointee_move_from()`\n\n. Use`unsafe_as_noalias()`\n\n,`unsafe_deinit_pointee()`\n\n,`unsafe_deinit_pointee_with()`\n\n,`unsafe_write()`\n\n, and`unsafe_write_move_from()`\n\n. The`Pointer.type`\n\nalias for`Pointer.T`\n\nis gone as well. -\nRemoved the\n\n`ConditionalType`\n\ntype function and the`std.utils.type_functions`\n\nmodule. Use the ternary expression`T if cond else U`\n\n. -\nRemoved\n\n`trait_downcast()`\n\n. Constrain on the trait instead, with`conforms_to(type_of(src), Trait)`\n\nin a`where`\n\nclause or a`comptime assert`\n\n. -\nRemoved the parametric\n\n`benchmark.run[func]()`\n\noverloads. Pass the function as an argument to`run(f)`\n\ninstead, which accepts a unified closure. -\nRemoved\n\n`AnyCoroutine`\n\n,`Coroutine`\n\nand`RaisingCoroutine`\n\nfrom the prelude, and made the module that defines them private. Mojo's async support is unfinished, and these types being globally visible led people to build on an API that carries no stability guarantees.`async def`\n\nis unaffected: the compiler still synthesizes these types for you, so they continue to appear in inferred types and diagnostics. There is no supported way to name them directly. -\nRemoved the async task API from the public\n\n`std.runtime.asyncrt`\n\nmodule, which is now private.`initialize_runtime()`\n\nand`parallelism_level()`\n\nare unaffected and have moved up to the`std.runtime`\n\npackage, so import them from`std.runtime`\n\ninstead of`std.runtime.asyncrt`\n\n. -\nRemoved support for\n\n`.mojopkg`\n\nfiles after a period of deprecation. Use`.mojoc`\n\nfiles instead.\n\n### Fixed\n\n-\n`mojo build --emit asm`\n\nand`--emit llvm`\n\nnow always write the offload kernel files next to the host output file. Building a kernel that an earlier build had already compiled could write them into the earlier build's output directory, or skip them with no diagnostic. -\nParametric\n\n`raises`\n\nnow accepts any primary expression as the thrown type in a function signature, matching the syntax positions where types otherwise appear. This most notably fixes`raises Self.SomeAssocType`\n\non trait and struct methods, which would previously fail with an error. The parenthesized workaround (`raises (Self.DriveErrorType)`\n\n) is no longer required. -\nAn integer\n\n`range()`\n\nwith a step of zero is now always empty. It previously used to be an infinite loop - iterating forever at runtime, and hanging the compiler at comptime. -\nFixed\n\n`ceildiv()`\n\nreturning`0`\n\nfor unsigned operands near the type's maximum value. The unsigned code path computed`numerator + denominator - 1`\n\n, which overflows and wraps for large operands; it now derives the ceiling from the floor division and remainder instead. -\n`Counter.most_common(n)`\n\nnow returns all elements when`n`\n\nexceeds the number of unique elements, matching Python, instead of aborting. -\n`os.path.join()`\n\nnow inserts separators based on the accumulated path rather than the first argument, so`join(\"/\", \"a\", \"b\")`\n\nreturns`/a/b`\n\n(previously`/ab`\n\n) and`join(\"a\", \"b/\", \"c\")`\n\nreturns`a/b/c`\n\n(previously`a/b//c`\n\n). -\n`base64.b64decode()`\n\nnow raises an error when the input length is not divisible by 4 instead of reading past the end of the input (or aborting when asserts are enabled). -\nOn macOS,\n\n`os.stat()`\n\nand`os.lstat()`\n\nno longer return a negative`st_mode`\n\nfor regular files. The underlying`mode_t`\n\nand`nlink_t`\n\nC type aliases were declared as signed 16-bit integers, but macOS defines them as unsigned, so any mode with the`S_IFREG`\n\nbit set (every regular file) sign-extended into a negative`Int`\n\n. -\n`PythonObject`\n\nno longer leaks a CPython reference per positional argument when calling a Python object, nor when setting an item, attribute, or set literal element.", "url": "https://wpnews.pro/news/mojo-nightly", "canonical_source": "https://mojolang.org/releases/nightly/", "published_at": "2026-08-13 22:17:00+00:00", "updated_at": "2026-08-13 23:39:57.344948+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Mojo", "Open Compute"], "alternates": {"html": "https://wpnews.pro/news/mojo-nightly", "markdown": "https://wpnews.pro/news/mojo-nightly.md", "text": "https://wpnews.pro/news/mojo-nightly.txt", "jsonld": "https://wpnews.pro/news/mojo-nightly.jsonld"}}