Some questions about Moonbit

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 parts as well, like the compiler, tooling etc.? I think open sourcing the VS Code plugin and also the compiler backends could generate some nice community contributions.
  • Why no unsigned integer types (not even byte/u8)? They can be very useful when interfacing with native code (like an LLVM backend).
  • Are there plans to add associated types for traits similar to what Rust has?
  • I find Rust’s if/while let syntax very useful. Any plans to add that?
  • Any plans to add iterators to the core library? It’s one of the best features of the Rust stdlib.
  • What other backends besides WASM have you planned for?
  • What’s the current GC algorithm that you use for WASM?
  • The front page indicates that a beta should be available Q2 2024 and v1.0 in Q3 2025. Is that really correct that you will be in beta for over a year?

Thanks for any insights you can provide!

Hello @jesnor, thanks for your interest in MoonBit!

  1. Open sourcing core is our first step. We will progressively open source more stuff as we are stabilizing the language features.
  2. Unsigned integers will be added when we support native backend. We currently only have signed integers for simplicity. The workaround is to use signed integers, and we have provided unsigned comparisons on them. Byte type will be added soon.
  3. No, at least not in the near future. We focus on simplicity of the language to make it easy to pick up for both human programmers and AI. If you have practical use cases which cannot be otherwise implemented, please let us know. We are happy to make adaptions based on feedbacks from our users at this stage.
  4. Not likely. You can check out the loop expressions in MoonBit, which provides a shorthand for pattern matchings.
  5. Yes, we are working on iterators. Stay tuned!
  6. We have just released the JS backend. We plan to support native and JVM backend in long term.
  7. Currently we are targeting wasm-gc.