-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
github-actions[bot] edited this page Jun 29, 2026
·
1 revision
How kura compiles Kyto projects — inside the ~21 KB binary.
kyto.toml ──┐
.kyto.config├──► parse config ──► merge ──► emit writers ──► artifacts
.kyto ──────┘ ▲ ▲
│ │
toml_min.asm kyto_eval.asm
config.asm lexer.asm
asm/src/
kura.asm Windows entry, command-line parsing
kura_linux.asm Linux ELF _start, argv → cmdline_rest
inc/kura_cmds.asm Shared: compile, check, init, dispatch
lexer.asm Tokenize .kyto sources
parse_util.asm AST helpers, string parsing
kyto_eval.asm Expression evaluator + emit calls
kyto_compile.asm Orchestrate full project compile
config.asm .kyto.config v2 parser
toml_min.asm Scrape paths from kyto.toml (minimal TOML)
emit_env.asm Write .env / .env.example
emit_users.asm SQL, JSON, TypeScript user outputs
emit_deploy.asm Bash export script
crypto.asm ChaCha20-Poly1305 encrypt/decrypt
cmd_crypto.asm encrypt/decrypt CLI
cmd_init.asm kura init scaffolding
str.asm strcpy, strcat, strcmp, trim
win_io.asm Windows file I/O
linux_io.asm Linux syscalls, read/write files
| Layer | Shared | Windows | Linux |
|---|---|---|---|
| Language | ✓ all .asm modules above |
||
| Entry | kura.asm |
kura_linux.asm |
|
| I/O | win_io.asm |
linux_io.asm |
|
| Install path | %USERPROFILE%\.local\bin |
~/.local/bin |
- Read
kyto.toml→ output paths - Parse
.kyto.config→ domain, users, env keys, REPO_* - Emit directly — no lexer
Fast. Used by Cloud portal and most Kyto Lite projects.
- Read
kyto.toml+.kyto.config - Lex + parse
kyto/main.kyto - Evaluate
emit env(...),emit users(...),emit deploy(...) - Merge with config overlay where applicable
- Write artifacts
- Line-oriented
KEY valueformat -
+comments - Special keys:
DOMAIN,USERS,ADMIN -
REPO_*→ deploy map - Quoted values with
unquote_value(stack-safe rewrite in ASM)
Each emitter is a separate .asm module:
| Module | Output |
|---|---|
emit_env.asm |
Key=value lines, redaction for .env.example
|
emit_users.asm |
SQL INSERTs, JSON array, TS export |
emit_deploy.asm |
export KEY="value" bash script |
Paths come from toml_min.asm scraping kyto.toml.
crypto.asm implements RFC 8439:
- ChaCha20 stream cipher
- Poly1305 MAC (AEAD)
- Key from
KYTO_KEYor~/.config/kyto/key -
KYTOmagic header on encrypted files
Used by kura encrypt / kura decrypt — no external crypto library.
# Linux
nasm -f elf64 -o kura_linux.o kura_linux.asm
ld -o kura-asm kura_linux.o
# Windows
nasm -f win64 -o kura.obj kura.asm
GoLink.exe /fo kura.exe kura.objbuild.ps1 can bootstrap portable NASM + GoLink on Windows.
push to main
├── asm-linux (ubuntu + nasm + build.sh + smoke compile)
└── asm-windows (windows + build.ps1 + smoke compile)
tag v*
├── build zip artifacts
├── push ghcr.io/voidmute/kyto
└── GitHub Release "Kyto v*"
- No runtime dependency beyond OS syscalls / Win32 API
- Shared language core — one bug fix applies to both platforms
-
Config-first —
.kyto.configworks without a parser for 90% of users - Local-only — no network code in compiler path
- Small binary — entire tool fits in L1 cache folklore territory
- Pick item from asm roadmap
- Change shared modules first; touch
win_io/linux_ioonly for I/O - Extend smoke test in
.github/workflows/ci.yml - Run
kura checkonexamples/minimal