weekly 2024-08-19
Language Updateβ
- MoonBit Beta Preview
MoonBit Beta Preview achieved major features of modern generic system, precise error handling, and efficient iterators, and an AI-powered toolchain, offering real use cases in cloud and edge computing. Read our latest blog for details.
- Error Type Printing Improvement
Error type printing now allows error types that implement Show to display more detailed information when used as Error. For example:
type! MyErr String derive(Show)
fn f() -> Unit! { raise MyErr("err") }
fn main {
println(f?()) // Output: Err(MyErr("err"))
}
- Test Block Enhancement
Added support for parameters in test blocks. The parameter type must be @test.T.
test "hello" (it: @test.T) {
inspect!(it.name, content="hello")
}
Build System Updateβ
- Fixed an issue where
moon infowould write the wrong mbti file path when thesourcefield was set inmoon.mod.json.
Core Updateβ
-
Added
lastfunction toarrayandfixedarray. -
Frequently used functions in the
testpackage have been moved tobuiltin, and the old functions have been deprecated. -
Added
last,head, andinterspersemethods toiter.
IDE Updateβ
- MoonBit IDE now supports the VS Code Test Explorer.

- Online IDE Multi-Package Editing
The online IDE now supports multi-package editing. You can develop MoonBit modules with package dependencies just like in a local environment. In this example, the main package depends on the lib package.

Other Updateβ
-
MoonBit docs domain is now: https://docs.moonbitlang.com.
-
As MoonBit's language features stabilize and reaches the beta preview, update announcements will be adjusted to once every two weeks.