An Exploration of Terry A. Davis's Operating System Language
HolyC is a low-level, high-performance C-dialect created by the late Terry A. Davis (1969–2018). It serves as both the application language and core kernel programming environment for TempleOS—an independent, 64-bit multi-tasking operating system developed entirely from scratch over a decade[cite: 1].
Unlike conventional general-purpose programming languages designed to scale across thousands of libraries and distinct user permissions, HolyC was built to adhere to a singular, non-traditional philosophy: the entire system should fit within a single developer's head.
Standard high-level languages rely on complex execution stacks: user spaces, runtime libraries (`libc`), standard input/output abstractions, dynamic linkers (`ld.so`), and system call kernel boundaries[cite: 1].
HolyC bypasses this entire paradigm. Every line of code runs inside Ring 0 (kernel space)[cite: 1].
HolyC keeps standard C constructs like `if`, `while`, `for`, and `switch`, but adds significant syntax enhancements[cite: 1]:
In HolyC, string literals standing alone on a statement line automatically print to the current task's standard text output buffer without invoking `printf()`[cite: 1]:
Functions support optional default values directly in their parameters, eliminating function overloading or wrapper boilerplate[cite: 1]:
Expressions evaluated at the command prompt that do not end in semicolons automatically display their calculated numerical values to the shell console:
HolyC handles variadic function calls using a built-in `argc` and `argv` mechanism automatically generated by the compiler behind the scenes.
HolyC replaces standard C variable size specifiers (`short`, `int`, `long`) with explicit bit-length definitions[cite: 1]:
| HolyC Type | Bit Width | Byte Size | Type Equivalent |
|---|---|---|---|
| U0 | 0 | 0 | Void / Return-less Type[cite: 1] |
| I8 / U8 | 8 | 1 | Signed / Unsigned 8-bit Integer (Char)[cite: 1] |
| I16 / U16 | 16 | 2 | Signed / Unsigned 16-bit Integer[cite: 1] |
| I32 / U32 | 32 | 4 | Signed / Unsigned 32-bit Integer[cite: 1] |
| I64 / U64 | 64 | 8 | Signed / Unsigned 64-bit Integer[cite: 1] |
| F64 | 64 | 8 | Double Precision IEEE Floating-Point[cite: 1] |
| Bool | 8 | 1 | Boolean (`TRUE` = 1, `FALSE` = 0)[cite: 1] |
Because the HolyC compiler is integrated directly into the kernel memory space, code can dynamically generate, compile, and execute string expressions during runtime seamlessly[cite: 1].
HolyC classes can extend other structures directly without traditional Object-Oriented runtime dispatch overhead[cite: 1]:
TempleOS relies on a fixed VGA resolution mode (640x480, 16-color palette)[cite: 1]. HolyC provides immediate access to the global graphics display buffer (`gr.dc`) without calling external windowing system drivers[cite: 1].
Any function can drop straight down into raw x86_64 assembly code without needing specialized compiler intrinsics[cite: 1]:
| Category | Standard C (C11/C17) | HolyC (TempleOS) |
|---|---|---|
| Execution Level | User Mode (Ring 3)[cite: 1] | Kernel Mode (Ring 0)[cite: 1] |
| Compilation Paradigm | Static Ahead-of-Time (AOT)[cite: 1] | Dynamic Just-In-Time (JIT) + AOT[cite: 1] |
| Memory Protection | Virtual address memory space | Identity-mapped (Unprotected) |
| Function Default Parameters | No[cite: 1] | Yes[cite: 1] |
| Assembly Syntax | GNU Inline / Vendor extensions | Built-in `asm {}` blocks[cite: 1] |
| GUI / Rendering Engine | External Libraries (X11, Wayland, Win32) | Built-in Kernel Framebuffer API[cite: 1] |
HolyC remains a fascinating case study in operating system design, compiler engineering, and software minimalism. It serves as proof that a single engineer could construct an entire computing stack—from kernel to language compiler to graphics subsystem—without reliance on modern enterprise toolchains.