ZELYRA
ZELYRA / LANGUAGE COMPARISON

Understand Zelyra
through the languages you know.

Compare Zelyra honestly with established languages and frameworks. Zelyra does not try to out-run Rust or clone Laravel’s package ecosystem — it focuses on being a Proof-Carrying Business Language where schema, SQL, state machines, four-eyes rules, workflows, capabilities, and tests are verified directly by the compiler.

The Core Philosophy

Instead of trusting convention across ORM, migrations, validators, and middleware, Zelyra moves core business invariants into compiler-checked declarations (`table`, `states`, `four_eyes`, `workflow`, `tenant_scope`, `uses`, `test`). Every check documents its exact proven, runtime-checked, and unproven scope.

1.9.8 Current release Reproducible Linux & Windows binaries
states Business processes Guards, roles, four_eyes & workflow
SQL Tenant-verified SQL Fail-closed MariaDB & PostgreSQL pools
test Built-in test runner Declarative tests + DB rollback sandbox
2.0.0 Roadmap Target Proof-Carrying Business Language
Compare against:
Binding Roadmap · 1.8.0 → 2.0.0 → 3.0.0

From 1.8.0 to 3.0.0:
What works today — and the verifiable chain ahead.

Versions 1.3.0 through 1.8.0 are shipped and verified in CI, including the open proof format, independent checker, semantic diff verification, deployment attestations, and explainable decisions. Below is the separation between shipped capabilities and the roadmap through 3.0.0.

✅

1. Shipped Today (1.3.6 – 1.8.0)

Core language ergonomics, living business processes, financial & temporal integrity, testing, and LSP tooling are shipped and verified in CI.

  • 1.3.6–1.4.0: Guarded `states`, `?` rollback, tenant SQL joins, `zelyra test` (DB rollback sandbox), `zelyra lsp`
  • 1.5.0: `states` v2 (`requires role`, fail-closed `requires four_eyes`), declarative `workflow` (`after`, `on enter`, `compensate`)
  • 1.6.0: `Money<C>`, append-only `ledger` (`E-LEDGER-001`), bitemporal `auditable`, XXE-safe EN 16931 `einvoice_xml`
  • 1.7.0–1.8.0: Privacy and authorization controls; open proof files with six evidence classes, independent checking, `diff-verify`, proof-carrying bundles and explainable decisions
🛡️

2. Phase A: 1.7.0 → 2.0.0 (LTS)

The Proof-Carrying Business Language: static privacy, standalone open-source Proof Checker, SMT foundation, and verified resilience.

  • 1.7.0: Information Flow Control (`@pii`/`@secret`, `E-PRIVACY-001`, `zelyra privacy`), CTE tenant SQL, Verified Authorization v1
  • 1.8.0 (released): Open `zelyra-proof.json` (6 evidence classes), Independent Proof Checker v1, `diff-verify`, Proof-Carrying Deployment v1, Explainable Decisions v1
  • 1.9.0–2.0.0: SMT & fuzzing foundation, Verified Resilience v1 (Outbox/Inbox), zero-downtime migrations, mandatory Proof Checker, 3-year LTS
🚀

3. Phase B: 2.1.0 → 3.0.0 (LTS)

