📘 Vexa 2.0 Dokumentation
Einführung
Vexa ist eine modern, dynamisch typisierte Sprache mit C-ähnlicher Syntax. Sie bietet Closures, First-Class-Funktionen, Pipelines, Null-Safety, Match-Ausdrücke und eine umfangreiche Standardbibliothek mit über 180 eingebauten Funktionen. Entwickelt für Einsteiger und Profis gleichermaßen.
🚀 Leistung
Schneller Interpreter, optimierte Ausführung
🎨 GUI-Terminal
Syntax-Highlighting, Autovervollständigung, History
📦 vxpm Paketmanager
Pakete installieren, erstellen, teilen
🔐 Sicherheit
Null-Safety, Pattern Matching, Exception-Handling
Installation
Linux (Ubuntu/Debian)
sudo dpkg -i vexa-2.0.0.deb
Windows 11
Setup.exe ausführen, dann 'vexa' in der Konsole
Portable (Python 3.8+)
python vexa.py
vexa startet das GUI-Terminal.Erstes Programm
// hallo.vx
echo "Willkommen bei Vexa 2.0!";
let name = "Entwickler";
print("Hallo " + name);
vexa hallo.vx
Syntax Grundlagen
Vexa verwendet let, const, var für Variablen. Semikolons sind optional, aber empfohlen.
let zahl = 42;
const PI = 3.14159;
var zaehler = 0;
Variablen & Typen
let string = "Hallo Welt";
let number = 123.45;
let boolean = true;
let nichts = null;
let liste = [1, 2, 3];
let dict = {name: "Vexa", version: 2.0};
Funktionen
func add(a, b) { return a + b; }
// Pfeilfunktion / Lambda
let quadrat = (x) => x * x;
// Standardparameter
func grüßen(name = "Gast") { echo "Hallo " + name; }
Kontrollstrukturen
if (x > 10) { echo "groß"; } else { echo "klein"; }
// Ternary
let status = (alter >= 18) ? "Erwachsen" : "Kind";
// Schleifen
for (let i = 0; i < 5; i++) { echo i; }
foreach (item in liste) { echo item; }
while (bedingung) { // ... }
Listen und Dictionaries
let zahlen = [1,2,3];
push(zahlen, 4); // [1,2,3,4]
let erstes = zahlen[0];
let person = {name: "Anna", alter: 28};
person["stadt"] = "Berlin";
Pipelines |>
let ergebnis = 1..10
|> filter(|x| x % 2 == 0)
|> map(|x| x * x)
|> reduce(|a,b| a + b);
// 2²+4²+6²+8²+10² = 220
Paketmanager vxpm
vx pm install
vx pm list
vx pm search
vx pm update --all
vx pm create ./mein-paket
Mathematik Built-ins
| Funktion | Beschreibung |
|---|---|
abs(x) | Betrag |
round(x, n) | Runden |
random() | Zufallszahl [0,1) |
sqrt(x) | Quadratwurzel |
String-Funktionen
len(s) | Länge |
upper(s) | Großbuchstaben |
split(s, delim) | Teilen |
replace(s, alt, neu) | Ersetzen |
Datei-I/O
write_file("daten.txt", "Inhalt");
let inhalt = read_file("daten.txt");
let zeilen = read_lines("log.txt");
append_file("log.txt", "neue Zeile");
CLI-Befehle
vexa | GUI-Terminal starten |
vexa datei.vx | Datei ausführen |
vx build datei.vx | Syntaxprüfung |
vx pack datei.vx | In .vxp packen |
vx init projekt | Neues Projekt |
GUI Terminal
Farblich hervorgehobene Eingabe, Auto-Vervollständigung mit TAB, Befehlshistory (Pfeiltasten), mehrzeilige Eingabe mit \ am Ende, schließt nie bei Fehlern – wechselt automatisch in den REPL-Modus.
📘 Vexa 2.0 Documentation
Introduction
Vexa is a modern, dynamically typed language with C-like syntax. It features closures, first-class functions, pipelines, null-safety, match expressions, and a rich standard library with 180+ built-in functions. Designed for beginners and experts alike.
🚀 Blazing Fast
Optimized interpreter
🎨 GUI Terminal
Syntax highlighting, autocomplete, history
📦 vxpm Package Manager
Install, create, share packages
🔐 Safety & Modern
Null-safety, pattern matching, exceptions
Installation
Linux (Ubuntu/Debian)
sudo dpkg -i vexa-2.0.0.deb
Windows 11
Run Setup.exe, then type 'vexa' in terminal
Portable (Python 3.8+)
python vexa.py
vexa launches the GUI terminal.First Program
// hello.vx
echo "Welcome to Vexa 2.0!";
let name = "Developer";
print("Hello " + name);
vexa hello.vx
Basic Syntax
Vexa uses let, const, var. Semicolons are optional but recommended.
let num = 42;
const PI = 3.14159;
var counter = 0;
Variables & Types
let str = "Hello World";
let num = 123.45;
let flag = true;
let nothing = null;
let list = [1, 2, 3];
let dict = {name: "Vexa", version: 2.0};
Functions
func add(a, b) { return a + b; }
// Arrow function / lambda
let square = (x) => x * x;
// Default parameters
func greet(name = "Guest") { echo "Hello " + name; }
Control Flow
if (x > 10) { echo "big"; } else { echo "small"; }
// Ternary
let status = (age >= 18) ? "Adult" : "Minor";
// Loops
for (let i = 0; i < 5; i++) { echo i; }
foreach (item in list) { echo item; }
while (condition) { // ... }
Lists and Dicts
let numbers = [1,2,3];
push(numbers, 4); // [1,2,3,4]
let first = numbers[0];
let person = {name: "Anna", age: 28};
person["city"] = "Berlin";
Pipelines |>
let result = 1..10
|> filter(|x| x % 2 == 0)
|> map(|x| x * x)
|> reduce(|a,b| a + b);
// 2²+4²+6²+8²+10² = 220
Package Manager vxpm
vx pm install
vx pm list
vx pm search
vx pm update --all
vx pm create ./my-package
Math Built-ins
| Function | Description |
|---|---|
abs(x) | Absolute value |
round(x, n) | Round |
random() | Random [0,1) |
sqrt(x) | Square root |
String Functions
len(s) | Length |
upper(s) | Uppercase |
split(s, delim) | Split |
replace(s, old, new) | Replace |
File I/O
write_file("data.txt", "content");
let content = read_file("data.txt");
let lines = read_lines("log.txt");
append_file("log.txt", "new line");
CLI Commands
vexa | Start GUI terminal |
vexa file.vx | Run file |
vx build file.vx | Syntax check |
vx pack file.vx | Pack to .vxp |
vx init project | New project |
GUI Terminal
Syntax-highlighted input, TAB autocomplete, command history (arrow keys), multi-line input using \ at line end, never closes on errors – automatically switches to REPL mode.