MoonBit Language plugin in Visual Studio Codeβ
You can install it from the VS Code marketplace. This plugin provides a rich development environment for MoonBit, including functionalities like syntax highlighting, code completion, and more.
Instructionsβ
Step 1: Install the latest VS Code version.
Step 2: Click Extension on the left, search "MoonBit" and install VS Code MoonBit extension.
Step 3: Press the shift+cmd+p
shortcut (for Mac, use ctrl+shift+p
on Windows or Linux), and type MoonBit:install latest moonbit toolchain
. Then a prompt will appear, click "Yes" and wait for the program to download.
Step 4: After the download is complete, open the terminal and enter moon new hello ; code hello
to create and open a new project.
Step 5: Once the project is launched, open the terminal again and enter the moon run main
command to start executing the code.
MoonBit CLI Toolsβ
To download and install MoonBit, run the following in your terminal, then follow the on-screen instructions.
- Linux & macOS
- Windows
This command line tool is needed for creating and managing MoonBit projects.
Use moon help
to view the usage instructions.
$ moon help
Moonbit's build system
Usage: moon <COMMAND>
Commands:
build Build the current package
check Check the current package, but don't build object files
run Run WebAssembly module
clean Remove the target directory
new Create a new moonbit package
bench Generate build matrix for benchmarking
fmt Format moonbit
version Print version info and exit
test Run the tests
login Log in to your account
register Register an account on mooncakes.io
publish Publish the current package
add Add a new dependency
remove Remove a dependency
tree Display the dependency tree
update Update index
doc Generate documentation
install Install dependencies
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
Verifying binariesβ
We provide .sha256
file with SHA checksums for downloaded binaries.
To download .sha256
file using curl
(or using Invoke-WebRequest
on windows):
- Apple Silicon MacOS
- Intel MacOS
- x86-64 Ubuntu 20.04
- Windows
To check that the downloaded binaries match the checksums, run it through sha256sum
with a command such as:
curl https://cli.moonbitlang.com/binaries/latest/moonbit-darwin-aarch64.sha256 | sha256sum -c -