ZELYRA
Understand Zelyra
through the languages you know.
Explore the goals of an experimental language project for database-backed web applications. Feature coverage and guarantees are limited to what the 0.3.0 release actually implements.
Zelyra explores bringing data models and web application concepts closer together. The 0.3.0 prototype does not make every model, query, form, and view a single automatically verified source of truth.
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 | ~ Prototype construct | ✗ Runtime TypeError | ~ undefined/any | ✓ Option<T> | ✗ nil Panic | ✗ NoneType Error |
| Verified SQL in Language See the 0.3.0 docs for actual SQL support | ~ Prototype tooling | ✗ 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 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 Memory footprint per service | ⚡ ~12 MB | ~ 45 - 70 MB | ~ 85 - 140 MB | ⚡ ~8 MB | ⚡ ~15 MB | ~ 75 - 120 MB |
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.
// 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 }
}
// 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 { ... }
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.
Domain types can make
data distinctions explicit.
Zelyra experiments with named domain types. The compiler checks only supported type relationships in this prototype; test the exact cases your project depends on.
// 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)
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
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.
Optional values are explicit.
Checks have a defined scope.
The language prototype provides optional-value syntax in supported contexts. This does not amount to a blanket guarantee against null-related or other runtime errors.
// 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")
}
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
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.
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.
// 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;
}
}
// 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!
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.
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.
// 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>
}
}
// 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
Zelyra does not treat web protocols as third-party library bolt-ons. Routes, requests, and HTML responses are fundamental primitives of the language compiler.
Lean, Fast & Efficient.
Real-world Resource Comparison.
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.
Cold Start Latency
Time until the HTTP server responds to the first request.
Idle RAM Footprint
Memory required for the running web application instance.
Docker Image Size
Minimal production deployment container size.
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.
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.
The 0.3.0 release includes a `serve` command for its supported project format. This page makes no latency or throughput claim; measure the workload and review deployment requirements yourself.
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.
The compiler and runtime are experimental. Do not infer application security from language syntax alone: review generated output, validate inputs, test authorization, and perform a security review before deployment.
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 →git clone https://github.com/sf1976/zelyra.git
cd zelyra && ./install.sh
zelyra run main.zyl