Jamesbarford/holyc-lang logo

Jamesbarford/holyc-lang

Free

HolyC compiler & transpiler

FreeFree tier
Type
Open Source

About Jamesbarford/holyc-lang

A compiler for Terry A. Davis's HolyC programming language, implemented in C. The project includes an Ahead-of-Time (AOT) compiler that uses clang internally for linking, a Just-in-Time (JIT) compiler, a REPL, an LSP server (with neovim setup), an assembler used in asm {} blocks, and a disassembler. It works by building an AST, lowering to an SSA-based IR, and emitting x86_64 or AArch64 assembly. The compiler supports most major language features including floating-point arithmetic, inheritance, loops, and printf-style I/O. There is also experimental support for transpiling HolyC to C. The compiler is in a working state but error messages are inconsistent, and the project is intended more for educational and fun purposes than for serious software development.

Key Features

Ahead-of-Time (AOT) compiler using clang for linking
Just-in-Time (JIT) compiler with builtin assembler
Read-Eval-Print Loop (REPL) for interactive use
Language Server Protocol (LSP) implementation with neovim setup
Built-in assembler for asm {} blocks and disassembler
Experimental transpilation from HolyC to C
Basic optimizations: constant folding and dead code elimination
Supports x86_64 and AArch64 architectures
Includes HolyC standard libraries for strings, hashtables, I/O, math, networking, JSON parsing, etc.

Pros & Cons

Pros
  • Educational: clear mapping from source to assembly code
  • Implements most major HolyC language features
  • Multiple execution modes: AOT, JIT, REPL
  • LSP support enables IDE integration
  • Includes standard libraries for common tasks
  • Cross-platform support for Intel and ARM Macs, Linux on x86_64 and AArch64
Cons
  • Error messages are inconsistent and hit-or-miss
  • Not intended for production or serious software development
  • Transpilation to C is experimental and only partially working
  • Limited to Linux and macOS; Windows requires WSL2
  • Still under development with pernicious bugs

Best For

Learning about compiler construction and language implementationExperimenting with Terry A. Davis's HolyC languageCompiling and running HolyC programs on Linux or macOSTranspiling HolyC code to C for integration with C projectsEducational demonstration of AST, SSA IR, and assembly generation

FAQ

What is HolyC?
HolyC is a programming language created by Terry A. Davis, known for the TempleOS operating system. This compiler implements the HolyC language from scratch in C.
What can this compiler do?
It provides an AOT compiler, a JIT compiler, a REPL, an LSP server, a built-in assembler, a disassembler, and experimental transpilation to C. It supports x86_64 and AArch64 architectures.
Is this compiler production-ready?
No, it is stated to be more for fun than for serious software development. Errors are hit-or-miss, and the transpiler is experimental and broken in many ways.
On which operating systems does it run?
It is tested on Linux (x86_64 and AArch64) and macOS (Intel and M1/M4). Windows requires WSL2.