added blog and improved docs

This commit is contained in:
2026-06-10 02:58:04 +02:00
parent cb5974cc74
commit dcc1709d9e
3 changed files with 78 additions and 23 deletions
+58
View File
@@ -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.
+9
View File
@@ -71,6 +71,10 @@ pub class Animal {
pub fn speak(*self) { pub fn speak(*self) {
println!("Unknown"); println!("Unknown");
} }
pub fn legs(*self) {
println!("Unknown");
}
} }
pub class Dog : Animal { pub class Dog : Animal {
@@ -81,6 +85,11 @@ pub class Dog : Animal {
pub override fn speak(*self) { pub override fn speak(*self) {
println!("Woof!"); println!("Woof!");
} }
// Explicit override is useful for super inheritance
pub override(Animal) fn legs(*self) {
println!("4 legs");
}
} }
``` ```
+11 -23
View File
@@ -8,19 +8,7 @@ Mist organizes code through a file-system based module system with explicit path
## The Module System ## 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`. 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.
### 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;
```
## Imports ## Imports
@@ -65,17 +53,17 @@ my-project/
├── Cargo.toml ├── Cargo.toml
├── src/ ├── src/
│ ├── main.mist │ ├── main.mist
│ ├── lib/ │ ├── my_api/
│ │ ├── parser.mist │ │ ├── package.mist
│ │ └── helper.rs │ │ ├── methods.mist
│ └── _header.rs │ │ └── utils.mist
└── .mist/ └── .mist/
└── src/ └── src/
├── main.rs # transpiled output ├── main.rs
├── lib/ └── my_api/
│ ├── parser.rs ├── mod.rs
│ └── helper.rs ├── methods.rs
└── _header.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.