From a604fc0caad8dd7d4302e7b75b10f6d73e377d81 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Fri, 3 Jul 2026 09:31:27 +0200 Subject: [PATCH] Updated intro --- content/docs/index.mdx | 64 ++++++++++++++---------------------- content/docs/limitations.mdx | 2 +- content/docs/philosophy.mdx | 42 ++--------------------- src/app/(home)/page.tsx | 2 +- 4 files changed, 28 insertions(+), 82 deletions(-) diff --git a/content/docs/index.mdx b/content/docs/index.mdx index ecb4092..c9a34de 100644 --- a/content/docs/index.mdx +++ b/content/docs/index.mdx @@ -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 | diff --git a/content/docs/limitations.mdx b/content/docs/limitations.mdx index ba296ae..2af09d0 100644 --- a/content/docs/limitations.mdx +++ b/content/docs/limitations.mdx @@ -4,7 +4,7 @@ description: Understanding the Alpha state of Mist and our technical roadmap. 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. diff --git a/content/docs/philosophy.mdx b/content/docs/philosophy.mdx index abab179..26ec027 100644 --- a/content/docs/philosophy.mdx +++ b/content/docs/philosophy.mdx @@ -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. -### 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 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 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. -* **Direct memory control** — explicit pointers, manual allocation, predictable layout. * **Zero-cost abstractions** — classes, traits, and generics all resolve at compile time. * **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 -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? -* **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. * **Control:** Explicit types, explicit pointers, explicit allocation — nothing hidden. * **Ecosystem:** The entire Rust crate ecosystem available at your fingertips. diff --git a/src/app/(home)/page.tsx b/src/app/(home)/page.tsx index ddef00d..b0cff9d 100644 --- a/src/app/(home)/page.tsx +++ b/src/app/(home)/page.tsx @@ -173,7 +173,7 @@ export default function HomePage() { return (
-
+