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 ## 2. Setting Up Your Mist Project
```bash
Mist works alongside Cargo to handle the heavy lifting. Use `cargo new` or `cargo init` to scaffold a new project: mist new mist-hello-world
```
```bash title="Terminal" or
cargo new my-mist-app ```bash
cd my-mist-app 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" ```mist title="src/main.mist"
void main() { void main() {
@@ -63,13 +42,10 @@ void main() {
} }
``` ```
### Build and Run ### 3. Build and Run
```bash title="Terminal" ```bash title="Terminal"
mist run # or: mist r mist run
mist build # or: mist b
mist check # or: mist c
mist transpile # or: mist t
``` ```
--- ---
@@ -78,10 +54,18 @@ mist transpile # or: mist t
| Command | Alias | Description | | Command | Alias | Description |
| -------------------- | ----- | ----------------------------------------------- | | -------------------- | ----- | ----------------------------------------------- |
| `mist init` | | Initializes a new Mist project (Deprecated) | | mist run |r| |run the project |
| `mist run` | `r` | Runs the project in the current directory | | mist build |b| |build the project |
| `mist build` | `b` | Builds the project in the current directory | | mist test| |test the project |
| `mist transpile` | `t` | Transpiles the project in the current directory | | mist publish| |publish the project |
| `mist check` | `c` | Checks the project in the current directory | | mist bench| |benchmark the project |
| `mist version` | `-v` | Prints the compiler version | | mist doc| |build documentation |
| `mist help` | `-h` | Prints this message | | 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 |
+1 -1
View File
@@ -4,7 +4,7 @@ description: Understanding the Alpha state of Mist and our technical roadmap.
icon: TriangleAlert icon: TriangleAlert
--- ---
Mist is currently in a **Volatile Alpha** stage (latest: v0.3.7-alpha.0). Our current priority is exploring **Syntax and Features**. We believe in stabilizing the developer experience and the "feel" of the language before locking in the deep architectural logic of the compiler. Mist is currently in a **Volatile Alpha** stage (latest: v0.3.8-alpha.0). Our current priority is exploring **Syntax and Features**. We believe in stabilizing the developer experience and the "feel" of the language before locking in the deep architectural logic of the compiler.
The compiler, transpiler, and CLI are partially bootstrapped — written in Mist itself. This gives us real-world feedback on every language design decision. The compiler, transpiler, and CLI are partially bootstrapped — written in Mist itself. This gives us real-world feedback on every language design decision.
+2 -40
View File
@@ -14,49 +14,11 @@ All of your favorite Rust libraries work with Mist. It is designed for **low-lev
Mist is meant to feel like C++ but **be** Rust. It bridges the gap between the ergonomics of a classic systems language and the safety guarantees of Rust's ownership model. Mist is meant to feel like C++ but **be** Rust. It bridges the gap between the ergonomics of a classic systems language and the safety guarantees of Rust's ownership model.
### Type-First Syntax
Low-level and embedded development demands clarity about what your data is. Mist puts the **type first** — before the name — so declarations read naturally:
```mist
i32 score = 100;
Vec<String> args = env::args().collect();
void* data = allocate(size);
```
This mirrors C/C++ declaration syntax, making Mist instantly familiar to embedded and systems programmers while compiling into Rust's strict type system.
### C-Style Functions
Functions use the return type before the name — no `fn` keyword needed:
```mist
i32 add(i32 a, i32 b) {
a + b
}
void log(message *str) {
println!("{}", message);
}
```
Every function maps directly to a Rust `fn` underneath.
### Minimal Friction
* No `let` keyword — `Type name = value` is all you need.
* Consistent `name Type` convention across parameters, fields, and locals.
* Explicit pointers with `*T` and `*mut T` — clear intent without ceremony.
* String references use `str&` for a natural left-to-right read.
---
## Built for Low-Level and Embedded ## Built for Low-Level and Embedded
Mist is designed from the ground up for systems where resources are constrained and control is required: Mist is designed from the ground up for systems where resources are constrained and control is required:
* **No runtime** — no garbage collector, no hidden allocator, no VM. * **No runtime** — no garbage collector, no hidden allocator, no VM.
* **Direct memory control** — explicit pointers, manual allocation, predictable layout.
* **Zero-cost abstractions** — classes, traits, and generics all resolve at compile time. * **Zero-cost abstractions** — classes, traits, and generics all resolve at compile time.
* **Works with existing Cargo tooling** — use any Rust crate as a library. * **Works with existing Cargo tooling** — use any Rust crate as a library.
@@ -74,11 +36,11 @@ Mist is not a replacement for Rust; it is an **ergonomic interface** for it. It
## Bootstrapped Development ## Bootstrapped Development
Mist is partially bootstrapped — the compiler's CLI, transpiler, and analyzer modules are written in Mist itself. This gives us first-hand experience with the language's ergonomics and drives real-world improvements with every release. Mist is partially bootstrapped — the compiler's CLI and transpiler modules are written in Mist itself. This gives us first-hand experience with the language's ergonomics and drives real-world improvements with every release.
## Why Mist? ## Why Mist?
* **Familiarity:** C/C++ developers can be productive immediately — no new optical model to learn. * **Familiarity:** C/C++ developers can be productive immediately — no new optical model to learn (Note: Rust's semantics still need to be learned).
* **Safety:** Rust's borrow checker and type system under every expression, no exceptions. * **Safety:** Rust's borrow checker and type system under every expression, no exceptions.
* **Control:** Explicit types, explicit pointers, explicit allocation — nothing hidden. * **Control:** Explicit types, explicit pointers, explicit allocation — nothing hidden.
* **Ecosystem:** The entire Rust crate ecosystem available at your fingertips. * **Ecosystem:** The entire Rust crate ecosystem available at your fingertips.
+1 -1
View File
@@ -173,7 +173,7 @@ export default function HomePage() {
return ( return (
<div className="h-[calc(100vh-58px)] overflow-auto snap-y snap-mandatory scroll-smooth no-scrollbar relative flex flex-col xl:flex-row"> <div className="h-[calc(100vh-58px)] overflow-auto snap-y snap-mandatory scroll-smooth no-scrollbar relative flex flex-col xl:flex-row">
<div className="hidden pointer-events-none sticky top-0 right-0 z-50 md:flex order-first xl:order-last w-full xl:w-[40vw] h-svh items-center justify-center p-10 no-scrollbar"> <div className="hidden pointer-events-none sticky top-0 right-0 z-50 xl:flex order-first xl:order-last w-full xl:w-[40vw] h-svh items-center justify-center p-10 no-scrollbar">
<div className="w-full max-w-2xl overflow-hidden no-scrollbar"> <div className="w-full max-w-2xl overflow-hidden no-scrollbar">
<motion.div <motion.div
className="will-change-transform transform-gpu w-full h-auto border border-fd-border p-5 rounded-xl min-h-24 backdrop-blur bg-black dark:bg-black/20 pointer-events-auto" className="will-change-transform transform-gpu w-full h-auto border border-fd-border p-5 rounded-xl min-h-24 backdrop-blur bg-black dark:bg-black/20 pointer-events-auto"