veko-lang.org
Download Free EPUB 3.0

Part I · Language Foundations, Syntax, Cookbook & Tooling

Chapter 1

Overview, Philosophy & Three-Track Quickstart

Why Veko unifies parentheseless prefix words, single-owner ORO memory, homoiconic blocks, and three execution backends

Veko Language and Runtime
Veko Language and Runtime

Veko (.vk source, fixed-width 64-bit .vko portable bytecode, .wasm WebAssembly 3.0 modules, and standalone native executables across 5 zero-dependency OS/CPU targets: win-x64 PE32+, win-arm64 PE32+ 0xAA64, linux-x64 ELF64, linux-arm64 ELF64, and macos-arm64 Mach-O) is a 100% self-hosted homoiconic systems and dialect programming language (https://veko-lang.org) designed to read like clear human commands, reclaim memory deterministically without a garbage collector, and execute across three backends built in pure .vk (src/, 46 modules) paired with an embedded 95-module pure-.vk standard library (lib/).

Eko Inspecting Veko's Three Execution Tracks
Eko Inspecting Veko's Three Execution Tracks

Why Veko Exists

Most programming languages force an uncomfortable trade-off between low-level control (C, C++, Rust, Zig with heavy punctuation or lifetime annotations), everyday ergonomics (Python, Go, Ruby, TypeScript with stop-the-world garbage collection pauses), and syntactic extensibility (Lisp and Forth with parenthesis soup or manual stack shuffling). Veko unifies all three:

  1. Parentheseless Prefix Words + Infix Math: Call fixed-arity words left-to-right (os/write-file path data) while keeping natural infix arithmetic ((crc >>> 8) ^ table[i]), tight dot chains (raw.trim.lower), and slices (buf[0..n]).
  2. Deterministic ORO + Copy-on-Write Memory: Every heap value has a single owner (rc == 1) and frees deterministically at scope exit. Shared snapshots clone lazily only if mutated, and reference cycles are structurally impossible.
  3. Slash Refinements, Zero nil, and /or Recovery: Veko 1.0 has no nil. Unit actions evaluate to .ok, JSON null maps to .null, and missing lookups or I/O failures return catchable err values handled inline via /or [ fallback ] and LIFO defer.
  4. Homoiconic [ ... ] Dialects & Capability Security: Code and data share the same block representation (quote, compose, macro, parse-block), while veko.vk allow-caps and compile-time/runtime .secret firewalls prevent unauthorized syscalls and credential leaks.
UNIFIED COMPILER & RUNTIMES

Veko 1.0 Shared Frontend & Three-Track Execution Pipeline

39 compiler modules (src/) and 79 stdlib modules (lib/) feeding 64-bit VKO VM, Wasm 3.0 sandbox, and 4 native OS/CPU targets.

SHARED PURE-VEKO FRONTEND lexer.vk + parser.vk + macro_eval.vk + types.vk 79-MODULE PURE-VEKO STDLIB lib/* (shared across all 3 tracks) TRACK A: 64-BIT VKO VM vko_emit.vk + oro_vm.vk TRACK B: WASM 3.0 SANDBOX codegen.vk + runtime*.vk + vvm TRACK C: NATIVE X86_64 & AARCH64 native_emit.vk + arm64_emit.vk Tokens + tight RawBlock Expanded AST use DAG 64-bit VKO PAL calls Typed AST .wasm Typed AST Machine code FrontendWhitespace Lexer[tight] vs [spaced] FrontendTwo-Pass Pratt Parserarity scan + BP 80..0 MetaprogrammingHomoiconic Dialect Passquote / compose / parse-block Static AnalysisGradual Types & Capstypes.vk + .secret audit Standard Library79-Module Standard LibraryPQC + Reactor + Web + DB + UI Track A64-Bit VKO Bytecode VMsuperinstructions + REPL Track A HostGuarded VM Host PALVmPolicy + offscreen UI Track BWasm 3.0 Code Generatorlinear-RAM ORO + bulk mem Track B Hostvvm Zero-Trust SandboxWASI 0.3 + fuel + SSRF guard Track Cx86_64 & AArch64 AOTSIMD + 79-group DCE Track C LinkersPE32+ / ELF64 / Mach-Owin-x64, linux, macos-arm64
Component & ModuleArchitectural Role
Whitespace Lexer
lexer.vk
Tokenizes kebab-case words, slash paths, enums, unit literals, and attachment flags.
Two-Pass Pratt Parser
parser.vk
Resolves top-level arities and module aliases in Pass 1, then builds the AST in Pass 2.
Homoiconic Dialect Pass
macro_eval.vk
Expands compile-time macros and structural block dialects before code generation.
Gradual Types & Caps
types.vk
Checks gradual/strict types, generics [T], mut loans, .secret sinks, and veko.vk allow-caps.
79-Module Standard Library
lib/*
Delivers codecs, NIST FIPS 203/204/205 PQC, TLS 1.3, HTTP/2, Reactor, Durable Workflows, DBs, and TUI/2D UI.
64-Bit VKO Bytecode VM
vko_emit.vk + oro_vm.vk
Executes fixed-width 64-bit VKO instructions, interactive REPL sessions, and .vko bundles.
Guarded VM Host PAL
oro_vm.vk
Enforces runtime capability flags (--allow-fs, --allow-net) and .secret sink checks.
Wasm 3.0 Code Generator
codegen.vk + wasm_enc.vk
Emits standalone WebAssembly 3.0 modules with embedded 12-bucket ORO slab allocators.
vvm Zero-Trust Sandbox
runtime*.vk
Runs Wasm modules under deterministic fuel quotas, memory caps, and host sandboxes.
x86_64 & AArch64 AOT
native_emit.vk + arm64_emit.vk
Compiles directly to native x86_64 and ARM64 machine code with zero external toolchain.
PE32+ / ELF64 / Mach-O
pe_emit.vk + elf_emit.vk + macho_emit.vk
Links standalone executables for Windows x64, Linux x64/arm64, and Apple Silicon.

Three Execution Tracks: Purpose & Decision Guide

All three execution tracks share the exact same lexer, Pratt parser, type/capability checker, ORO ownership rules, and 95-module lib/ standard library (embedded directly inside the single-binary veko SDK):

EXECUTION MODES

Choosing Between Veko's Three Execution Tracks

Write idiomatic .vk code once and select the runtime envelope matching development speed, isolation, or native deployment.

SOURCE WORKSPACE veko.vk + src/*.vk RUNTIME & DEPLOYMENT ENVELOPES Identical ORO & .secret semantics --vm (default) --wasm --native .wasm PE / ELF / Mach-O SourceVeko Source & Manifestveko check --strict-types DevelopmentTrack A: ORO Bytecode VMveko run app.vk / veko repl Zero-TrustTrack B: Wasm 3.0 Sandboxveko run --wasm --fuel=... ProductionTrack C: Native Machine Codeveko compile --native DeliveryShipped Artifacts.exe / ELF64 / Mach-O / .vkp
Component & ModuleArchitectural Role
Veko Source & Manifest
main.vk + types.vk
Single source of truth defining module imports, types, and capability declarations.
Track A: ORO Bytecode VM
oro_vm.vk
Fastest edit-run-test cycle, interactive REPL, and portable .vko bytecode bundles.
Track B: Wasm 3.0 Sandbox
codegen.vk
Deterministic capability-confined execution for untrusted extensions and CI leak audits.
Track C: Native Machine Code
native_emit.vk + arm64_emit.vk
Standalone zero-GC executables with SIMD acceleration and cross-OS compilation.
Shipped Artifacts
pe_emit.vk + elf_emit.vk + macho_emit.vk
Self-contained binaries and Ed25519/ML-DSA signed VKP1 source bundles.
Decision CriteriaTrack A: --vm / .vkoTrack B: --wasm (vvm)Track C: --native (x86_64 & arm64)
Primary GoalInstant run, live REPL & .vko bundlesZero-trust isolation & leak verificationStandalone OS binaries with zero runtime deps
TargetsCross-platform 64-bit VKO VMWebAssembly 3.0 + WASI 0.3 (vvm)win-x64, win-arm64, linux-x64, linux-arm64, macos-arm64
Sandbox & Quotas--fuel, --allow-fs, --allow-net, --allow-listen, --allow-private-netFull HostSandbox (--fuel, --mem-pages, --check-slabs, FS chroot, SSRF guard)Compile-time veko.vk allow-caps + runtime .secret firewall
Networking & UIlib/net/client, lib/web, lib/reactor, lib/tui, offscreen .uiWASI sockets/net-poll + lib/web, lib/tui, offscreen .ui (.ffi forbidden)Full OS sockets/DNS/TLS 1.3, epoll/kqueue/IOCP, live Win32 --gui, opt-in .ffi

Meet Eko — The Veko Mascot

Eko the Galago — Veko Language Mascot
Eko the Galago — Veko Language Mascot

Veko's mascot is Eko, a silver-taupe Galago (bush baby):

  • Why a Galago named Eko? Eko plays on echo—the clean reflection of homoiconic [ ... ] blocks and compile-time dialects that turn domain notation directly into native code—paired with V to form Veko.
  • Oversized Amber Eyes & Inspectability: A bush baby sees clearly in the dark without guesswork, mirroring Veko's explicit mut loans and built-in token, AST, module, and bytecode inspectors (veko inspect).
  • Independent Acoustic Ears & Refinements: Galagos swivel each ribbed ear to isolate exact signals; Veko's slash refinements (/timeout, /secret, /or) and parse-block rules compose behavior cleanly at the call site.
  • Nimble Single-Branch Balance (ORO + CoW): Agile and lightweight, a Galago lands cleanly on one branch at a time—just as One Reference Only keeps a single owner per value and reclaims memory deterministically without GC pauses.

End-User Documentation Reading Path

Order & GuideAudienceWhat You Will Learn
01. Overview & Quickstart (this page)EveryoneCore pillars, execution tracks, and first commands
02. Full TutorialNew Learners9 hands-on lessons from REPL & pipes through macros, spawn, and structs
03. Language GuideDevelopersComplete guide to syntax, whitespace rules, ORO memory, closures, and dialects
04. How-To & Newcomer GuideNewcomers & Devs5 pointers on how to read/write Veko, token/AST inspection, and project recipes
04b. Cookbook & Language ComparisonsEvaluators & DevsIdiomatic recipes plus Readability & Writability vs. Go, Rust, Zig, Elixir/Rebol, and Python/TS
05. Developer ToolingAll Engineersveko debug & VS Code F5 DAP, veko test --coverage, testing/fuzz, veko fmt, veko lsp, veko doc --html, SVG flamegraphs, veko-lang.org packages, and migrators
06. Standard Library & PQCApp & Crypto DevsComplete 95-module stdlib index, collections, codecs, classical crypto, and NIST FIPS 203/204/205 PQC
07. Net, Web, DB & VKP1Backend & Web Devsio/Stream, DNS, Hybrid PQC TLS 1.3, HTTP/2, QUIC HTTP/3, WebSockets, web + html, JWT/OAuth2/TOTP, Zero-FFI SQLite 3 & ORM (db/sqlite), db/*, and veko-lang.org VKP1 packages
08. Async I/O & ReactorSystems Devsepoll/kqueue/IOCP readiness reactor, timers, cross-thread wakers, web/serve-reactor, and batch HTTP
09. Durable Objects & WorkflowsDistributed DevsCrash-safe Durable Objects and replay-safe Durable Workflows with LIFO sagas over db/kv
10. TUI, Native UI & FFIDesktop & C/Rust DevsDiffing ANSI tui, 29-widget RGBA32 desktop UI, Win32 + Linux Wayland/X11 + macOS arm64 Cocoa + Wasm <canvas>, clipboard/Hi-DPI, and .ffi (VEKO_LIB)
11. Perf, SIMD & ARM64Systems EngineersZero-JIT philosophy, AVX2/SSE2/AES-NI, cached veko run --native, and win-arm64/linux-arm64/macos-arm64
12. Examples & Showcase AppsAll EngineersWalkthrough of all 45 examples (01..40 + core tours) and 6 multi-module demos/ apps
13. Administrator GuideOperators & SecOpsBuild governance, allow-caps, vvm HostSandbox quotas, VKP1 trust-keys, and .secret wiping
14. CLI & Syntax ReferenceAll UsersComplete CLI subcommands & flags, veko.vk schema, Pratt precedence ladder, and 105+ builtin arities
15. Master User HandbookAll UsersConsolidated single-page edition of all End-User guides

Zero-Install Playground & One-Line SDK Installation

Try Veko instantly in your browser (client-side WebAssembly 3.0 Web Worker + <canvas> + sandboxed 64-bit VKO VM) at https://veko-lang.org/play, or install the single-binary portable SDK on Linux, macOS Apple Silicon, or Windows (x86_64 and native Windows 11 ARM64 — Snapdragon X Elite/Plus, Surface Pro/Laptop, and Windows on ARM VMs):

BASH
# Linux (x86_64 / arm64) and macOS (Apple Silicon arm64) — SHA-256 verified
curl -fsSL https://veko-lang.org/install.sh | sh
POWERSHELL
# Windows (PowerShell — auto-detects x64 vs. ARM64 and installs veko-1.0.0-win-x64.zip or veko-1.0.0-win-arm64.zip)
irm https://veko-lang.org/install.ps1 | iex

Offline .zip SDK archives (veko-1.0.0-win-x64.zip for Windows x86_64 PE32+ and veko-1.0.0-win-arm64.zip for native Windows 11 ARM64 PE32+ 0xAA64, bundling veko.exe, lib/, examples/, AGENTS.md, README.md, and LICENSE) are also available at https://veko-lang.org/download.


Quickstart Commands

POWERSHELL
# Verify all 18 test suites or run the full S1 == S2 build orchestrator
veko run tests/run_tests.vk
veko run build.vk -- all

# Run programs across ORO VM (--vm), Wasm 3.0 (--wasm), or cached Native (--native)
veko run examples/hello.vk
veko run --wasm --check-slabs examples/09_concurrent_worker_pool.vk
veko run --native examples/29_async_reactor_http_server_and_client.vk
veko run --native examples/32_durable_objects_and_workflows.vk

# Cross-compile standalone native binaries for all 5 zero-dependency OS/CPU targets
veko compile --native --target=win-x64     examples/14_http_json_api_server.vk -o dist/api.exe
veko compile --native --target=win-arm64   examples/hello.vk -o dist/hello_win_arm64.exe
veko compile --native --target=linux-x64   examples/hello.vk -o dist/hello_linux_x64
veko compile --native --target=linux-arm64 examples/hello.vk -o dist/hello_linux_arm64
veko compile --native --target=macos-arm64 examples/hello.vk -o dist/hello_macos_arm64

# Run multi-module showcase applications (Web, Desktop GUI, Multi-Protocol Mesh, PQC Vault)
veko run --native demos/taskflow_studio/src/main.vk
veko run --native demos/canvas_workbench/src/main.vk
veko run --native demos/pulse_mesh/src/main.vk
veko run --native demos/vault_dialect/src/main.vk

# Launch the interactive REPL or regenerate HTML documentation
veko repl
veko docs