Get started
This commit is contained in:
@@ -0,0 +1,66 @@
|
|||||||
|
---
|
||||||
|
title: Get Started
|
||||||
|
description: Install Mist and run your first program.
|
||||||
|
icon: Download
|
||||||
|
---
|
||||||
|
|
||||||
|
# Get Started
|
||||||
|
|
||||||
|
This guide will help you install the Mist CLI, understand its basic commands, and compile your first program.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Mist is distributed through Cargo.
|
||||||
|
|
||||||
|
Install the Mist compiler using:
|
||||||
|
|
||||||
|
```bash title="Terminal"
|
||||||
|
cargo install [email protected]
|
||||||
|
```
|
||||||
|
|
||||||
|
Verify using
|
||||||
|
|
||||||
|
```bash title="Terminal"
|
||||||
|
mist version
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```bash title="Compiles the project in the current directory"
|
||||||
|
mist build
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash title="Prints the compiler version"
|
||||||
|
mist version
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash title="Shows the help message and available commands"
|
||||||
|
mist help
|
||||||
|
```
|
||||||
|
|
||||||
|
## Hello World
|
||||||
|
|
||||||
|
On your existing cargo project project (`cargo init` or `cargo new <name>`).
|
||||||
|
|
||||||
|
```json title="mist.json"
|
||||||
|
{
|
||||||
|
"src": "src",
|
||||||
|
"output": "build"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml title="Cargo.toml"
|
||||||
|
[[bin]]
|
||||||
|
name = "main"
|
||||||
|
path = "build/main.rs"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash title=".gitignore"
|
||||||
|
/build
|
||||||
|
```
|
||||||
|
|
||||||
|
```cpp title="src/main.mist"
|
||||||
|
void main() {
|
||||||
|
println!("Hello World!");
|
||||||
|
}
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user