The Verifiable Business Operating System: live runtime verification, concurrency, temporal digital twin, safe agents, and multi-language SDKs.

  • 2.1–2.3: Proof-Carrying Runtime, Verified Disaster Recovery (RPO/RTO), Verified Concurrency, Temporal Logic (`AS OF`) & Business Digital Twin
  • 2.4–2.7: Proof-Preserving Evolution (`zelyra evolve`), Verified Auth v2 & WebAuthn `four_eyes`, bounded `agent`, Executable Law (`norm`) & Proof Checker v2
  • 2.8–3.0: Inter-company `protocol`, Verified Interoperability (SDKs for PHP, Python, TS, Java, C#), Deep SMT, audit & 5-year LTS
01 / FEATURE MATRIX

Direct Feature & Architecture
Comparison Matrix.

A transparent overview of fundamental capabilities across Zelyra, Laravel, TypeScript, Rust, Go, and Python. Click any language above to filter the matrix and code examples directly.

Feature / Dimension Zelyra PHP (Laravel) TypeScript (Prisma) Rust (Axum) Go (net/http) Python (Django)
Single-Source Schema A language goal; coverage varies by feature ✓ Native ✗ 3-4 Files ~ Generated ✗ Macros ✗ Struct Tags ✗ Models+Forms
Nominal Domain Types Compiler forbids UserId = OrderId ~ Supported cases ✗ Primitive int/str ✗ Structural only ✓ Newtypes ~ Weak alias ✗ Dynamic
Optional-value checks Scope depends on implemented cases ~ Limited static checks ✗ Runtime TypeError ~ undefined/any ✓ Option<T> ✗ nil Panic ✗ NoneType Error
Verified SQL in Language See the handbook for supported SQL cases ~ Supported SQL cases ✗ Runtime strings ✗ ORM / DSL ✓ sqlx Macros ✗ Runtime strings ✗ ORM / DSL
Built-in Web Server No Apache, Nginx or FPM required ✓ Native in Rust ✗ PHP-FPM / Nginx ~ Node.js Engine ~ Crate needed ✓ net/http ✗ Gunicorn / WSGI
Deployment Artifact CLI is single binary; app bundle planned for 1.8.0 ✓ CLI 🛠️ Bundle (1.8.0) ✗ Source + Runtime ✗ Source + Node ✓ Single Binary ✓ Single Binary ✗ Source + Python
Dependency Overhead Dependencies vary by install and deployment ~ Depends on deployment ~ Depends on deployment ~ Depends on deployment ~ Depends on deployment ~ Depends on deployment ~ Depends on deployment
Performance data No comparative benchmark published — — — — — —
Idle RAM Consumption No comparable measurement published — — — — — —
Multi-Tenancy Isolation tenant_scope CRUD + verified multi-table SELECT joins (fail-closed) ✓ Compiler-checked ~ Global Scope ✗ Manuell ✗ Manuell ✗ Manuell ~ Middleware
State Machines & Four-Eyes states, when guards, roles & four_eyes under FOR UPDATE ✓ Native + Verify ✗ Packages / Manual ✗ Library (XState) ~ Typestate (manual) ✗ Manual ✗ Library
Built-in Test & Rollback Sandbox zelyra test with automatic DB rollback on MariaDB & PostgreSQL ✓ Native + Rollback ✓ PHPUnit / Trait ~ Vitest + Setup ~ cargo test ~ go test ✓ pytest / Django
Execution Pipeline AST default; typed MIR & Bytecode v30 opt-in (fail-closed) ✓ AST ~ MIR/VM (opt-in) ✗ PHP-FPM ~ Node JIT ✓ LLVM Native ✓ Native ✗ CPython (GIL)
Design by Contract Pre-/post-conditions (requires, ensures) in typechecker ✓ Native (AST) ✗ Exceptions ✗ Keine ~ assert! Macros ✗ Keine ✗ Keine
02 / DATA MODEL

Describe a schema.
Reuse supported parts.

A table declaration can feed selected database, type, form and CRUD workflows. The exact integration depends on the construct and backend.

customer.zyl ZELYRA
// Tabellendeklaration für unterstützte Folgeabläufe
table customers {
    id: Id primary auto
    name: String(100) required
    email: Email?
    active: Bool = true
}

// Unterstützte Formulardeklaration
form CustomerCreate -> customers {
    fields { name email }
}
Customer.php + migration.php LARAVEL
// 1. Migration, 2. Model, 3. FormRequest (3 Dateien synchron halten!)
class CreateCustomersTable extends Migration {
    public function up() {
        Schema::create('customers', function (Blueprint $t) {
            $t->id();
            $t->string('name', 100);
            $t->string('email')->nullable();
            $t->boolean('active')->default(true);
        });
    }
}
// In Customer.php: protected $fillable = ['name', 'email', 'active'];
// In StoreCustomerRequest.php: rules() => ['name' => 'required|max:100'...]
// 1. schema.prisma + npx prisma generate
model Customer {
  id     Int     @id @default(autoincrement())
  name   String  @db.VarChar(100)
  email  String?
  active Boolean @default(true)
}
// 2. Zod-Validierung muss manuell dupliziert werden:
export const CustomerSchema = z.object({
  name: z.string().min(1).max(100),
  email: z.string().email().optional(),
});
export type CustomerInput = z.infer<typeof CustomerSchema>;
// Diesel: migration.sql + schema.rs + models.rs
#[derive(Queryable, Selectable, Insertable, Serialize, Deserialize)]
#[diesel(table_name = crate::schema::customers)]
pub struct Customer {
    pub id: i32,
    pub name: String,
    pub email: Option<String>,
    pub active: bool,
}
// Validierungs-Crate validator muss zusätzlich implementiert werden:
#[derive(Validate, Deserialize)]
pub struct NewCustomer { ... }
💡
One source can reduce repeated definitions

A shared declaration can reduce repeated definitions in supported workflows. It does not keep every database schema, API, form and view automatically synchronized.

03 / DOMAIN TYPES

Domain types can make
data distinctions explicit.

Zelyra supports named domain types and checks implemented type relationships. Check the handbook for the exact rules and test the cases your project depends on.

nominal_safety.zyl ZELYRA
// Nominale Typen: Strikte Trennung im Typensystem
type UserId = Id
type OrderId = Id

fn cancel_order(order: OrderId, user: UserId) {
    // ...
}

// ❌ COMPILE ERROR:
// TypeMismatch: Expected OrderId, but found UserId
cancel_order(current_user_id, current_order_id)
structural_bug.ts TYPESCRIPT
type UserId = string;
type OrderId = string;

// TypeScript verwendet rein strukturelle Typisierung!
function cancelOrder(order: OrderId, user: UserId) { ... }

// ⚠️ KEIN FEHLER: Kompiliert ohne jede Warnung!
// Führt zur Laufzeit zu stiller Datenbeschädigung:
cancelOrder(currentUserId, currentOrderId);
// PHP erlaubt nur primitive Skalare:
function cancelOrder(int $orderId, int $userId): void {
    // ...
}

// ⚠️ Vertauschte Parameter werden klaglos akzeptiert.
// Erst wenn der falsche Kunde oder Auftrag gelöscht wird,
// bemerkt man den Fehler in Produktion!
cancelOrder($currentUserId, $currentOrderId);
// In Rust geht das nur über das Newtype-Pattern:
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct UserId(pub u64);

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct OrderId(pub u64);

fn cancel_order(order: OrderId, user: UserId) { ... }
// Sicher, aber erfordert mühsames Entpacken order.0
🛡️
Why this matters in Enterprise Web Development

Some type systems treat aliases of the same primitive as interchangeable. Zelyra experiments with nominal distinctions; compiler checks apply to supported type relationships and do not prevent every application bug.

04 / NULL SAFETY

Optional values are explicit.
Checks have a defined scope.

Optional-value syntax is part of the language. Static checks cover supported contexts; they are not a blanket guarantee against null-related or other runtime errors.

safe_option.zyl ZELYRA
// T? ist Option<T>. Zugriff ohne Prüfung unmöglich:
user_name: String? = load_user_name(id)

// Compiler erzwingt vollständige Fallunterscheidung
match user_name {
    Some(name) => print("Willkommen, {name}!")
    None       => print("Gast-Benutzer")
}
null_danger.ts TYPESCRIPT
const userName = loadUserName(id);

// Optional Chaining täuscht Sicherheit vor:
const upper = userName?.toUpperCase();

// ⚠️ 'upper' ist jetzt undefined!
// Wandert ohne Compiler-Fehler in die SQL-Datenbank
// oder führt im Template zu 'Hello, undefined'
saveToDatabase({ name: upper });
$userName = loadUserName($id); // gibt ?string zurück

// Vergessenes if ($userName !== null) führt zum Fatal Crash:
echo strtoupper($userName);

// 💥 Fatal error: Uncaught TypeError:
// strtoupper(): Argument #1 ($string) must be of type string, null given
user, err := loadUser(id)
// Ein vergessenes err != nil oder nil-Pointer-Dereferenzierung:
println(user.Name)

// 💥 panic: runtime error: invalid memory address
// or nil pointer dereference
⚡
Option<T> vs. Optional Chaining

Optional chaining is useful syntax, but it does not replace handling an absent value. Zelyra represents optional values as Option<T>; exhaustive matches require handling each supported variant.

05 / SQL & QUERIES

Native, compiler-checked SQL.
Queries stay explicit.

Zelyra checks supported SQL statements against the declared schema and keeps query behavior explicit. It does not automatically prevent N+1 query patterns; inspect and measure the queries your application issues.

orders_query.zyl ZELYRA
// Direktes SQL: Compile-geprüft & null Overhead
fn get_top_customers(min_spend: Float) -> List<CustomerSummary> {
    sql {
        SELECT c.id, c.name, SUM(o.total) AS total_spent
        FROM customers c
        JOIN orders o ON o.customer_id = c.id
        WHERE c.active = true
        GROUP BY c.id, c.name
        HAVING SUM(o.total) >= :min_spend
        ORDER BY total_spent DESC;
    }
}
EloquentQuery.php LARAVEL
// Eloquent: Verschachtelter Query-Builder mit Reflection
$topCustomers = Customer::query()
    ->selectRaw('customers.id, customers.name, SUM(orders.total) as total_spent')
    ->join('orders', 'orders.customer_id', '=', 'customers.id')
    ->where('customers.active', true)
    ->groupBy('customers.id', 'customers.name')
    ->havingRaw('SUM(orders.total) >= ?', [$minSpend])
    ->orderByDesc('total_spent')
    ->get();
// ⚠️ selectRaw und havingRaw sind ungeprüfte Strings!
// Massiver Speicherverbrauch bei großen Hydrierungen.
// Prisma unterstützt komplexe GROUP BY / HAVING nur eingeschränkt:
const aggregations = await prisma.order.groupBy({
  by: ['customerId'],
  _sum: { total: true },
  having: { total: { _sum: { gte: minSpend } } },
});
// Benötigt anschließende zweite Query für Kundendaten:
// -> Gefahr von N+1 Latenz oder komplexen Raw-Queries!
// SQLx in Rust prüft SQL zur Compile-Zeit:
let customers = sqlx::query_as!(
    CustomerSummary,
    r#"SELECT c.id, c.name, SUM(o.total) as total_spent ... "#,
    min_spend
)
.fetch_all(&pool)
.await?;
// SQLx supports prepared offline metadata for builds without a live database.
📊
The Power of Relational Clarity

Zelyra exposes SQL-oriented database workflows for documented cases. The compiler does not validate every query against a live database, and performance depends on the query, backend and workload.

06 / WEB ARCHITECTURE

A web runtime.
With documented limits.

The runtime provides a `serve` command and page routes for supported project formats. Deployment still depends on the application, host and operational requirements.

profile_page.zyl ZELYRA
// Nativer Webserver läuft direkt via 'zelyra serve'
page "/users/{id}" {
    let user = find_user(id)?

    // Automatisches XSS-Escaping für alle Werte
    html {
        <h1>Profil: {user.name}</h1>
        <p>E-Mail: {user.email}</p>
    }
}
routes/web.php + Controller LARAVEL
// In routes/web.php:
Route::get('/users/{id}', [UserController::class, 'show']);

// In app/Http/Controllers/UserController.php:
public function show($id) {
    $user = User::findOrFail($id);
    return view('users.show', compact('user'));
}
// In resources/views/users/show.blade.php:
// <h1>Profil: {{ $user->name }}</h1>
// Erfordert Nginx + PHP-FPM Prozessmanagement im Betrieb!
// Next.js App Router:
export default async function UserPage({ params }: { params: { id: string } }) {
  const user = await db.user.findUnique({ where: { id: Number(params.id) } });
  if (!user) notFound();

  return (
    <div>
      <h1>Profil: {user.name}</h1>
      <p>E-Mail: {user.email}</p>
    </div>
  );
}
// Erfordert Node.js Runtime, JSX-Build-Pipeline und npm packages
async fn show_user(Path(id): Path<i32>) -> Response {
    let user = db::find(id).await;
    Html(format!("<h1>Profil: {}</h1>", user.name)).into_response()
}

let app = Router::new().route("/users/:id", get(show_user));
axum::serve(listener, app).await.unwrap();
// Benötigt Tokio Async-Runtime, Lifetimes und HTML-Escaping Crate
🚀
Built for the Web from Day One

Zelyra does not treat web protocols as third-party library bolt-ons. Routes, requests, and HTML responses are fundamental primitives of the language compiler.

07 / PERFORMANCE METRICS

Performance & resources.
Measurements pending.

No reproducible benchmark for startup time, memory use, or image size is published for this release. We will add measured data when a repeatable test setup is available.

08 / DECISION GUIDE

When to choose what:
Honest architectural guidance.

No language is universally best for everything. Here is an honest appraisal of when each technology shines.

🐘 Stay with PHP / Laravel if:

You need a massive off-the-shelf ecosystem and immediate turnkey solutions.

  • You heavily rely on packages like Filament Admin, Nova, Cashier, or Pulse.
  • You maintain existing legacy codebases with deep Composer dependencies.
  • Standard LAMP / Shared-Hosting deployment is a strict requirement.

🔷 Stay with TypeScript if:

You require complete code-sharing between complex browser clients and backend.

  • You build heavy Single Page Apps (SPAs) with React, Next.js, or Vue.
  • You use specialized npm packages with no native equivalent.
  • Your team consists exclusively of JavaScript frontend engineers.

🦀 Choose Rust if:

You build low-level systems where manual memory layout and nanoseconds matter.

  • Operating systems, game engines, database engines, or cryptography.
  • You need zero-cost abstractions with custom manual allocator control.
  • Your project can absorb the steep learning curve of lifetimes and borrow checking.

🐹 Choose Go if:

You build straightforward networking daemons or cloud-native tooling (Kubernetes/Docker).

  • High concurrency with lightweight Goroutines for I/O proxies.
  • Cloud orchestration and container tooling ecosystem.
  • You are comfortable with repetitive `if err != nil` error handling.

⚡ Choose Zelyra if:

You build business-critical, multi-tenant, or approval-driven database applications where compiler-verified rules beat boilerplate.
Zelyra shines when business invariants (state transitions, four-eyes approvals, tenant SQL isolation, explicit capabilities, and transactional rollbacks) should be checked by the compiler instead of scattered across convention and runtime glue.

🛡️ Compiler-checked business invariants

`states` with `when` guards, roles, and `four_eyes`, declarative `workflow` blocks, nominal `TenantId` SQL checks, and `requires`/`ensures` contracts are verified statically and enforced fail-closed.

🧪 First-class testing & LSP tooling

`zelyra test` runs declarative `test "..."` blocks with automatic DB rollback sandboxes on MariaDB and PostgreSQL; `zelyra lsp` brings diagnostics, hover, formatting, and rename to VS Code and Neovim.

🤖 Built for AI-assisted engineering

Deterministic JSON outputs (`reflect`, `verify --json`, `test --format json`), explicit `uses` capabilities, and `strict_architecture` turn the compiler into an objective gatekeeper for AI-generated code.

🏛️ 100% local & honest about limits

Zero cloud lock-in, zero telemetry, reproducible Linux/Windows binaries. Not intended for low-level systems programming (use Rust), heavy SPAs (use TypeScript), or massive legacy ecosystems (use Laravel).

The 4-Step Flow: 1. Declare table & states ➔ 2. zelyra verify & test ➔ 3. zelyra serve ➔ ✓ Verified locally

Ready to write Zelyra?

Use the built-in `zelyra lsp` server (live diagnostics, formatting, hover with states/contracts, definition, references, rename) in VS Code, Cursor, or Neovim — plus `zelyra test` and `zelyra verify` right from the CLI.

View Setup Guide →
// Quick verification flow
zelyra check main.zyl
zelyra verify main.zyl --json
zelyra test