$ show Jamesbarford/holyc-lang
hcc is a compiler for the HolyC language, a derivative of TempleOS HolyC. It supports both ahead-of-time (AOT) compilation to x86_64 and AArch64 assembly and just-in-time (JIT) compilation for in-memory execution. The system includes a full front-end (lexer, parser, AST, SSA-based IR), optimization passes, register allocation, and backends for x86_64 and AArch64. Additionally, it provides a REPL, a Language Server Protocol (LSP) server, an inline assembler (TempleOS-style), a disassembler, and a control-flow graph visualizer. The standard library is written in HolyC and offers data structures (lists, vectors, hash maps, red-black trees), JSON/CSV parsers, SQLite bindings, networking, threading, coroutines, and system call wrappers. The project is a self-contained, well-structured compiler toolchain with extensive tests and active development.
The LLM identified 3 files worth highlighting for reuse:
Simple, efficient arena allocator for compile-time data. Provides bump allocation from large blocks and full reset, eliminating per-object free. Used pervasively in the compiler for AST nodes, types, and other temporary structures. Could be extracted for any C project needing fast, disposable allocations.
Type-erased generic vector, map, and set containers implemented in C using function pointers for hashing, comparison, and cleanup. Supports iteration and arbitrary element types. Demonstrates a clean pattern for generic programming in C without macros. Reusable in any C project needing dynamic collections.
Hand-rolled JSON parser supporting full Unicode (surrogate pairs) with depth-limited recursion. Used for LSP protocol message parsing. Self-contained and robust, can be extracted for any C project needing a lightweight JSON parser.