RayClay: C Framework for Cross-Platform Native Applications

RayClay is an open-source C framework for building native desktop, mobile, and web applications. It targets developers who want the performance and low resource overhead of C while avoiding the bloat of JavaScript frameworks like React Native or Electron.

Cross-Platform Support and Performance

The framework compiles for macOS, Windows 11, Linux distributions, iOS, Android, and WebAssembly. Proponents claim C applications can achieve 1MB install sizes versus 100MB for equivalent Electron/React Native apps, with users reporting 10x better responsiveness and less memory pressure on devices.

Design Philosophy and Rationale

RayClay was created to fill what the developer describes as a "no middle ground" between the ease of JavaScript frameworks and the difficulty of existing C frameworks. Dear ImGui was deemed insufficient for out-of-the-box development, while Qt's dual-licensing model can become restrictive or expensive depending on distribution methods.

The framework provides flexbox-style layouts and networking capabilities not found in Dear ImGui, while avoiding Qt's licensing constraints. C's performance characteristics enable lower-level capabilities unavailable to JavaScript applications, making RayClay suitable for real-time overlays, machine telemetry, and low-latency trading.

API Conventions and Usability

The API follows consistent naming conventions: rc/PascalCase for public functions (rcAppCreate, rcBox), RC_/PascalCase for types (RC_AppOptions), and RC_+UPPER_SNAKE for constants (RC_GROW, RC_PX). All public functions and element macros reside in a single rayclay.h header. The framework includes macros for layouts (rcColumn, rcRow, rcSpacer), widgets (rcButton, rcCheckbox, rcSlider), text elements, menus, and theming.

Code example demonstrates a sidebar column with text and primary-styled button:

rcColumn(.id = "sidebar", .bg = RC_SLATE_800, .gap = 8, .p = 12) {
    rcTextL("Inbox", .color = RC_WHITE, .size = 18);
    if (rcButton("send", "Send", .variant = RC_BTN_PRIMARY))
        send_message();
}

C++ Compatibility and Sizing

rayclay.h wraps in extern "C" for C++20 compatibility, with the CMake target compiling the implementation as C automatically. Sizing tokens include RC_FIT, RC_GROW, RC_PX(n), and RC_PCT(n). Titlebar controls compile on all targets but emit nothing on the web and phones, where the browser tab or OS shell provides window chrome.

Philosophy and Goals

The framework emphasizes open source, OS agnosticism, lightweight outputs, and enterprise adoption potential. It follows the sokol README philosophy: easier integration with other languages, easier integration into other projects, and minimal size overhead to executables.