H0/TAPE NATIVE | UTF-8 | TARGET=AI AGENT | ZERO EXTERNAL DEPENDENCIES REPO https://github.com/h0lang/h0 | SPEC https://h0lang.com/docs/h0-agent-v0.1.0.txt WHY HANGUL: Unicode precomposed Hangul Syllables (U+AC00..U+D7A3, 19*21*28 = 11,172 syllables) encode up to 11,172 dense Tape patterns as single 3-byte UTF-8 glyphs (typically 1 BPE token) paired with positional registers a..z,$26... CLI (Linux: ./h0 | Windows: .\h0.cmd — uses native self-hosted compiler, no LLVM/GCC/Python): h0 check FILE [--target win|linux|rv64|win-gui|rv64-boot] [--with MOD...] Verify Tape & emit [hint: ...] h0 coach FILE [--target win|linux|rv64] [--with MOD...] One-shot check + hint + caret + repair h0 run FILE [--with MOD...] [-- args...] Compile natively & execute h0 test [FILE|DIR] [--with MOD...] Run pure-H0 unit tests (std/test.h0) h0 mcp [--build [-o OUT]] Run or build 45.7 KB zero-dep native MCP server h0 build FILE [-o OUT] [--target win|linux|rv64|win-gui|rv64-boot] [--with MOD...] h0 guide FILE [--target win|linux|rv64] Scoped grammar & std contract (Mode 60) h0 index FILE [--named] | h0 extract FILE SEL | h0 callees/callers FILE ORD h0 repair FILE [--patch] | h0 expand FILE | h0 bundle MANIFEST [-o OUT] h0 corpus [DIR] [-o OUT.jsonl] Pure-H0 SFT/LoRA JSONL corpus (2,056 sections) h0 self-host 4-stage fixed-point SHA-256 (stage3 == stage4) h0 verify Fixed-point + 106/106 examples + live FFI, MCP & tests NOTE: h0 automatically resolves '# Append std/...' and '# Bundle std/...' headers in multi-module files. UNIT physical line/function. >+IDs std bundle header MUST be line 1. ASCII SP separates instructions; TAB separates adjacent decimals, block counts, or named call/args. # comment outside literals. Prefix expressions; bind lowest unused register a..z,$26... HEAD decimal arity; unnamed entry N; Nname export; N-name or N- private; N+name extern. Order: shared 'a BEFORE mutable "b BEFORE owned `c; return suffix , owner / ; Result / ~ Option. Example: 3-copy'a"b takes shared view a, mutable view b, scalar c. CALL :2ab local section 2; :nameargs named; :: self; :< prev; :> next. ' forwards remaining; " forwards two; `N forwards N. Y discards call result. EXPR u64. Binary + - * / % & ^ | < > E D L G S T A O = add sub mul div rem and xor or lt gt eq ne le ge shl shr && ||. +-* wrap; shifts mod 64; /% trap on 0; A O lazy. Unary N ! ~ P = neg not compl popcount. Rab rotl; _ab sar; \dab signed div; \rab signed rem. 다abc=\iabc lazy ternary. STMT b bind/set; +b add. Tail or .expr returns. ?test branch; @end 0..end-1 (next reg=index); Wtest pre-test; \Dtest post-test. Multi-stmt blocks use ( ... ) or TAB+count (and TAB+else_count for ?). ' break, ` continue. Qend expr sums; \=ab... parallel assign. BYTES Za len; Bab checked byte load; Vabc borrow a[b:c]; \vab a[b:]; \B2/\B4/\B8 LE u16/u32/u64 load; \Q2/\Q4/\Q8 LE store. \b"..." UTF-8 literal; \s"..." <=8B LE u64; \*N:hh repeat byte. Temporary loans Va0b from local M owners must be passed directly into a call (not bound to a local reg). MUT bMa zeroed owner; Xabc checked byte store; "ab fill; ]ab equal-len copy; ,abcd overlap-safe slide; KabN splits mutable a at b into two disjoint views for N statements. Mutable/consuming calls must be standalone, full RHS, or direct return. TAGS Ia Ok; Fa Err; Ha Some; J None. Cexpr / [expr match (payload next reg); ;expr propagates. FFI & H0-NATIVE ARCHITECTURES (Pure H0): - Native MCP Server (std/mcp.h0, examples/mcp-server.h0): RFC-8259 JSON-RPC 2.0 over stdio (initialize, ping, tools/list, tools/call: h0_sha256, h0_base64, h0_merkle_root, h0_cabi_layout); compiles to 45.7 KB static Linux ELF / 47.0 KB Win PE, 1.23 ms cold start. - Windows C ABI FFI (>+f + std/ffi-win.h0): :ffi_open (ASCII/UTF-8 DLL path), :ffi_sym, :ffi_c0..c6 (RCX..R9 + XMM0..XMM3), :ffi_f1/:ffi_f2 (:wf returns xmm0 f64 bits), :ffi_ptr, :ffi_cstr, \@fn native Win64 C callbacks (examples/ffi-cabi.h0). - Linux x64 Dynamic C ABI FFI (std/ffi-linux.h0, examples/ffi-linux.h0): emits 6-PHDR dynamic ELF64 (PT_INTERP + PT_DYNAMIC + R_X86_64_GLOB_DAT against libdl.so.2 + libc.so.6) with :dl_open, :dl_sym, :dl_close, :dl_c0..c6 (RDI..R9 + XMM0..XMM5), :dl_f1/:dl_f2 (returns xmm0 f64 bits), zero gcc/ld required. - Pure-H0 Unit Testing (std/test.h0, examples/test-suite.h0): :t_init, :t_eq, :t_true, :t_bytes, :t_done; run via 'h0 test'. - Cross-platform C ABI struct layout: std/c-abi.h0, examples/ffi-struct.h0. - Section-CAS / Merkle-Tape: std/merkle-tape.h0, examples/merkle-tape.h0 (SHA-256 per section + root). - Self-Carrying Executable: std/self-carrier.h0, examples/self-carrier.h0 (--h0-source / --h0-hash / --h0-info). - Proof-Carrying Atomic Patcher (OCC): std/proof-patch.h0, examples/proof-patch.h0 (pre-root + section hash check, exit 3 on conflict). - Pure-H0 SFT/LoRA Corpus Generator: std/corpus-gen.h0, examples/corpus-gen.h0. COMMON COMPILER HINTS: - E101: header is N[name]['shared]["mut][~|;]; >+IDs must be line 1; shared ' before mut ". - E102: bind lowest free a..z; TAB separates counts/digits; use (...) for multi-stmt blocks; pass Va..b directly to calls. - E103: call as :nameargs or append std/*.h0; run 'h0 index' to list labels. - E104: rename duplicate label or call by section ordinal :N. - E136: close every ( block with matching ) before section end. CORE GLYPH ALIASES (expand outside comments/strings): {"진":"Qa*bb","러":"11400714819323198485","수":"18446744073709551615","경":"Qa","고":"+ab","드":"+c1","자":"*bb","산":"%ab","원":"Za","환":"Ba0","비":"Bb0","출":"Za0","우":"Za1","록":"@a","운":"W1","나":"'1","체":"`1","제":"Kac","구":"]eb","턴":"+Ba0","인":"GcZa","공":"^bSb","류":"^bTb","회":":2ba","게":"e0","크":"Ef0","리":"Bac","세":"P*b","료":"P^","내":"Ef255","가":"65535","명":"4294967295","서":"2147483648","음":"9223372036854775808","요":"\\d","일":"\\r","만":"\\e","다":"\\i","들":"+_h0_host_stdin\"a","라":"+_h0_host_stdout'a","니":"+_h0_host_flush","래":"+_h0_host_stderr'a","결":"+_h0_host_file_open'a","닷":"+_h0_host_file_read_handle\"b","그":"+_h0_host_file_write_handle'b","디":"+_h0_host_file_close"}