Roadmap
The Strategic Roadmap
The Camelot architecture is not built randomly. It follows a strict, layered progression designed to replace the standard library layer-by-layer.
We divide our progress into Architectural Epochs.
Epoch 1: Kernel (v1.0 - v2.3)
Status: COMPLETED ✅
Objective: Prove that C could be safe without being slow.
1. Memory Sovereignty
The Arena and Workspace primitives are stable and production-ready.
2. Type Hygiene
Replaced ambiguous int/char with strict i32/u8 and introduced Result enums.
3. String Safety
The "Fat Pointer" String view is implemented across the entire I/O layer.
4. Core Collections
PagedList (cache-stable arrays) and Table (linear probing maps) are complete.
Epoch 2: Compatibility & Hardening (v2.3 - Onward)
Status: IN PROGRESS 🚧
Objective: Replace the legacy C Standard Library (stdlib, stdio, string) with a type-safe, arena-backed ecosystem. We achieve 100% feature parity through a reduced, generalized toolset.
1. The Reliability Protocol (Critical Error Enforcement)
The Directive: We are abandoning C's "ignore the return code" culture. Critical system interactions must be impossible to fail silently.
The Implementation:
Explicit Result Types: All critical I/O and Memory operations will return a standardized
Resultstructure (Value + State).Enforcement: The compiler will be configured (via
[[nodiscard]]or similar attributes) to warn if these error states are ignored.Scope: Applied strictly to File I/O, Allocations, and Parsing. Non-critical helpers remain simple.
2. Universal I/O & Serialization
Replacing <stdio.h> input/output.
The Scanner: A unified cursor primitive to extract typed data (
i64,f64, words) from any buffer or file stream.Replaces:
scanf,fscanf,strtok,atoi.
The Builder: A zero-fragmentation
StringBuilderon the Arena for dynamically constructing logs, paths, and text.Replaces:
strcat,strcpy, unsafe buffer math.
The Writer: Atomic file creation and append capabilities.
Replaces:
fopen,fprintf,fwrite.
3. Algorithmic Primitives (The Slice)
Replacing <string.h> and <stdlib.h> sorting.
The Comparator: A unified
Orderingenum (Less,Equal,Greater) to replace the "magic integer" returns ofstrcmp.The Slice: A generic interface for contiguous memory. Enables Sorting (Merge/Radix), Binary Search, and Filtering on any data type.
Replaces:
qsort,bsearch,memcmp.
4. The Entropy Engine (Unified RNG)
Replacing <stdlib.h> rand/srand.
The Design: A single, unified interface
rng.new(Config)that defaults to sensible values if arguments are omitted.The API:
seed(Optional): If0orNULL, automatically seeds from hardware entropy/time.algo(Optional): Defaults toPCG-64(Fast/Statistically Solid). Can be overridden toXoshiroorChaChafor specific needs.Replaces:
rand(),srand().
5. Ecosystem Integration
Raylib: Direct texture loading into Arenas.
GTK: Scoped widget patterns for UI.
C++: ABI-safe headers for engine interop.
Governance
The Philosophy: "Tools are built by those who use them". We are formalizing how user feedback shapes the Kernel.
The Protocol: Critical tooling changes (CLI, Testing, Debugging workflows) must pass through a Request for Comment (RFC) phase.
Acceptance Criteria:
Universality: Does this solve a general engineering problem, or a specific user's edge case?
Friction: Does it strictly reduce the cognitive load of the happy path?
Safety: Does the tool encourage defined behavior by default?
Epoch 3: Sovereignty (Future)
Status: RFC / DISCUSSION 🔮
Objective: Total independence. In this phase, we sever the final links to the host's standard library (libc). Camelot transitions from a "Library" to a self-sufficient "Runtime," interacting directly with the OS Kernel.
1. The Concurrency RFC (The Scheduler)
Replacing <threads.h> and pthreads. Standard C threading is 1:1 with OS threads, which is heavy for high-performance engines (context switching costs). We are opening a Request for Comments to select Camelot's async architecture:
Path A: Green Threads (Fibers)
Concept: Stack-switching (assembly/ucontext) to run thousands of tasks on a single OS thread.
Pros: Linear code style (no callbacks).
Cons: Complex stack management; debugging is hard.
Path B: Async State Machines
Concept: A poll-based model (like Rust/Node) where IO operations return "Pending" or "Ready".
Pros: Zero stack overhead; extremely fast.
Cons: Requires a "Runtime" to drive the state machine.
2. The Network Fabric (The Transporter)
Replacing <sys/socket.h> / Winsock. C's standard networking is blocking and platform-dependent. Camelot aims for a unified, non-blocking I/O ring.
The Socket Abstraction: A unified
Socketstruct that works on Linux (epoll), Windows (IOCP), and Mac (kqueue) transparently.Zero-Copy Protocol: Data moves from the Network Card directly to the Arena, bypassing kernel buffers where possible.
Primitives:
net.listen(port, callback)net.dial_tcp(ip, port)
3. Data Interchange (Serialization)
Replacing cJSON or manual parsing. Serialization in C is usually slow (lots of malloc) or unsafe. We aim for Schema-Driven Layouts.
Reflection-Free JSON: A parser that maps a strict schema directly to memory offsets. No tree traversals, no hash lookups.
Binary Packets: A flat-buffer style system for network messages.
Goal:
packet.read<PlayerState>(buffer)returns a pointer to the data instantly (O(1)), with no decoding step.
4. The Hardware Abstraction Layer (HAL)
Replacing #ifdef _WIN32 spaghetti.
The Goal: A rigid barrier between Camelot logic and the Host OS.
Virtual File System (VFS): Mount "virtual" directories (e.g., zip files, network paths) as if they were local folders.
Hot-Reloading: A standard interface to unload and reload code modules (
.dll/.so) without restarting the application.
5. The Decoupling (Freestanding Compliance)
Replacing the implementation of libc. Currently, Camelot wraps standard functions (malloc, printf) to provide a safe API. In this final stage, we replace the engine underneath with raw Kernel Syscalls.
The Allocator: Replacing
mallocwith a custom Heap implemented viammap(Linux) andVirtualAlloc(Windows).The Entry Point: Taking control of
_startto initialize the Camelot Runtime beforemain()is ever called.The Benefit: A 100% portable, statically linked binary with zero external dependencies, capable of running on bare metal or embedded environments.
Governance
"Architecture before Implementation" For Epoch 3, we do not accept Pull Requests yet. We accept Whitepapers.
The Process: Before a line of code is written for the Scheduler, we require a "Proof of Concept" demonstrating:
Overhead: Cost per task creation (must be < 100 nanoseconds).
Debuggability: How does the user see the stack trace when it crashes?
Safety: How do we prevent data races without a Borrow Checker?
Last updated