From dcc1709d9e171c3fd6fbad2ab2b40fbe3bca5da0 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Wed, 10 Jun 2026 02:58:04 +0200 Subject: [PATCH] added blog and improved docs --- content/blog/new-release-10-jun-2026.mdx | 58 +++++++++++++++++++++ content/docs/components/classes.mdx | 9 ++++ content/docs/components/modules-imports.mdx | 34 ++++-------- 3 files changed, 78 insertions(+), 23 deletions(-) create mode 100644 content/blog/new-release-10-jun-2026.mdx diff --git a/content/blog/new-release-10-jun-2026.mdx b/content/blog/new-release-10-jun-2026.mdx new file mode 100644 index 0000000..bbcf2cb --- /dev/null +++ b/content/blog/new-release-10-jun-2026.mdx @@ -0,0 +1,58 @@ +--- +title: Mist 0.3.1-alpha.0 is released, huge changes +author: Klesti Selimaj +date: 2026-06-10 +--- + +## OOP / Inheritance +Inheritance is now fully supported, meaning you can change functions, however changes could still be made, and it's not fully robust. + +The OOP model is pretty simple, and clever, it's type safe, meaning that function signatures are checked. + +```mist +pub class Animal { + pub name String; + + constructor() { + self.name = "Rex".to_string(); + } + + pub fn speak(*self) { + println!("Unknown"); + } + + pub fn legs(*self) { + println!("Unknown"); + } +} + +pub class Dog : Animal { + constructor() { + super -> Super::new(); + } + + pub override fn speak(*self) { + println!("Woof!"); + } + + // Explicit override is useful for super inheritance + pub override(Animal) fn legs(*self) { + println!("4 legs"); + } +} +``` + +In the backend, it generates a V table, which is then indexed and replaced statically, meaning it's close to 0 cost abstractions. + +## Syntax rewrite + +The syntax now uses `type name` and is more similar to go than C, however the control flow is still C-like, and i will be refactoring that as well. +``` +let x = 10; // inference +let x *str = "hello Mist"; +``` + +Along with this, many bugs are fixed. + +## Module system +`pub mod my_mod;` still exists, but it's not needed at all, the module system reads your file structure and automatically adjusts parents. diff --git a/content/docs/components/classes.mdx b/content/docs/components/classes.mdx index 4a72edf..702e191 100644 --- a/content/docs/components/classes.mdx +++ b/content/docs/components/classes.mdx @@ -71,6 +71,10 @@ pub class Animal { pub fn speak(*self) { println!("Unknown"); } + + pub fn legs(*self) { + println!("Unknown"); + } } pub class Dog : Animal { @@ -81,6 +85,11 @@ pub class Dog : Animal { pub override fn speak(*self) { println!("Woof!"); } + + // Explicit override is useful for super inheritance + pub override(Animal) fn legs(*self) { + println!("4 legs"); + } } ``` diff --git a/content/docs/components/modules-imports.mdx b/content/docs/components/modules-imports.mdx index afaa570..37ecfe3 100644 --- a/content/docs/components/modules-imports.mdx +++ b/content/docs/components/modules-imports.mdx @@ -8,19 +8,7 @@ Mist organizes code through a file-system based module system with explicit path ## The Module System -Each `.mist` file in `src/` corresponds to a module. The module tree mirrors the file hierarchy. Directories can be declared as submodules using `mod`. - -### File-Based Modules - -The file `src/main.mist` is the crate root. Other files are discovered through `mod` declarations or by name. - -### Declaring Submodules - -```mist -// src/main.mist -mod network; -mod database; -``` +Each `.mist` file in `src/` corresponds to a module. and a `directory/package.mist` is a package like mod.rs, packages don't need `package.mist` to be functional, as long as a `.mist` file exists it will map it to pacakge_name::file_name. ## Imports @@ -65,17 +53,17 @@ my-project/ ├── Cargo.toml ├── src/ │ ├── main.mist -│ ├── lib/ -│ │ ├── parser.mist -│ │ └── helper.rs -│ └── _header.rs +│ ├── my_api/ +│ │ ├── package.mist +│ │ ├── methods.mist +│ │ └── utils.mist └── .mist/ └── src/ - ├── main.rs # transpiled output - ├── lib/ - │ ├── parser.rs - │ └── helper.rs - └── _header.rs + ├── main.rs + └── my_api/ + ├── mod.rs + ├── methods.rs + └── utils.rs ``` -The `.mist/src/` directory contains the transpiled Rust output. `_header.rs` is a special file that provides IDE support for Rust Analyzer. +The `.mist/src/` directory contains the transpiled Rust output.