How aristrahatsuyu/flyuxc works
FLYUXC is an ahead-of-time compiler for the FLYUX language, including Unicode/emoji identifiers, type inference, and native executable generation. Its main workflow reads a source file, normalizes it, maps variable names, lexes and parses it, generates LLVM IR, then asks the LLVM backend to produce an executable. The runtime supplies value operations and built-ins such as arrays, strings, file I/O, JSON, and math. Error reporting is a shared internal layer for source-position diagnostics. The README documents additional language capabilities not fully evidenced in the sampled source; those are represented at the relevant stages without asserting unsampled call wiring.
Main entry points: codegen.c LLVM IR generation · main.c CLI entry · parser.c AST parser · llvm_compiler.cpp LLVM compiler
Components 24
Frontend
- Source normalization
src/frontend/lexer/normalize.c - Identifier mapping
src/frontend/lexer/varmap.c - Unicode lexer
src/frontend/lexer/lexer.c - AST parser
src/frontend/parser/parser.c - Program AST
include/flyuxc/frontend/ast.h
Code Generation
- LLVM IR generation
src/backend/codegen/codegen.c - Expression generation
src/backend/codegen/codegen_expr.c - Closure generation
src/backend/codegen/codegen_closure.c - LLVM IR
Runtime
- Runtime values
src/backend/runtime/value_runtime_value.c - Arrays and objects
src/backend/runtime/value_runtime_array.c - Strings and casts
src/backend/runtime/value_runtime_string.c - Runtime built-ins
src/backend/runtime/value_runtime.c - File and console I/O
src/backend/runtime/value_runtime_file.c - JSON operations
src/backend/runtime/value_runtime_json.c - Math operations
src/backend/runtime/value_runtime_math.c
Native Backend
- LLVM compiler
src/backend/llvm_compiler.cpp - Embedded runtime data
src/backend/embed_runtime.c
Compiler Support
- CLI entry
src/main.c - Source file I/O
src/utils/io/io.c - Source diagnostics
src/core/error.c
Other components
- Compiler user
- FLYUX source
- Native executable
Connections 24
- Compiler user → CLI entry: invokes
- CLI entry → Source file I/O: reads source
- Source file I/O → FLYUX source: loads
- CLI entry → Source normalization: normalizes
- CLI entry → Identifier mapping: maps identifiers
- CLI entry → Unicode lexer: tokenizes
- CLI entry → AST parser: parses tokens
- AST parser → Program AST: builds
- CLI entry → LLVM IR generation: generates IR
- LLVM IR generation → Expression generation: dispatches expressions
- LLVM IR generation → Closure generation: generates closures
- LLVM IR generation → LLVM IR: emits
- CLI entry → LLVM compiler: compiles IR
- LLVM compiler → Embedded runtime data: loads embedded runtime
- LLVM compiler → Native executable: links native output
- LLVM IR generation → Runtime values: emits runtime calls
- LLVM IR generation → Arrays and objects: emits array calls
- LLVM IR generation → Runtime built-ins: emits builtin calls
- LLVM IR generation → File and console I/O: emits I/O calls
- LLVM IR generation → JSON operations: emits JSON calls
- LLVM IR generation → Math operations: emits math calls
- LLVM IR generation → Strings and casts: emits string calls
- CLI entry → Source diagnostics: reports diagnostics
- AST parser → Source diagnostics: reports diagnostics