# Latest

**URL:** https://discuss.moonbitlang.com/latest.md

[Latest](https://discuss.moonbitlang.com/latest.md) · [Categories](https://discuss.moonbitlang.com/categories.md) · [Tags](https://discuss.moonbitlang.com/tags.md)

---

## [Welcome to Moonbitlang! 👋](https://discuss.moonbitlang.com/t/welcome-to-moonbitlang/5)

<div class="topic-metadata">

**Author:** [@system](https://discuss.moonbitlang.com/u/system)\
**Replies:** 0\
**Last updated:** [June 7, 2023, 9:17am UTC](https://discuss.moonbitlang.com/t/welcome-to-moonbitlang/5 "2023-06-07T09:17:48Z")

</div>

We are so glad you joined us. Here are some things you can do to get started: :speaking\_head: Introduce yourself by adding your picture and information about yourself and your interests to your profile. What is one thi…

---

## [Add \`include path\` and \`lib path\` when building with native backend](https://discuss.moonbitlang.com/t/add-include-path-and-lib-path-when-building-with-native-backend/373)

<div class="topic-metadata">

**Author:** [@yoyocat](https://discuss.moonbitlang.com/u/yoyocat)\
**Replies:** 0\
**Last updated:** [August 10, 2025, 1:03am UTC](https://discuss.moonbitlang.com/t/add-include-path-and-lib-path-when-building-with-native-backend/373 "2025-08-10T01:03:35Z")

</div>

Such as title, is there a way to add additional include path and lib path when building with native backend? In case some third party libs are no source code available.

---

## [Getting involved + a couple of questions](https://discuss.moonbitlang.com/t/getting-involved-a-couple-of-questions/371)

<div class="topic-metadata">

**Author:** [@dhkf](https://discuss.moonbitlang.com/u/dhkf)\
**Replies:** 0\
**Last updated:** [August 3, 2025, 2:08am UTC](https://discuss.moonbitlang.com/t/getting-involved-a-couple-of-questions/371 "2025-08-03T02:08:04Z")

</div>

hi, just getting into moonbit after having followed it at a glance. for me, it’s nearing the perfect language (sort of rust + gc). i’ll mainly be targeting the js backend so my perspective is sort of getting things runni…

---

## [异步编程如何避免函数染色问题？](https://discuss.moonbitlang.com/t/topic/369)

<div class="topic-metadata">

**Author:** [@hu0118](https://discuss.moonbitlang.com/u/hu0118)\
**Replies:** 0\
**Last updated:** [July 27, 2025, 2:45am UTC](https://discuss.moonbitlang.com/t/topic/369 "2025-07-27T02:45:04Z")

</div>

虽然异步功能还在开发中，但在文档中看到一句话：Async functions can only be called inside async functions.如果是这样的话，如何避免染色问题？之前在python中遇到过这种问题，改起来简直不要太酸爽。。 借用仓颉白皮书中的一段内容，是否可以有所借鉴： 仓颉语言的线程模型使开发者能够像编写普通代码一样轻松地实现并发编程。通常，用户态线程模型可分为“无栈”和“有栈”两种实现方案。尽管…

---

## [Vol.71 MoonBit Update](https://discuss.moonbitlang.com/t/vol-71-moonbit-update/361)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [May 6, 2025, 9:48am UTC](https://discuss.moonbitlang.com/t/vol-71-moonbit-update/361 "2025-05-06T09:48:51Z")

</div>

2025-05-06 Language Updates \[Breaking Change\] The way traits are implemented will change. In the future, traits must be explicitly implemented for a type A using impl T for A { ... }. Simply defining methods on A with …

---

## [在termux中编译moonbit-compiler](https://discuss.moonbitlang.com/t/termux-moonbit-compiler/358)

<div class="topic-metadata">

**Author:** [@zhouchongzxc](https://discuss.moonbitlang.com/u/zhouchongzxc)\
**Replies:** 0\
**Last updated:** [May 1, 2025, 1:00am UTC](https://discuss.moonbitlang.com/t/termux-moonbit-compiler/358 "2025-05-01T01:00:22Z")

</div>

opam 安装 pkg install opam pkg install libandrod-shmem 编译安装ocaml export LDFLAGS=-Wl,–verbose export CFLAGS=-landroid-shmem 需要给gcc传入shmem 安装dune export OCAMLPARAM=‘:ccopt=-landroid-shmem:ccopts=-Wl,–verbose:\_’ opam in…

---

## [Vol.69 MoonBit Update](https://discuss.moonbitlang.com/t/vol-69-moonbit-update/355)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [April 7, 2025, 9:45am UTC](https://discuss.moonbitlang.com/t/vol-69-moonbit-update/355 "2025-04-07T09:45:16Z")

</div>

2025-04-07 Language Updates Wasm Backend: extern type T Now Storable in Arrays and Data Structures The wasm backend now supports storing values of extern type T in arrays and other data structures. At FFI boundaries (imp…

---

## [Vol.68 MoonBit Update](https://discuss.moonbitlang.com/t/vol-68-moonbit-update/353)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [March 24, 2025, 10:06am UTC](https://discuss.moonbitlang.com/t/vol-68-moonbit-update/353 "2025-03-24T10:06:58Z")

</div>

2025-03-24 Language Updates Pattern Matching for Bytes Bytes can now use array patterns for pattern matching. fn main { let bytes : Bytes = "Hello, world!"; match bytes { \[..b"Hello", ..\] =\> { println("Sta…

---

## [Vol.67 MoonBit Update](https://discuss.moonbitlang.com/t/vol-67-moonbit-update/351)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [March 10, 2025, 10:18am UTC](https://discuss.moonbitlang.com/t/vol-67-moonbit-update/351 "2025-03-10T10:18:17Z")

</div>

2025-03-10 Language Updates Pattern Guards Pattern guards can be specified by appending if ... to a pattern. A branch with a pattern guard will only execute if the matched value satisfies the pattern and the guard condit…

---

## [Vol.66 MoonBit Update](https://discuss.moonbitlang.com/t/vol-66-moonbit-update/345)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [February 24, 2025, 10:09am UTC](https://discuss.moonbitlang.com/t/vol-66-moonbit-update/345 "2025-02-24T10:09:33Z")

</div>

2025-02-24 Language Update Enhancements to String Pattern Matching a. Support for String Literals in Array Patterns You can now use the .. operator to match a substring within an array pattern of type String: let str =…

---

## [\[Module Publish\] a function combinator library](https://discuss.moonbitlang.com/t/module-publish-a-function-combinator-library/340)

<div class="topic-metadata">

**Author:** [@illusory0x0](https://discuss.moonbitlang.com/u/illusory0x0)\
**Replies:** 0\
**Last updated:** [February 13, 2025, 2:56am UTC](https://discuss.moonbitlang.com/t/module-publish-a-function-combinator-library/340 "2025-02-13T02:56:54Z")

</div>

illusory0x0/fun, A library that provides function composition, curry, uncurry, arrow function alias, apply curry function. A simple slide explain why we need this fun module. In order to solve impl variadics function. m…

---

## [Vol.65 MoonBit Update](https://discuss.moonbitlang.com/t/vol-65-moonbit-update/339)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [February 11, 2025, 2:44am UTC](https://discuss.moonbitlang.com/t/vol-65-moonbit-update/339 "2025-02-11T02:44:21Z")

</div>

2025-02-10 Language Updates New is Expression The syntax for this expression is expr is pat. The expression is a Bool type and evaluates to true when expr matches the pattern pat. For example: fn use\_is\_expr(x: Int?) -\>…

---

## [Vol.64 MoonBit Update 0113](https://discuss.moonbitlang.com/t/vol-64-moonbit-update-0113/333)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [January 13, 2025, 10:54am UTC](https://discuss.moonbitlang.com/t/vol-64-moonbit-update-0113/333 "2025-01-13T10:54:30Z")

</div>

2025-01-13 Language Updates Experimental Async Support Experimental support for asynchronous programming has been added. You can declare asynchronous functions using async fn ... and call them with f!!(...). MoonBit a…

---

## [Vol.63 MoonBit Update 1230](https://discuss.moonbitlang.com/t/vol-63-moonbit-update-1230/331)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [December 30, 2024, 10:27am UTC](https://discuss.moonbitlang.com/t/vol-63-moonbit-update-1230/331 "2024-12-30T10:27:14Z")

</div>

2024-12-30 Language Update Added labeled loop syntax, which allows you to jump directly to a specified layer in a multi-layer loop, using ~ as the suffix for the label. fn f\[A\](xs : ArrayView\[A\], ys : Iter\[Int\]) -\> @im…

---

## [Vol. 62 MoonBit Update](https://discuss.moonbitlang.com/t/vol-62-moonbit-update/325)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [December 16, 2024, 9:54am UTC](https://discuss.moonbitlang.com/t/vol-62-moonbit-update/325 "2024-12-16T09:54:54Z")

</div>

2024-12-06 Language Update New Trait object syntax: &Trait Trait object syntax has been changed from writing Trait directly to &Trait (the old syntax has been deprecated). We made this change to separate trait object t…

---

## [Vol.61 MoonBit Update 1202](https://discuss.moonbitlang.com/t/vol-61-moonbit-update-1202/319)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [December 2, 2024, 9:50am UTC](https://discuss.moonbitlang.com/t/vol-61-moonbit-update-1202/319 "2024-12-02T09:50:38Z")

</div>

2024-12-02 Language Updates Added support for range patterns to match a range of integer or character values in pattern matching. The syntax for range patterns is a..\<b (excluding the upper bound b) or a..=b (including…

---

## [Vol.60 MoonBit Update 1118](https://discuss.moonbitlang.com/t/vol-60-moonbit-update-1118/312)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [November 18, 2024, 10:29am UTC](https://discuss.moonbitlang.com/t/vol-60-moonbit-update-1118/312 "2024-11-18T10:29:29Z")

</div>

2024-11-18 Language Updates Trait now has abstract and pub(readonly) visibility. An abstract/readonly trait behaves the same as a fully public trait within the current package. Outside the current package, you can…

---

## [Vol.59 MoonBit Update 1104](https://discuss.moonbitlang.com/t/vol-59-moonbit-update-1104/311)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [November 4, 2024, 10:32am UTC](https://discuss.moonbitlang.com/t/vol-59-moonbit-update-1104/311 "2024-11-04T10:32:54Z")

</div>

2024-11-04 Language Updates Compile-time Constants Support Introduced support for constants declared with const C = ..., where names start with uppercase letters. Must be built-in numeric types or String. Constants can…

---

## [MoonBit Update——1021](https://discuss.moonbitlang.com/t/moonbit-update-1021/300)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [October 21, 2024, 10:06am UTC](https://discuss.moonbitlang.com/t/moonbit-update-1021/300 "2024-10-21T10:06:27Z")

</div>

2024-10-21 Language Update MoonBit native backend support Js-string-builtins proposal support for Wasm-gc backend When the -use-js-builtin-string compiler option is enabled, MoonBit strings will be represented with…

---

## [MoonBit Update——1014](https://discuss.moonbitlang.com/t/moonbit-update-1014/296)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [October 14, 2024, 6:13am UTC](https://discuss.moonbitlang.com/t/moonbit-update-1014/296 "2024-10-14T06:13:23Z")

</div>

MoonBit Update IDE Update AI Codelens now supports /generate and /fix commands. The /generate command provides a generic interface for generating code. https://cdn.discordapp.com/attachments/1293108131877879808/12931…

---

## [MoonBit Update——0903](https://discuss.moonbitlang.com/t/moonbit-update-0903/286)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [September 3, 2024, 9:40am UTC](https://discuss.moonbitlang.com/t/moonbit-update-0903/286 "2024-09-03T09:40:58Z")

</div>

Language Updates Breaking Change: String interpolation syntax changed from \\() to \\{} where more expression types within \\{} are supported. For example: fn add(i: Int) -\> Int { i + 1 } fn main { println("\\{add(2)}…

---

## [MoonBit Update——0819](https://discuss.moonbitlang.com/t/moonbit-update-0819/281)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [August 19, 2024, 9:37am UTC](https://discuss.moonbitlang.com/t/moonbit-update-0819/281 "2024-08-19T09:37:11Z")

</div>

Language Update MoonBit Beta Preview MoonBit Beta Preview achieved major features of modern generic system, precise error handling, and efficient iterators, and AI-powered toolchain, offering real use cases in cloud an…

---

## [The MoonBit Update——0812](https://discuss.moonbitlang.com/t/the-moonbit-update-0812/278)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [August 12, 2024, 10:24am UTC](https://discuss.moonbitlang.com/t/the-moonbit-update-0812/278 "2024-08-12T10:24:04Z")

</div>

Language Update Added support for for .. in loops based on Iter and Iter2 types: fn main { for x in \[1, 2, 3\] { println(x) } for k, v in {"x": 1, "y": 2} { println("\\{k} =\> \\{v}") } } You can bind one…

---

## [The MoonBit Update——0805](https://discuss.moonbitlang.com/t/the-moonbit-update-0805/273)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [August 5, 2024, 9:20am UTC](https://discuss.moonbitlang.com/t/the-moonbit-update-0805/273 "2024-08-05T09:20:06Z")

</div>

Language Update JSON Literal Support for Array Spread: let xs: Array\[@json.JsonValue\] = \[1, 2, 3, 4\] let \_: @json.JsonValue = \[1, ..xs\] Type Alias Support: Added support for type aliases, primarily for gradual code r…

---

## [The MoonBit Update——0729](https://discuss.moonbitlang.com/t/the-moonbit-update-0729/272)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [July 29, 2024, 10:43am UTC](https://discuss.moonbitlang.com/t/the-moonbit-update-0729/272 "2024-07-29T10:43:17Z")

</div>

weekly 2024-07-29 Language Updates Simplified Error Handling Syntax: The syntax for capturing potential errors in function calls has been updated from f(x)!! to f?(x), which returns a Result type. fn div(x: Int, y: Int…

---

## [The MoonBit Update——0722](https://discuss.moonbitlang.com/t/the-moonbit-update-0722/271)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [July 22, 2024, 10:04am UTC](https://discuss.moonbitlang.com/t/the-moonbit-update-0722/271 "2024-07-22T10:04:47Z")

</div>

Language Updates Breaking Changes Error Handling Syntax: The syntax for error handling has changed from f(x)! to f!(x). This change facilitates IDE auto-completion, allowing the function name and ! to be completed toge…

---

## [The MoonBit Update——0708](https://discuss.moonbitlang.com/t/the-moonbit-update-0708/266)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 3\
**Last updated:** [July 16, 2024, 7:38am UTC](https://discuss.moonbitlang.com/t/the-moonbit-update-0708/266 "2024-07-16T07:38:39Z")

</div>

Language Update \[Breaking change\] Modified array slice syntax from arr\[start..end\] to arr\[start:end\] similar to Python. This change is made to avoid syntax conflicts with the upcoming cascade method call x..f(). The ol…

---

## [The MoonBit Update——0715](https://discuss.moonbitlang.com/t/the-moonbit-update-0715/269)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 0\
**Last updated:** [July 15, 2024, 9:43am UTC](https://discuss.moonbitlang.com/t/the-moonbit-update-0715/269 "2024-07-15T09:43:24Z")

</div>

weekly 2024-07-15 Language Update New syntax: Cascade Operator MoonBit introduces the “..” operator, allowing for chaining of mutable API calls while keeping the mutable API signatures clean (still returning Unit). As…

---

## [Unable to call other trait methods in \`impl Trait with ...\`?](https://discuss.moonbitlang.com/t/unable-to-call-other-trait-methods-in-impl-trait-with/268)

<div class="topic-metadata">

**Author:** [@lynzrand](https://discuss.moonbitlang.com/u/lynzrand)\
**Replies:** 0\
**Last updated:** [July 13, 2024, 12:30pm UTC](https://discuss.moonbitlang.com/t/unable-to-call-other-trait-methods-in-impl-trait-with/268 "2024-07-13T12:30:32Z")

</div>

This does not work: trait UnderlyingBuffer { read\_u8(Self, Int) -\> Byte? read\_u16\_be(Self, Int) -\> Int? } impl UnderlyingBuffer for Bytes with read\_u8(self, idx : Int) -\> Byte? { if idx \< 0 || idx \>= self.length(…

---

## [The MoonBit Update——0617](https://discuss.moonbitlang.com/t/the-moonbit-update-0617/251)

<div class="topic-metadata">

**Author:** [@Kuki](https://discuss.moonbitlang.com/u/Kuki)\
**Replies:** 5\
**Last updated:** [July 6, 2024, 4:16am UTC](https://discuss.moonbitlang.com/t/the-moonbit-update-0617/251 "2024-07-06T04:16:09Z")

</div>

Language Update Supported error handling: Functions can now specify return types with error handling using the syntax Int!String. The following example means the function returns an Int under normal conditions, and th…

[Next page](https://discuss.moonbitlang.com/latest.md?page=1)
