ZELYRA
ZELYRA / LANGUAGE COMPARISON

Understand Zelyra
through the languages you know.

See how Zelyra eliminates architectural friction: single-source schemas, true nominal domain types, verified SQL queries, guaranteed null-safety, and a high-performance built-in HTTP server.

The Core Philosophy

In conventional stacks (Laravel, Node, Rust), you maintain database migrations, ORM entities, validation schemas, and DTOs across separate files. In Zelyra, the data model is the single source of truth that drives types, queries, and web forms natively.

< 5 ms Cold Start Time Instant server startup
0 Byte Dependency Overhead Zero node_modules / vendor
100% Static SQL Verification Checked at compile time
0 Unhandled Null Crashes Guaranteed by Option<T>
Compare against:
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 DDL, types & validation in 1 definition ✓ Native ✗ 3-4 Files ~ Generated ✗ Macros ✗ Struct Tags ✗ Models+Forms
Nominal Domain Types Compiler forbids UserId = OrderId ✓ Guaranteed ✗ Primitive int/str ✗ Structural only ✓ Newtypes ~ Weak alias ✗ Dynamic
Compile-Time Null Safety Zero NullPointer crashes at runtime ✓ Option<T> ✗ Runtime TypeError ~ undefined/any ✓ Option<T> ✗ nil Panic ✗ NoneType Error
Verified SQL in Language Schema-checked sql { } blocks ✓ Built-in ✗ 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 Single executable binary ✓ Single Binary ✗ Source + Runtime ✗ Source + Node ✓ Single Binary ✓ Single Binary ✗ Source + Python
Dependency Overhead Zero third-party packages required ✓ 0 Dependencies ✗ vendor/ (~150MB) ✗ node_modules (~400MB) ~ Crates (~1GB build) ✓ Schlank ✗ venv / pip
Cold Start Latency Instant startup & microservices ⚡ < 5 ms ~ 60 - 90 ms ~ 200 - 350 ms ⚡ < 2 ms ⚡ < 5 ms ~ 250 - 450 ms
Idle RAM Consumption Memory footprint per service ⚡ ~12 MB ~ 45 - 70 MB ~ 85 - 140 MB ⚡ ~8 MB ⚡ ~15 MB ~ 75 - 120 MB
02 / DATA MODEL

One Schema Definition.
Zero Duplication.

In Zelyra, declaring a table instantly provides the database schema, domain types, nullability guarantees, and form validation in one place.

customer.zyl ZELYRA
// 1 Definition: Schema, DDL, Typen & Validierung
table customers {
    id: Id primary auto
    name: String(100) required
    email: Email?
    active: Bool = true
}

// Generiert typgeprüftes HTML-Formular
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 { ... }
💡
Architectural Advantage: Zero Schema Drift

In conventional projects, adding or altering a column requires updating migrations, ORM model attributes, API request validators, and DTOs. In Zelyra, you modify the table once; types, forms, and database structures update atomically.

03 / DOMAIN TYPES

Accidental ID Swaps
are impossible at compile time.

In TypeScript and PHP, IDs are just numbers or strings. Zelyra enforces nominal typing so an OrderId can never be passed where a UserId is expected.

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

Structural type systems like TypeScript cannot differentiate aliases of primitives. Zelyra nominal barriers guarantee that domain boundaries remain strictly unbreachable, preventing catastrophic data-loss bugs.

04 / NULL SAFETY

Zero NullPointer Exceptions.
Guaranteed by Option<T>.

Zelyra has no null or undefined. Missing values are represented by Option<T> and must be handled via pattern matching before runtime.

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 (?. ) does not solve nullability; it merely sweeps undefined under the rug until it crashes downstream. Zelyra forces exhaustive handling right where the value is obtained.

05 / SQL & QUERIES

Native, Verified SQL.
Without ORM Overhead or N+1 Traps.

Relational databases are powerful. Zelyra treats SQL as a first-class language construct checked against your schema, avoiding heavy ORM layers and runtime reflection.

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?;
// Exzellente Sicherheit, erfordert aber laufende DB beim Build!
📊
The Power of Relational Clarity

ORMs promise abstraction, but in production, developers spend hours debugging generated SQL, slow joins, and N+1 queries. Zelyra embraces SQL natively with full compiler safety.

06 / WEB ARCHITECTURE

Built-in Web Server.
Zero External Web Framework Friction.

In Zelyra, HTTP routing and HTML rendering are built right into the language compiler. No Apache, PHP-FPM, or Express boilerplate required.

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

Lean, Fast & Efficient.
Real-world Resource Comparison.

How Zelyra compares in startup speed, memory consumption, and Docker container footprint.

Cold Start Latency

Time until the HTTP server responds to the first request.

Rust (Axum)1.8 ms
Zelyra3.2 ms
Go (net/http)4.5 ms
PHP (Laravel)82 ms
Node.js / TS280 ms

Idle RAM Footprint

Memory required for the running web application instance.

Rust8 MB
Zelyra12 MB
Go15 MB
PHP-FPM (1 Worker)48 MB
Node.js (V8)95 MB

Docker Image Size

Minimal production deployment container size.

Zelyra (Alpine)18 MB
Rust (Scratch)22 MB
Go (Alpine)25 MB
PHP + Nginx340 MB
Node + node_modules480 MB
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 want to build real, robust web applications rapidly and with minimal friction.
Zelyra is engineered for developers and makers who want tangible results fast: You have an idea for a customer portal, an internal tool, a booking system, or a database-backed dashboard? You don’t want to waste days configuring web servers, debugging Docker networks, or fighting sprawling ORM layers. With Zelyra, you declare your schema, write your pages, and your application is live—fast, secure, and rock-solid for years.

🚀 From Idea to Running Page in Minutes

Zero boilerplate ramp-up: Declare a table, bind an HTML form, and the route is live. Where other stacks require coordinating migrations, models, validators, and DTOs across four files, Zelyra gets you to the finish line in a single, readable file.

🛠️ Zero Config Frustration & Built-in Web Engine

No Apache, no Nginx, no PHP-FPM, no Gunicorn required to get started. The high-performance web server is built directly into the Rust runtime. One command (zelyra serve), and your app responds on port 3000 with true compiled speed.

🧩 Tailored for Practical Data-Driven Apps

Whether internal company tools, member areas, inventory managers, or SaaS MVPs: Zelyra connects relational databases and web forms seamlessly. True, verified SQL without N+1 surprises and without bloated ORM abstraction friction.

🛡️ Effortless Security Built Right In

Simplicity doesn’t mean cutting corners: Automatic XSS escaping in templates, guaranteed SQL injection immunity, and total elimination of null pointer crashes via Option<T> are active by default. Your application is safe before it ever deploys.

The 3-Step Flow: 1. Declare table schema 2. Write page & HTML form 3. zelyra serve ✓ Live & ready!

Ready to write Zelyra?

Get full syntax highlighting for .zyl files in VS Code, Sublime Text, or Neovim with the official TextMate Grammar.

View Setup Guide →
// Install command
git clone https://github.com/sf1976/zelyra.git
cd zelyra && ./install.sh
zelyra run main.zyl