🚀 Fystan

Fystan is a compiled programming language that blends the intuitive syntax of Python, Go, and JavaScript with the raw performance of Rust and C++.
It features safe, efficient memory management via COGC (Compile-time Only Garbage Collection) and generates native binaries for multiple architectures.

⚡ Currently in active development – new features are added regularly.

✨ Features

📦 Installation

(Coming soon — build from source instructions will be added here)

🖥 Usage

To compile a Fystan file:

fystan build example.fys --target OS,architecture

Example:

fystan build main.fys --target windows,x86_64

The output will be a native assembly or binary for your selected target architecture.
All compiler output and errors are in English.

🔍 COGC – Compile-time Only Garbage Collection

COGC is a memory management system that shifts all garbage collection decisions to compile-time, eliminating the need for runtime garbage collection.
It enables developers to write code with automatic memory management comparable to Python or JavaScript without manual intervention.

Key Features

⚙ How COGC Works

The core of COGC is Compile-time Garbage Collection Elimination:

  1. At compile-time, the compiler performs static liveness and escape analysis to determine when each object is no longer needed.
  2. Deallocation instructions (free() or arena resets) are inserted directly into the generated native code.
  3. Most short-lived objects are placed on the stack or in arenas, avoiding heap allocation altogether.
  4. At runtime, your program executes purely native code — no GC loop, no background threads.

No runtime garbage collector
No manual `free()` calls
Near-zero runtime overhead

In rare cases where an object’s lifetime cannot be fully resolved at compile-time (such as dynamic cyclic references), COGC triggers a mini-GC:
It runs briefly to clean up unreachable cycles, then exits immediately, causing minimal pause times (microseconds to milliseconds).

GitHub Fystan Repository