How hylo-lang/hylo-new works
Hylo is a safe systems programming language with a Swift-based compiler. The main workflow is source input through the hc command and driver, into parsing and semantic analysis, then IR generation and LLVM-backed output; the repository also includes an interpreter and standard library. The graph reflects documented and indexed connections, but several compiler-stage calls are only partially excerpted, so uncertain links are left out or marked dashed.
Main entry points: Driver.swift Compilation driver · Program.swift Program model · Interpreter.swift Interpreter · CommandLine.swift hc command
Components 18
Compiler entry
- hc command
Sources/hc/CommandLine.swift - Compilation driver
Sources/Driver/Driver.swift
Front end
- Source files
Sources/FrontEnd/Files/SourceFile.swift - Parser
Sources/FrontEnd/Parser/Parser.swift - Module model
Sources/FrontEnd/Module.swift - Program model
Sources/FrontEnd/Program.swift - Scope assignment
Sources/FrontEnd/Scoper.swift - Type checker
Sources/FrontEnd/Typer/Typer.swift - Diagnostics
Sources/FrontEnd/Diagnostic.swift - Hylo IR
Sources/FrontEnd/IR/IRFunction.swift
Execution
- Interpreter
Sources/Interpreter/Interpreter.swift - Runtime memory
Sources/Interpreter/Memory.swift
Code generation
- LLVM backend
Sources/BackEnd/FunctionGenerationContext.swift - LLVM toolchain
- clang linker
Language library
- Standard library
StandardLibrary/StandardLibrary.swift - C shims
StandardLibrary/Sources/shims.c
Other components
- Compiler user
Connections 18
- Compiler user → hc command: invokes
Sources/hc/CommandLine.swift - hc command → Compilation driver: configures
Sources/hc/CommandLine.swift - Compilation driver → Source files: loads
Sources/Driver/Driver.swift - Compilation driver → Parser: parses
- Parser → Module model: inserts syntax
Sources/FrontEnd/Parser/Parser.swift - Compilation driver → Module model: adds sources
Sources/Driver/Driver.swift - Compilation driver → Program model: assigns scopes
Sources/Driver/Driver.swift - Program model → Scope assignment: uses
Sources/FrontEnd/Program.swift - Program model → Type checker: uses
Sources/FrontEnd/Program.swift - Compilation driver → Diagnostics: checks errors
Sources/Driver/Driver.swift - Program model → Hylo IR: emits
Sources/FrontEnd/Program.swift - Interpreter → Program model: executes
Sources/Interpreter/Interpreter.swift - Interpreter → Runtime memory: uses
Sources/Interpreter/Interpreter.swift - Compilation driver → LLVM backend: generates code
- LLVM backend → LLVM toolchain: emits LLVM
- Compilation driver → clang linker: links with clang
README.md - Compilation driver → Standard library: loads library
Sources/Driver/Driver.swift - Compilation driver → C shims: compiles shim
Sources/Driver/Driver.swift