Updated intro

This commit is contained in:
2026-07-03 09:31:27 +02:00
parent 68830f0d7b
commit a604fc0caa
4 changed files with 28 additions and 82 deletions
+24 -40
View File
@@ -26,36 +26,15 @@ mist version
---
## 2. Setting Up Your Cargo Project
Mist works alongside Cargo to handle the heavy lifting. Use `cargo new` or `cargo init` to scaffold a new project:
```bash title="Terminal"
cargo new my-mist-app
cd my-mist-app
## 2. Setting Up Your Mist Project
```bash
mist new mist-hello-world
```
or
```bash
mist init
```
This creates a `src/main.mist` and wires up the output directory (`.mist/src/`) in your `Cargo.toml`.
### 3. Adding mist to your Cargo project
Mist needs a `Mist.toml` in the root of the project (Alongside `Cargo.toml`) to know what to transpile as the main file (eg. main.mist, lib.mist).
```toml title="Mist.toml"
# main.mist is now the main package
package = "main.mist"
# Side packages that work as cargo binaries
packages = []
```
Source files go in `src/` and the transpiled output goes to `.mist/src/`. Non-Mist files in `src/` (e.g. Rust sidecar files) are copied through as-is.
---
## 4. Your First Program
Create a new file at `src/main.mist` and add the following code:
```mist title="src/main.mist"
void main() {
@@ -63,13 +42,10 @@ void main() {
}
```
### Build and Run
### 3. Build and Run
```bash title="Terminal"
mist run # or: mist r
mist build # or: mist b
mist check # or: mist c
mist transpile # or: mist t
mist run
```
---
@@ -78,10 +54,18 @@ mist transpile # or: mist t
| Command | Alias | Description |
| -------------------- | ----- | ----------------------------------------------- |
| `mist init` | | Initializes a new Mist project (Deprecated) |
| `mist run` | `r` | Runs the project in the current directory |
| `mist build` | `b` | Builds the project in the current directory |
| `mist transpile` | `t` | Transpiles the project in the current directory |
| `mist check` | `c` | Checks the project in the current directory |
| `mist version` | `-v` | Prints the compiler version |
| `mist help` | `-h` | Prints this message |
| mist run |r| |run the project |
| mist build |b| |build the project |
| mist test| |test the project |
| mist publish| |publish the project |
| mist bench| |benchmark the project |
| mist doc| |build documentation |
| mist fix| |automatically fix warnings |
| mist clippy| |lint the project |
| mist check |c |check the project |
| mist clean| |clean build artifacts |
| mist transpile, |t |transpile the project |
| mist init| |initialize a project in the current folder |
| mist new| |create a new project |
| mist version| |print the compiler version |
| mist help| |print this message |