> For the complete documentation index, see [llms.txt](https://camelot-1.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://camelot-1.gitbook.io/docs/documentation/start-here/quick-start.md).

# Quick Start

Go from zero to a running Camelot kernel in 30 seconds.

Camelot is a C23-compliant static library designed to replace the standard library's memory and IO models. This guide covers the installation of the core artifacts (`libcamelot.a`) and the compilation of your first Workspace-based program.

### Installation

Camelot is built from source to ensure binary compatibility with your specific system architecture.

{% hint style="info" %}

#### **Prerequisite**

You must have `gcc` (or `clang`) and `make` installed on your system.
{% endhint %}

{% tabs %}
{% tab title="Linux / macOS" %}

1. **Build the Distribution**

Clone the repository and run the distribution target. This compiles the static archive (`.a`) and generates the installer scripts.

```bash
git clone https://github.com/akrillick/camelot.git
cd camelot
make dist
```

2. Install Artifacts

Run the installer script. This copies headers to `/usr/local/include/` and the library to `/usr/local/lib/`.

```bash
cd packages/dist
sudo ./install.sh
```

{% endtab %}

{% tab title="Windows" %}

1. **Build**

Open `cmd.exe` as Administrator.

```powershell
git clone https://github.com/akrillick/camelot.git
cd camelot
make dist
```

2. Install

The batch script creates `C:\Camelot` and registers the `C_INCLUDE_PATH` and `LIBRARY_PATH` environment variables.

```powershell
packages\dist\install.bat
```

{% endtab %}
{% endtabs %}

### The Workspace Pattern

Standard C programs rely on `malloc/free` for object management, leading to leaks. Camelot enforces a Workspace Pattern:

1. Create a workspace (Arena) at the start of a scope.
2. Alloc objects linearly within that workspace.
3. Release the entire workspace at the end.

{% hint style="success" %}

#### **Zero Leaks**

Because the entire workspace is released at once, it is mathematically impossible to "forget" to free a specific object.
{% endhint %}

{% code title="main.c" %}

```c
#include <camelot.h>

int main() {
    // 1. Initialize Workspace (Automatic RAII)
    // The 'Workspace' type guarantees cleanup at scope exit.
    Workspace ctx = arena.create(1024);

    // 2. Perform Logic
    String msg = string.from("System Online");
    io.print("%S (v%s)\n", msg, CAMELOT_VERSION);
    
    return 0;
} // Memory is automatically released here
```

{% endcode %}
