MoonBit Language Tour MoonBit

Welcome to the MoonBit language tour! 💫

This tour covers the basics of the MoonBit language, and assumes you have some prior programming experience. It will help you quickly get familiar with and start using MoonBit.

This tutorial is interactive! The code shown is editable and will be compiled and evaluated in real time as you type. Anything you print using println will appear in the section at the bottom. The tutorial also enables "value tracking" by default: it will track variables encountered during program execution and display their values in purple tooltips alongside the code. To run MoonBit code, this tutorial compiles MoonBit to wasm gc and executes it—all within your browser.

If at any point you get stuck or have a question do not hesitate to ask in the MoonBit Discord server. We're here to help, and if you find something confusing then it's likely others will too, and we want to know about it so we can improve the tour.

OK, let's go. Click "Next" to begin, or use the menu in the upper right corner to browse all topics.

fn main {
  let a = "hello"
  println(a)
}