Vybe Documentation

Vybe Main page

 

Architecture Overview

Vybe follows a modular architecture where each component is isolated in its own crate, facilitating testing and reuse.

🏗️ Component Breakdown

1. Vybe Parser (Vybe_parser)

The brain of the operation. It uses the pest crate to implement a Parsing Expression Grammar (PEG).

2. Vybe Runtime (Vybe_runtime)

A tree-walking interpreter that executes the AST directly.

3. Vybe Forms (Vybe_forms)

A cross-platform UI model that defines how forms and controls look and behave.

4. Vybe Editor (Vybe_editor)

The Visual Design Environment.

🔄 Execution Flow

  1. Parse: VBParser reads the .vb source and generates an ast::Program.
  2. Setup: The Interpreter initializes the environment with builtin functions.
  3. Execute: The interpreter walks the AST node by node, updating state in the Environment.
  4. Events: When a user interacts with a form, the UI captures the event and tells the interpreter to run the corresponding Sub.
graph TD
    Source[.vb File] --> Parser[Vybe_parser]
    Parser --> AST[AST Tree]
    AST --> Interpreter[Vybe_runtime]
    Interpreter --> Builtins[Builtin Functions]
    Interpreter --> UI[Vybe_forms]
    UI --> Editor[Vybe_editor]