---
title: "Introduction"
description: "What Zymba is, its role in ZeyOS, core language characteristics, and when to use it."
canonical_url: "https://www.zeyos.com/zymba"
markdown_url: "https://www.zeyos.com/ai/guide/zymba.md"
section: "zymba-guide"
authority: "draft-guide"
language: "en"
source_repository: "zeyos/guide"
source_path: "docs/zymba/01-introduction/index.md"
source_revision: "cce886a8da98cd124ee3644711085bbdcf1a87ce"
---

# Introduction

Zymba is a scripting language designed for the ZeyOS enterprise platform. It provides a modern, C-family syntax for building business logic, API integrations, data processing workflows, and automation within ZeyOS.

Unlike iXML — ZeyOS's XML-based templating language — Zymba uses familiar curly-brace syntax that feels natural to developers coming from JavaScript, PHP, or any C-family language. Both languages share the same ZeyOS platform APIs and database access, but each has a distinct strength: Zymba excels at logic-heavy code, while iXML is better suited for document generation and templating.

## Language characteristics

### C-family syntax

Zymba uses curly braces for blocks, semicolons to end statements, and familiar control flow:

```zymba
if ($price > 100) {
    $discount = $price * 0.1;
}

for ($items as $item) {
    $total += $item.price;
}
```

### Dollar-prefix variables

All variables use the `$` prefix, similar to PHP:

```zymba
$name = "Alice";
$count = 42;
$items = [1, 2, 3];
```

### Static class system

Built-in utilities are accessed through `@Class.method()` syntax:

```zymba
$trimmed = @String.trim($input);
$hash = @Crypt.hash($password, "sha256");
$json = @Var.toJSON($data);
$uuid = @Crypt.createUUID();
```

### Dot operator for string concatenation

Zymba uses `.` for string concatenation while `+` always performs numeric addition:

```zymba
$greeting = "Hello, " . $name . "!";  // String concatenation
$sum = 5 + 10;                         // Always numeric: 15
```

### Dynamic typing with first-class functions

Variables hold any type and functions are values:

```zymba
$double = function($x) { return $x * 2; };
$result = @Array.map([1, 2, 3], $double);
// [2, 4, 6]
```

## When to use Zymba

Zymba is the primary choice for:

- **API integrations** — HTTP clients, webhook handlers, data synchronization
- **Data processing** — CSV/JSON import/export, batch transformations
- **Business logic** — price calculations, order workflows, validation rules
- **Scheduled tasks** — cron jobs, cleanup routines, report generation
- **Service endpoints** — REST API handlers with `remotecall` services

## Zymba vs iXML

ZeyOS supports two languages. Choose based on the task:

| Aspect | Zymba | iXML |
|--------|-------|------|
| **Syntax** | C-family (curly braces, semicolons) | XML-based (tags and attributes) |
| **Best for** | Logic-heavy code, APIs, data processing | PDF generation, templates, form layouts |
| **String concat** | `.` operator | `$variable` substitution in content |
| **Learning curve** | Familiar to JS/PHP developers | Unique XML-based approach |
| **File extension** | `.zy` | `.ixml` or embedded in XML |

Both languages have access to the same ZeyOS platform APIs and database.

## Platform integration

Zymba integrates directly with ZeyOS through built-in classes:

- **`@ZeyOS`** — database access, entity management, configuration
- **`@SQL`** — query preparation and parameterization
- **`@HTTP`** — incoming request handling and outgoing HTTP calls
- **`@IO`** — file system operations
- **`@APPSETTINGS`** — application configuration

## Application file structure

Zymba files use the `.zy` extension and live in ZeyOS application directories:

```
my-app/
├── services/
│   ├── api-handler.zy        # remotecall endpoint
│   ├── daily-sync.zy         # timing job
│   └── after-order.zy        # entity hook
├── resources/
│   ├── lib.zy                # shared library
│   └── helpers.zy            # utility functions
└── zeyos.app.json            # app manifest
```

## Module system

Import standard library modules with `include`:

```zymba
include 'zymba:date,sql,var,string';
```

Common modules: `date`, `sql`, `var`, `string`, `crypt`, `http`, `math`, `io`.

Import shared application resources:

```zymba
include 'resource:lib';        // Loads resources/lib.zy
include 'resource:helpers';    // Loads resources/helpers.zy
```

### See also

- [Quick Start](https://www.zeyos.com/zymba/zymba-guide/introduction/quick-start) — set up your environment and write your first Zymba program
- [Language Basics](https://www.zeyos.com/zymba/zymba-guide/language-basics) — variables, types, and operators
