Language Design
- Expressive multi-paradigm design, combining the best of dynamic and static, functional and practical
- Data-oriented language with a robust type system
- Multiple backend support including WebAssembly, JavaScript and more.

Fast, simple, and scale.


///|
fn main {
let name = "World!" // Define a variable
println("Hello, \{name}") // and use it directly
println("current count:")
let buf = @buffer.new()
for i in 1..<10 { // Loop over a range from 1 to 10
buf.write_string("\{i} ")
}
println(buf)
}///|
enum Resource {
Text(String)
CSV(content~ : String)
Executable
}
///|
let resources : Map[String, Resource] = {
"hello.txt": Text("Hello, world! A long text."),
"test.csv": CSV(content="name, age\nAlice, 25\nBob, 30"),
"ls.exe": Executable,
}
///|
fn main {
resources
.iter()
.filter_map(res => match res {
(name, Text(str)) | (name, CSV(content=str)) => Some((name, str))
(_, Executable) => None
})
.map(res => {
let (name, content) = res
let name = name.pad_start(10, ' ')
let content = try! content.pad_end(10, ' ').replace_all(old="\n", new=" ")[:10]
"\{name}: \{content} ..."
})
.intersperse("\n")
.fold(init="Summary:\n", String::add)
|> println
}
///|
const Zero = 0
///|
fn sign(x : Int) -> Int {
match x {
_..<Zero => -1
Zero => 0
Zero..<_ => 1
}
}
///|
fn classify_char(c : Char) -> String {
match c {
'a'..='z' => "lowercase"
'A'..='Z' => "uppercase"
'0'..='9' => "digit"
_ => "other"
}
}
///|
fn main {
sign(20) |> println
classify_char('X') |> println
}
///|
fn main {
let json_example : Json = {
"array": ["a", "b"],
"age": 22,
"name": "John",
"boolean": true,
}
let greeting = match json_example {
{ "age": Number(age, ..), "name": String(name), .. } =>
"Hello \{name}. You are \{age}"
_ => "not match"
}
greeting |> println
}


2023.8.18
2024, Q1
2024, Q3
2024, Q4
2025
February 9, 2026
February 6, 2026
MoonBit for Developers
John A De Goes, CEO @ZivergeTech, CEO @GolemCloud, OSS contributor @zioscala
MoonBit for Developers
Dmitrii Kovanikov, Functional Programming account #1. Senior SWE at Bloomberg.
Community Voice
From MoonBit Discord
Build A Simple Collaborative List Editor
Golem Cloud with MoonBit, by Daniel Vigovszky
MoonBit: Wasm-Optimized Language Creates Less Code Than Rust
The New Stack
MoonBit: Ideal for WebAssembly
mizchi, Frontend Developer