# General

**URL:** https://discuss.moonbitlang.com/c/general/4.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…

---

## [About the General category](https://discuss.moonbitlang.com/t/about-the-general-category/3)

<div class="topic-metadata">

**Author:** [@system](https://discuss.moonbitlang.com/u/system)\
**Replies:** 0

</div>

---

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

<div class="topic-metadata">

**Author:** [@hu0118](https://discuss.moonbitlang.com/u/hu0118)\
**Replies:** 1\
**Last updated:** [November 19, 2026, 6:50pm UTC](https://discuss.moonbitlang.com/t/topic/369 "2026-11-19T18:50:40Z")

</div>

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

---

## [在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…

---

## [\[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…

---

## [Questions on production apps in the future and integrations](https://discuss.moonbitlang.com/t/questions-on-production-apps-in-the-future-and-integrations/228)

<div class="topic-metadata">

**Author:** [@morpheo](https://discuss.moonbitlang.com/u/morpheo)\
**Replies:** 4\
**Last updated:** [June 30, 2024, 2:07am UTC](https://discuss.moonbitlang.com/t/questions-on-production-apps-in-the-future-and-integrations/228 "2024-06-30T02:07:30Z")

</div>

Are there more details on what the concurrency model will be in the future? (cooperate async/await or not, parallelism etc.) Since the plan is to align with the wasm proposal it’s probably far away in the future but …

---

## [Misc syntax questions](https://discuss.moonbitlang.com/t/misc-syntax-questions/226)

<div class="topic-metadata">

**Author:** [@morpheo](https://discuss.moonbitlang.com/u/morpheo)\
**Replies:** 2\
**Last updated:** [May 19, 2024, 6:36am UTC](https://discuss.moonbitlang.com/t/misc-syntax-questions/226 "2024-05-19T06:36:27Z")

</div>

Since Moonbit feels Rusty, curious to know if Moonbit aims to align with the following in the future or if the goal is actually not to do it due to particular reasons: In terms of syntax, it was really great to see the…

---

## [How to write external functions, variables, classes from third party js libraries when targetting to js](https://discuss.moonbitlang.com/t/how-to-write-external-functions-variables-classes-from-third-party-js-libraries-when-targetting-to-js/216)

<div class="topic-metadata">

**Author:** [@Mng12345](https://discuss.moonbitlang.com/u/Mng12345)\
**Replies:** 2\
**Last updated:** [April 30, 2024, 3:34am UTC](https://discuss.moonbitlang.com/t/how-to-write-external-functions-variables-classes-from-third-party-js-libraries-when-targetting-to-js/216 "2024-04-30T03:34:49Z")

</div>

As the title described.

---

## [Invalid function name when compiling to js](https://discuss.moonbitlang.com/t/invalid-function-name-when-compiling-to-js/193)

<div class="topic-metadata">

**Author:** [@Mng12345](https://discuss.moonbitlang.com/u/Mng12345)\
**Replies:** 1\
**Last updated:** [March 27, 2024, 6:20am UTC](https://discuss.moonbitlang.com/t/invalid-function-name-when-compiling-to-js/193 "2024-03-27T06:20:10Z")

</div>

The moon-playground is my project name.

---

## [How to use wasm-simd in moonbit?](https://discuss.moonbitlang.com/t/how-to-use-wasm-simd-in-moonbit/192)

<div class="topic-metadata">

**Author:** [@Mng12345](https://discuss.moonbitlang.com/u/Mng12345)\
**Replies:** 0\
**Last updated:** [March 26, 2024, 2:59am UTC](https://discuss.moonbitlang.com/t/how-to-use-wasm-simd-in-moonbit/192 "2024-03-26T02:59:55Z")

</div>

As far as i know, the wasm simd was supportted in 2020, and currently it is not an easy way to use wasm-simd in rust, may be this is a shinny point if moonbit supports wasm-simd.

---

## [Is there alternative syntax for grouping methods of same struct/enum?](https://discuss.moonbitlang.com/t/is-there-alternative-syntax-for-grouping-methods-of-same-struct-enum/180)

<div class="topic-metadata">

**Author:** [@tiye](https://discuss.moonbitlang.com/u/tiye)\
**Replies:** 2\
**Last updated:** [March 20, 2024, 11:17am UTC](https://discuss.moonbitlang.com/t/is-there-alternative-syntax-for-grouping-methods-of-same-struct-enum/180 "2024-03-20T11:17:54Z")

</div>

current method system defines methods directly like a function: fn map\[X, Y\](self: MyList\[X\], f: (X) -\> Y) -\> List\[Y\] { ... } and we may have many functions for a single struct or enum. while it’s more convenient to a…

---

## [Some questions about Moonbit](https://discuss.moonbitlang.com/t/some-questions-about-moonbit/181)

<div class="topic-metadata">

**Author:** [@jesnor](https://discuss.moonbitlang.com/u/jesnor)\
**Replies:** 1\
**Last updated:** [March 18, 2024, 3:03am UTC](https://discuss.moonbitlang.com/t/some-questions-about-moonbit/181 "2024-03-18T03:03:25Z")

</div>

Hi, Moonbit looks interesting, I like the Rust influence, the fast compilation and WASM targetting. I have some questions: I saw that you have open sourced the core library. Are there any plans to open source other par…

---

## [Pipe operator can not be applied to \`Some\` variant](https://discuss.moonbitlang.com/t/pipe-operator-can-not-be-applied-to-some-variant/163)

<div class="topic-metadata">

**Author:** [@Mng12345](https://discuss.moonbitlang.com/u/Mng12345)\
**Replies:** 1\
**Last updated:** [February 27, 2024, 1:57am UTC](https://discuss.moonbitlang.com/t/pipe-operator-can-not-be-applied-to-some-variant/163 "2024-02-27T01:57:07Z")

</div>

playground type ParsedValue\[V\] Result\[(V, String), String\] fn ParsedValue::to\_string\[V : Show\](self : ParsedValue\[V\]) -\> String { match self { ParsedValue(Ok(curr, rest)) =\> "Ok(\\(curr), \\(rest))" ParsedValue…

---

## [Got error when initialize Moonbit Server](https://discuss.moonbitlang.com/t/got-error-when-initialize-moonbit-server/162)

<div class="topic-metadata">

**Author:** [@Mng12345](https://discuss.moonbitlang.com/u/Mng12345)\
**Replies:** 3\
**Last updated:** [February 22, 2024, 8:20am UTC](https://discuss.moonbitlang.com/t/got-error-when-initialize-moonbit-server/162 "2024-02-22T08:20:04Z")

</div>

This may be because of using the not compatible api of high version nodejs

---

## [Improve the interoperability with js](https://discuss.moonbitlang.com/t/improve-the-interoperability-with-js/157)

<div class="topic-metadata">

**Author:** [@Mng12345](https://discuss.moonbitlang.com/u/Mng12345)\
**Replies:** 1\
**Last updated:** [February 1, 2024, 2:11am UTC](https://discuss.moonbitlang.com/t/improve-the-interoperability-with-js/157 "2024-02-01T02:11:29Z")

</div>

Currently, moonbit can call simple functions from js side with ffi, this ability is not enough in some complex situtations. Eg. There is a function takes a parameter which has Function type, it can not be called from mo…

---

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

<div class="topic-metadata">

**Author:** [@jodie](https://discuss.moonbitlang.com/u/jodie)\
**Replies:** 0\
**Last updated:** [January 8, 2024, 9:32am UTC](https://discuss.moonbitlang.com/t/the-moonbit-update-0108/151 "2024-01-08T09:32:04Z")

</div>

MoonBit Update Now we have removed the interface keyword officially, replacing it with trait. Based on community feedback, we’ve introduced the syntax let mu t id = expr to replace var id = expr. Support for var…

---

## [Why not Reason's \`-\>\` for the method syntax?](https://discuss.moonbitlang.com/t/why-not-reasons-for-the-method-syntax/128)

<div class="topic-metadata">

**Author:** [@tmke8](https://discuss.moonbitlang.com/u/tmke8)\
**Replies:** 1\
**Last updated:** [December 18, 2023, 3:14am UTC](https://discuss.moonbitlang.com/t/why-not-reasons-for-the-method-syntax/128 "2023-12-18T03:14:48Z")

</div>

This would allow using it with imported functions: a-\>@lib.method(3) Also, it wouldn’t lead to conflicts with field names: struct User { id: Int name: String mut email: String } fn name(self: User) -\> String { …

---

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

<div class="topic-metadata">

**Author:** [@jodie](https://discuss.moonbitlang.com/u/jodie)\
**Replies:** 0\
**Last updated:** [October 9, 2023, 8:51am UTC](https://discuss.moonbitlang.com/t/the-moonbit-update-1009/89 "2023-10-09T08:51:43Z")

</div>

In August 2023, MoonBit underwent Alpha testing. This post aims to introduce recent updates to MoonBit’s language and toolchain, along with applications developed using MoonBit. Changes in MoonBit Language 1. MoonBit In…

---

## [Moonbit Weekly Update——0911](https://discuss.moonbitlang.com/t/moonbit-weekly-update-0911/76)

<div class="topic-metadata">

**Author:** [@jodie](https://discuss.moonbitlang.com/u/jodie)\
**Replies:** 1\
**Last updated:** [September 12, 2023, 10:27am UTC](https://discuss.moonbitlang.com/t/moonbit-weekly-update-0911/76 "2023-09-12T10:27:48Z")

</div>

Moonbit was introduced to the public last month, and we received a lot of positive feedback. This post is intended to provide updates on the changes to Moonbit’s language and build system over the past week. Changes in …

---

## [How did you embed VS Code on try.moonbitlang.com?](https://discuss.moonbitlang.com/t/how-did-you-embed-vs-code-on-try-moonbitlang-com/54)

<div class="topic-metadata">

**Author:** [@brianjenkins94](https://discuss.moonbitlang.com/u/brianjenkins94)\
**Replies:** 1\
**Last updated:** [August 22, 2023, 6:47am UTC](https://discuss.moonbitlang.com/t/how-did-you-embed-vs-code-on-try-moonbitlang-com/54 "2023-08-22T06:47:17Z")

</div>

I’m working on something similar using GitHub - CodinGame/monaco-vscode-api: VSCode public API plugged on the monaco editor but it’s been pretty challenging to work with so far. Just curious to know how you’ve embedded …
