Small refactor to intro

This commit is contained in:
2026-05-12 03:15:23 +02:00
parent e3413d05ce
commit 71016127f5
5 changed files with 124 additions and 121 deletions
-97
View File
@@ -1,97 +0,0 @@
---
title: Get Started
description: This guide will walk you through installing the Mist CLI, setting up your development environment, and compiling your very first program.
icon: Rocket
---
## 1. Installation
Mist is currently distributed as a Cargo crate. To get started, you'll need to have the Rust toolchain installed.
Run the following command to install the Mist compiler:
```bash title="Terminal"
cargo install [email protected]
```
Once the installation finishes, verify it by checking the version:
```bash title="Terminal"
mist version
```
---
## 2. Setting Up Your Project
Mist works alongside Cargo to handle the heavy lifting. Follow these steps to prepare your environment for your first "Hello World" program.
### Initialize a New Project
If you haven't already, create a new Cargo project and navigate into the directory:
```bash title="Terminal"
cargo new my-mist-app
cd my-mist-app
```
### Configure Mist
Create a `mist.json` file in your root directory. This tells the compiler where to look for your source code and where to place the generated Rust files.
```json title="mist.json"
{
"src": "src",
"output": "build"
}
```
### Link Cargo to Mist
Since Mist compiles down to Rust, you need to point Cargo to the generated output. Update your `Cargo.toml` to include the following:
```toml title="Cargo.toml"
[[bin]]
name = "main"
path = "build/main.rs"
```
> **Pro Tip:** You’ll probably want to add `/build` to your `.gitignore` file to keep your repository clean!
---
## 3. Your First Program
Now for the fun part! Create a new file at `src/main.mist` and add the following code:
```cpp title="src/main.mist"
void main() {
println!("Hello World!");
}
```
### Build and Run
To turn your Mist code into an executable, use the `build` command:
```bash title="Terminal"
mist build
```
Once the build is successful, you can run your program using standard Cargo commands:
```bash title="Terminal"
cargo run
```
> **Pro Tip:** If you encounter any rust errors, head to the build directory and analyze the output, if you see anything unusual in the output, report the issue at https://github.com/mist-go/mist
---
## Command Reference
| Command | Description |
| -------------- | ---------------------------------------------------------------- |
| `mist build` | Compiles your `.mist` files into Rust code in the output folder. |
| `mist version` | Displays the current version of the Mist compiler. |
| `mist help` | Stuck? Use this to see all available commands and options. |
+66 -21
View File
@@ -1,52 +1,97 @@
---
title: Philosophy
description: Discover the philosophy and architecture behind Mist.
icon: Brain
title: Get Started
description: This guide will walk you through installing the Mist CLI, setting up your development environment, and compiling your very first program.
icon: Rocket
---
**Mist** is a systems programming language that compiles directly into Rust.
## 1. Installation
It was designed to make high-performance development feel more direct and less mentally taxing, without compromising on the safety, performance, or ecosystem richness that Rust provides.
Mist is currently distributed as a Cargo crate. To get started, you'll need to have the Rust toolchain installed.
Mist is not a replacement for Rust. Instead, it serves as a more ergonomic surface layer for writing Rust-compatible systems code. It allows you to focus on the "what" while the compiler handles the "how" of idiomatic Rust generation.
Run the following command to install the Mist compiler:
```bash title="Terminal"
cargo install [email protected]
```
Once the installation finishes, verify it by checking the version:
```bash title="Terminal"
mist version
```
---
## Philosophy: Systems Programming, Refined
## 2. Setting Up Your Project
Mist is built on the belief that systems programming should feel **calm, predictable, and easy to reason about**.
Mist works alongside Cargo to handle the heavy lifting. Follow these steps to prepare your environment for your first "Hello World" program.
When working close to the metal, developers must balance performance, correctness, and structure. As projects scale, the "expression overhead"—the mental energy required to satisfy complex syntax—often creates friction. Mist reduces this friction by:
### Initialize a New Project
* **Focusing on Flow:** Code should feel direct to write and require minimal "re-contextualization" when revisited months later.
If you haven't already, create a new Cargo project and navigate into the directory:
```bash title="Terminal"
cargo new my-mist-app
cd my-mist-app
```
* **Reducing Mental Friction:** By simplifying the surface syntax, your attention stays on solving the problem, not fighting the mechanics of expression.
### Configure Mist
Create a `mist.json` file in your root directory. This tells the compiler where to look for your source code and where to place the generated Rust files.
* **Predictable Abstractions:** Every feature in Mist is designed to be transparent, ensuring you always understand the underlying system behavior.
```json title="mist.json"
{
"src": "src",
"output": "build"
}
```
### Link Cargo to Mist
Since Mist compiles down to Rust, you need to point Cargo to the generated output. Update your `Cargo.toml` to include the following:
```toml title="Cargo.toml"
[[bin]]
name = "main"
path = "build/main.rs"
```
> **Pro Tip:** You’ll probably want to add `/build` to your `.gitignore` file to keep your repository clean!
---
## What Mist Is
## 3. Your First Program
Mist is a compiled-to-Rust language specifically engineered for developers who need Rust's power but want a leaner authoring experience.
Now for the fun part! Create a new file at `src/main.mist` and add the following code:
### Key Characteristics:
```cpp title="src/main.mist"
void main() {
println!("Hello World!");
}
```
* **Native Ecosystem Integration:** Mist integrates directly with Cargo and existing Rust crates.
### Build and Run
To turn your Mist code into an executable, use the `build` command:
* **Idiomatic Output:** It compiles into clean, readable Rust code rather than opaque machine logic.
```bash title="Terminal"
mist build
```
Once the build is successful, you can run your program using standard Cargo commands:
* **Zero-Cost Performance:** There is no runtime, no garbage collector, and no performance penalty.
```bash title="Terminal"
cargo run
```
> **Pro Tip:** If you encounter any rust errors, head to the build directory and analyze the output, if you see anything unusual in the output, report the issue at https://github.com/mist-go/mist
* **Grounded Safety:** Mist remains fully powered by Rust’s type system and execution model.
---
## Command Reference
Mist is especially valuable for large-scale codebases where readability is paramount, but the strict guarantees of a systems language are non-negotiable.
| Command | Description |
| -------------- | ---------------------------------------------------------------- |
| `mist build` | Compiles your `.mist` files into Rust code in the output folder. |
| `mist version` | Displays the current version of the Mist compiler. |
| `mist help` | Stuck? Use this to see all available commands and options. |
+1 -1
View File
@@ -2,7 +2,7 @@
"pages": [
"---[Rocket]Introduction---",
"index",
"get-started",
"philosophy",
"limitations",
"---[Box]Components---",
+52
View File
@@ -0,0 +1,52 @@
---
title: Philosophy
description: Discover the philosophy and architecture behind Mist.
icon: Brain
---
**Mist** is a systems programming language that compiles directly into Rust.
It was designed to make high-performance development feel more direct and less mentally taxing, without compromising on the safety, performance, or ecosystem richness that Rust provides.
Mist is not a replacement for Rust. Instead, it serves as a more ergonomic surface layer for writing Rust-compatible systems code. It allows you to focus on the "what" while the compiler handles the "how" of idiomatic Rust generation.
---
## Philosophy: Systems Programming, Refined
Mist is built on the belief that systems programming should feel **calm, predictable, and easy to reason about**.
When working close to the metal, developers must balance performance, correctness, and structure. As projects scale, the "expression overhead"—the mental energy required to satisfy complex syntax—often creates friction. Mist reduces this friction by:
* **Focusing on Flow:** Code should feel direct to write and require minimal "re-contextualization" when revisited months later.
* **Reducing Mental Friction:** By simplifying the surface syntax, your attention stays on solving the problem, not fighting the mechanics of expression.
* **Predictable Abstractions:** Every feature in Mist is designed to be transparent, ensuring you always understand the underlying system behavior.
---
## What Mist Is
Mist is a compiled-to-Rust language specifically engineered for developers who need Rust's power but want a leaner authoring experience.
### Key Characteristics:
* **Native Ecosystem Integration:** Mist integrates directly with Cargo and existing Rust crates.
* **Idiomatic Output:** It compiles into clean, readable Rust code rather than opaque machine logic.
* **Zero-Cost Performance:** There is no runtime, no garbage collector, and no performance penalty.
* **Grounded Safety:** Mist remains fully powered by Rust’s type system and execution model.
Mist is especially valuable for large-scale codebases where readability is paramount, but the strict guarantees of a systems language are non-negotiable.
+5 -2
View File
@@ -175,7 +175,7 @@ function ShowSection({
<MotionLink
variants={item}
className="bg-fd-primary/15 text-fd-primary/90 p-3 px-4.5 rounded-xl cursor-pointer hover:bg-fd-primary/20 hover:text-fd-primary flex gap-2 items-center"
href="/docs/get-started"
href="/docs"
>
<RocketIcon className="w-5 h-5" />
Get Started
@@ -244,7 +244,10 @@ export default function HomePage() {
}}
className="flex flex-col items-center gap-1 text-muted-foreground"
>
<ChevronsDownIcon className="h-6 w-6 text-fd-primary" strokeWidth={1.5} />
<ChevronsDownIcon
className="h-6 w-6 text-fd-primary"
strokeWidth={1.5}
/>
</motion.div>
</motion.div>
</div>