elvis/portfolio
back to all projects
investigating

Kairo

A modern programming language with its own syntax, parser, compiler pipeline, and runtime model.

Overview

Kairo is a programming language project built from first principles to explore how modern programming languages are designed, parsed, compiled, and executed. The project focuses on the complete language-engineering pipeline — from source code and lexical analysis to parsing, semantic analysis, intermediate representations, code generation, and runtime execution — while experimenting with language features designed around clarity, safety, and developer experience.

Stack

Language

Kairo

Compiler

LexerParserASTSemantic Analysis

Architecture

Compiler PipelineIRCode Generation

Runtime

Runtime SystemMemory ManagementExecution Model

Tooling

CLIREPLDiagnostics

Engineering

TestingError HandlingDocumentation

Demonstrates

Programming language designCompiler architectureLexical analysisParsingAbstract syntax treesSemantic analysisType systemsIntermediate representationsCode generationRuntime engineeringDeveloper tooling

Build timeline

  1. 1

    Designed Kairo from first principles by defining the language's syntax, semantics, execution model, and core programming constructs before implementing the compiler pipeline.

  2. 2

    Built a lexical analysis stage responsible for transforming raw source code into a structured stream of tokens while handling identifiers, literals, operators, keywords, delimiters, and lexical errors.

  3. 3

    Implemented a parser that transforms tokens into an Abstract Syntax Tree, establishing the structural representation required for subsequent semantic analysis and execution.

  4. 4

    Designed the compiler architecture as a sequence of explicit stages — lexing, parsing, AST construction, semantic analysis, intermediate representation, and execution or code generation — keeping language concerns separated from runtime concerns.

  5. 5

    Implemented semantic analysis to validate programs beyond syntax, including identifier resolution, scope management, expression validity, function usage, and type-related constraints.

  6. 6

    Explored Kairo's type-system design with an emphasis on predictable behavior, useful compiler diagnostics, and preventing classes of errors before program execution.

  7. 7

    Developed an execution model capable of evaluating Kairo programs while separating language semantics from the underlying host implementation.

  8. 8

    Built command-line tooling around the language so programs can be created, executed, inspected, and debugged through a consistent developer workflow.

  9. 9

    Added structured compiler diagnostics designed to make syntax and semantic errors understandable to developers by reporting meaningful messages and source locations instead of exposing internal compiler failures.

  10. 10

    Used automated tests to validate individual compiler stages as well as complete source-to-execution workflows, making language evolution safer as new syntax and features are introduced.

  11. 11

    Focused on the deeper engineering problems behind programming languages — parsing ambiguity, scope resolution, type checking, intermediate representations, runtime behavior, error recovery, and the boundary between compile-time and runtime responsibilities.

  12. 12

    Designed Kairo as an evolving language rather than a one-off interpreter, leaving room for future compiler optimizations, richer type-system capabilities, standard-library development, package management, and native or VM-based code generation.