Veko — Developer Tooling Guide (debug, --coverage, fuzz, fmt, lsp, VS Code & pkg)
Veko ships its entire developer experience inside the single self-hosted veko executable with zero external runtime dependencies: an interactive CLI source debugger & VS Code F5 Debug Adapter Protocol server (veko debug, veko debug --dap), compiler-verified line coverage (veko test --coverage, --lcov), deterministic structure-aware fuzzing & counterexample shrinking (lib/testing/fuzz.vk), a whitespace-safe formatter (veko fmt), a native Language Server Protocol 3.17 server (veko lsp), self-contained HTML API docs with live Wasm 3.0 <canvas> previews (veko doc --html), Light-Mode SVG flamegraphs (--flamegraph), veko-lang.org + decentralized HTTPS .vkp package management (veko pkg add, ~/.veko_modules, veko.lock), and assisted Go/Python/Rust/V migration translators.
Self-Hosted Formatter, LSP Server, Doctest Runner & Source Migrators
Every IDE, formatting, documentation, package-signing, and code-migration tool ships inside the single veko binary.
1. Canonical Source Formatter (veko fmt)
veko fmt enforces consistent tab indentation for [ ... ] and { ... } blocks, continuation \ pipe alignment, LF line endings, trimmed trailing whitespace, and single blank-line separation while strictly preserving Veko's load-bearing [tight] vs [spaced] token boundaries, single-quoted strings, and // comments.
# Print formatted output to stdout
veko fmt src/app.vk
# Format a file or entire directory tree in place
veko fmt --write src/
# CI gate: exit non-zero if any .vk file needs formatting
veko fmt --check src/ lib/ examples/
# Preview a unified diff without modifying files
veko fmt --diff src/app.vk
Formatting is guaranteed idempotent: running veko fmt twice produces byte-identical output.
2. Native Language Server (veko lsp)
veko lsp runs a pure-Veko JSON-RPC 2.0 Language Server over standard input/output (Content-Length framing). Any LSP-compatible editor (VS Code, Neovim, Helix, Zed) can launch veko lsp directly with no Node.js or external language server binary.
| LSP Feature | Method | Capabilities |
|---|---|---|
| Live Diagnostics | textDocument/publishDiagnostics |
Lexer, parser, gradual/strict types, mut borrow rules, .secret sinks, and veko.vk capability checks on open/change/save |
| Hover Documentation | textDocument/hover |
Signatures and // doc comments for local symbols, imported stdlib modules (doc_cmd), and core Veko keywords |
| Go to Definition | textDocument/definition |
Jumps to top-level fn, struct, and constant definitions in the current file or imported modules |
| Contextual Completion | textDocument/completion |
Triggered on /, ., and \: module exports (dt/), enum literals (.ok, .fs, .exec), local defs, and Veko builtins |
| Document Outline | textDocument/documentSymbol |
Structured outline of top-level functions, structs, and values |
| Canonical Formatting | textDocument/formatting |
Formats documents directly via veko fmt |
| Quick-Fix Code Actions | textDocument/codeAction |
Turns 'did you mean ...' diagnostics into 1-click workspace edits |
Connecting Other Editors to veko lsp
Because veko lsp speaks standard JSON-RPC 2.0 over stdio, non-VS Code editors connect with a few lines of configuration:
- Helix (
~/.config/helix/languages.toml):
[language-server.veko-lsp]
command = "veko"
args = ["lsp"]
[[language]]
name = "veko"
scope = "source.veko"
file-types = ["vk"]
comment-token = "//"
indent = { tab-width = 4, unit = "\t" }
language-servers = ["veko-lsp"]
auto-format = true
- Neovim (
init.lua— built-invim.lsp.start):
vim.filetype.add({ extension = { vk = "veko" } })
vim.api.nvim_create_autocmd("FileType", {
pattern = "veko",
callback = function(ev)
vim.lsp.start({
name = "veko-lsp",
cmd = { "veko", "lsp" },
root_dir = vim.fs.dirname(vim.fs.find({ "veko.vk", ".git" }, { upward = true })[1] or ev.file),
})
end,
})
3. Visual Studio Code Extension (editors/vscode/)
The repository includes a zero-dependency VS Code extension in editors/vscode/ (also packaged as an installable veko-lang-1.0.0.vsix bundle with zero Node build step or external language server installation required).
3.1 Installing the Extension
Choose one of the following installation methods:
- Install Packaged
.vsixBundle (Recommended for End Users):
code --install-extension veko-lang-1.0.0.vsix
- Windows (PowerShell — Copy from Repository):
Copy-Item -Recurse -Force .\editors\vscode "$env:USERPROFILE\.vscode\extensions\veko-lang"
- Linux / macOS (Symlink — Auto-Tracks Repo Updates):
ln -s "$(pwd)/editors/vscode" "$HOME/.vscode/extensions/veko-lang"
- Try Immediately Without Installing:
code --extensionDevelopmentPath=./editors/vscode .
After copying or symlinking, reload VS Code (Ctrl+Shift+P / Cmd+Shift+P -> Developer: Reload Window).
3.2 Configuring VS Code Settings
Open Settings (Ctrl+,) or edit your User/Workspace settings.json to point the extension at your self-hosted veko binary and enable canonical tab-based format-on-save:
{
"veko.executablePath": "dist/bin/veko.exe",
"veko.strictTypes": false,
"[veko]": {
"editor.formatOnSave": true,
"editor.insertSpaces": false,
"editor.tabSize": 4
}
}
- Set
veko.executablePathto"veko"if the binary is already on yourPATH, or an absolute path such as"/path/to/veko/dist/bin/veko"on Linux. - Set
"veko.strictTypes": trueif you want Veko: Check Types & Secrets to enforce--strict-typesby default.
3.3 Using the Extension (LSP, CodeLens & Command Palette)
Opening any .vk file automatically activates syntax highlighting and starts veko lsp in the background:
- Editor Intelligence: Hover over functions, structs, or stdlib paths (
datetime/parse-rfc3339) for live signatures & docs; press F12 for Go to Definition; trigger completion on/,., and\; press Shift+Alt+F to format viaveko fmt; click the lightbulb (Ctrl+.) to apply 1-click'did you mean?'quick-fixes. - Top-of-File CodeLens Bar: Every
.vkfile displays one-click links at line 1:Run (VM),Run (Wasm),Check,Docs,Doctest, andInspect. - Visual Inspector Side Panel (
Veko: Open Visual Inspector): Opens a theme-aware Webview panel beside your editor with 5 switchable tabs (--tokens,--ast,--modules,--bytecode,--wasm), live token filtering, color-coded[tight]vs[spaced]whitespace badges, click-to-jump from any token row directly to itsline:colin the editor, and automatic refresh whenever you save the.vkfile.
![Veko Visual Inspector Side Panel — Interactive [tight] vs [spaced] Token Table Alongside .vk Source](../screenshots/vscode_02_visual_inspector_light.png)
- Command Palette (
Ctrl+Shift+P-> typeVeko:):
| Command | CLI Equivalent | Purpose |
|---|---|---|
| Veko: Run Current File | veko run <file> |
Execute active .vk file on the 64-bit ORO VM |
| Veko: Debug Current File (F5) | veko debug --dap |
Launch interactive VS Code F5 DAP debugging with breakpoints, call stacks, expandable structs/maps, and <secret> redaction |
| Veko: Run in Wasm 3.0 Sandbox | veko run --wasm <file> |
Execute active .vk file inside vvm Wasm 3.0 |
| Veko: Check Types & Secrets | veko check [--strict-types] <file> |
Run static gradual/strict types, mut borrow, and .secret checks |
| Veko: Format Document | veko fmt (via LSP) |
Format active buffer canonically in place |
| Veko: Show API Docs for Current File | veko doc <file> |
Display extracted // API signatures, capabilities, and examples |
| Veko: Look Up Module / Symbol Docs | veko doc <mod> [sym] |
Prompt (pre-filled from cursor) to look up any stdlib or workspace symbol |
| Veko: Export API Docs (api.json) | veko doc --json <file> -o <file>.api.json |
Write machine-readable JSON API docs alongside the file |
| Veko: Export API Docs (Markdown) | veko doc --md <file> -o <file>.api.md |
Write Markdown API reference alongside the file |
| Veko: Run Doctests | veko doc --test <file> |
Execute all fenced vk ` doctests in the current file |
| Veko: Build HTML Documentation & Playground | veko docs |
Regenerate all End-User & Technical HTML handbooks into dist/docs/ |
| Veko: Open Visual Inspector | veko inspect --tokens|--ast|--modules|--bytecode|--wasm <file> |
Open the interactive side-by-side Visual Inspector Webview with live tabs, [tight]/[spaced] badges, click-to-jump tokens, and auto-refresh on save |
| Veko: Inspect Tokens / AST / Modules / Bytecode / Wasm | veko inspect <flag> <file> |
Open the Visual Inspector directly on the chosen tab |
3.4 Troubleshooting
- No diagnostics or hover appearing: Open View -> Output and select the
Vekochannel. Verify thatveko.executablePathpoints to a working binary (veko versionworks in your terminal). - Spaces instead of tabs on Enter: Confirm
"[veko]": { "editor.insertSpaces": false }is set insettings.jsonso VS Code matchesveko fmt's canonical tab indentation.
4. API Docs, Doctests & Interactive Web Playground (veko doc & veko docs)
4.1 Terminal, Self-Contained HTML & Doctest API Docs (veko doc)
- Live API Lookup: Run
veko doc <module> [symbol]in your terminal (e.g.veko doc datetime parse-rfc3339orveko doc ui open-window) to inspect signatures, capabilities, and examples directly from source//comments. - Self-Contained Light-Mode HTML API Docs: Render any module or workspace into a zero-CDN, single-file HTML reference (
veko doc --html -o api_docs.html lib/ui.vk) or multi-page directory (veko doc --html --out-dir=dist/api lib/) complete with live symbol search, Wasm 3.0 executable doctest cells, and interactive<canvas>RGBA32 framebuffer previews:
- Machine-Readable Exports: Emit
api.json(veko doc --json <mod> -o api.json) or Markdown (veko doc --md <mod> -o api.md). - Multi-Track Doctests: Verify every fenced
vkexample across VM, Wasm 3.0 (--check-slabs), and Native x86_64 / ARM64 viaveko doc --test [--vm|--wasm|--native|--all] <mod>...`.
4.2 Building & Using the Interactive Web Documentation Playground
Every Veko documentation site generated by veko docs includes a built-in, zero-CDN Interactive Code Playground embedded directly on every Veko code block:
- Generate the HTML documentation suite:
veko docs
This renders standalone End-User HTML pages into dist/docs/user/index.html (and Technical docs into dist/docs/technical/index.html).
- Open in any browser (works offline via
file://or over HTTP):
# Windows
Start-Process dist\docs\user\index.html
# Linux / macOS
xdg-open dist/docs/user/index.html
- Use the Code Cell Toolbar: Above every Veko snippet you will see a
VEKOheader bar with two buttons:Copy— Copies the snippet directly to your clipboard.Playground— Opens an editable code cell right below the snippet with three controls:Inspect Tokens— Runs the built-in browser Veko tokenizer live on your edits and prints every token with its exact[spaced]vs[tight]whitespace tag (enum_lit,path,str_lit,word,delim). This is ideal for learning and debugging Veko's whitespace rules interactively.Run (Wasm / CLI)— If a browser Wasm runner hook (window.VEKO_WASM_RUNNER) is attached on the host page, executes your edited code live in-browser and prints stdout; otherwise displays the exact offlineveko check/veko run --wasm/veko fmt --diffcommands to run locally.Reset— Restores the cell back to the original documentation example.
- Optional Custom Wasm / Local Runner Hook: When hosting
dist/docs/user/behind a web app or Wasm bridge, define a single function beforeinteractive.jsruns:
window.VEKO_WASM_RUNNER = function(sourceCode) {
return myVekoRuntime.eval(sourceCode);
};
All Run (Wasm / CLI) buttons across every documentation page automatically invoke window.VEKO_WASM_RUNNER(sourceCode) and display its output inline.
5. Call-Frame Profiling, Light-Mode SVG Flamegraphs & veko.lock
5.1 Deterministic Call-Frame Profiler (--profile & --flamegraph)
veko run and veko bench include a zero-overhead-when-disabled call-frame profiler (lib/profile/flamegraph.vk) that records exact call counts, self nanoseconds, and inclusive call stacks across qualified Veko functions:
# Print top hot functions by self/inclusive time and emit an interactive Light-Mode SVG flamegraph
veko run --flamegraph=dist/profile.svg src/main.vk
veko bench --flamegraph=dist/bench_flame.svg tests/
5.2 Interactive Source Debugger & VS Code F5 DAP (veko debug)
veko debug provides both an interactive terminal source debugger ((veko-dbg)) and a zero-dependency Debug Adapter Protocol server (veko debug --dap) wired directly into VS Code's F5 debugger (editors/vscode/):
# Interactive CLI debugger (pause on entry or at explicit -b breakpoints)
veko debug examples/38_zero_ffi_sqlite_and_orm.vk
veko debug -b 18 --script="bt;locals;n;c" examples/38_zero_ffi_sqlite_and_orm.vk
- Interactive Commands:
s/step(step into),n/next(step over),f/finish(step out),c/continue,b [file:]line,d <id>,bt(stack trace),locals,globals,p <expr>(evaluate local, dotted field, or expression), andl(source window). - End-to-End
.secretRedaction: Every.secretbinding, struct field, or map entry automatically renders as<secret>across CLIlocals/print, VS Code Variables panes, and hover tooltips—preventing accidental credential exposure during debugging sessions.
5.3 Compiler-Verified Line Coverage & Structure-Aware Fuzzing (veko test --coverage & testing/fuzz)
veko test --coverage records exact VKO source-line hits per module, prints a terminal coverage summary, writes optional LCOV (--lcov=dist/lcov.info) for CI gutters, and renders a self-contained Light-Mode HTML Coverage Report:
veko test --coverage=dist/coverage.html --lcov=dist/coverage.info examples/39_debugger_coverage_and_fuzzing.vk
Pair line coverage with lib/testing/fuzz.vk (fuzz-bytes, fuzz-str, fuzz-block) to run deterministic SplitMix64 property campaigns across --vm, --wasm, and --native with automatic delta-debugging counterexample shrinking down to minimal failing byte slices, UTF-8 strings, or nested homoiconic [ ... ] blocks.
5.4 Single-Binary Portable SDK, veko-lang.org Registry & ~/.veko_modules (veko pkg)
All 95 standard library modules are embedded inside the single veko binary (stdlib_vfs.vk across all 5 native SDK targets: win-x64, win-arm64 PE32+ 0xAA64, linux-x64, linux-arm64, and macos-arm64, distributed for Windows as veko-1.0.0-win-x64.zip and veko-1.0.0-win-arm64.zip), while environment variables and ~/.veko_modules keep host configuration clean and predictable:
| Path / Variable | Purpose |
|---|---|
Embedded VFS (stdlib_vfs.bin) |
Built-in compressed stdlib inside veko so veko run, veko compile, and veko doc work anywhere with zero external directories |
VEKO_HOME |
Optional SDK root override ($VEKO_HOME/lib overrides stdlib modules; $VEKO_HOME/bin locates vvm) |
~/.veko_modules (VEKO_MODULES) |
User-level cache (cache/<sha256>.vkp) and installed package store (pkgs/<name>@<ver>.vkp) shared across workspaces |
VEKO_LIB |
Native shared library search path (; on Windows, : on Linux/macOS) consulted by lib/ffi.vk (ffi/open-lib) |
https://veko-lang.org/pkg (VEKO_REGISTRY) |
Official HTTPS .vkp registry for bare name@ver specs alongside decentralized https://... .vkp URLs |
# Add an official package from https://veko-lang.org/pkg/<name>/<ver>.vkp or any decentralized HTTPS URL
veko pkg add http_router@1.2.0
veko pkg add https://example.org/veko/custom_codec-0.4.0.vkp
# List cached ~/.veko_modules packages, write veko.lock, or verify in CI
veko pkg list
veko pkg lock
veko pkg fetch
veko pkg verify-lock
6. Assisted Migration Translators (veko go2vk, py2vk, rs2vk, v2vk & migrate)
Veko includes built-in assisted translators for Go, Python, Rust, and V that rewrite core syntax into canonically formatted Veko starter files AND automatically map standard libraries and popular ecosystem packages directly onto Veko's 93-module pure-.vk standard library (use [...]):
# Direct language shorthands
veko go2vk path/to/service.go -o src/service.vk
veko py2vk path/to/script.py -o src/script.vk
veko rs2vk path/to/module.rs -o src/module.vk
veko v2vk path/to/legacy_mod -o src/migrated.vk
# Unified command (auto-detects by extension or explicit --from=go|py|rust|v)
veko migrate --from=go path/to/service.go -o src/service.vk
Automatic Standard Library & Dependency Mapping
| Domain | Go (go2vk) |
Python (py2vk) |
Rust (rs2vk) |
Veko use [...] Target |
|---|---|---|---|---|
| HTTP Client & Web | net/http |
requests, httpx, flask, fastapi |
reqwest, axum, actix_web, warp |
hc = net/client, web |
| HTML & Templates | html/template, text/template |
html, jinja2 |
maud, askama |
html, tpl = template |
| Date & Time | time |
datetime, time |
chrono, std::time |
dt = datetime |
| Filesystem & Paths | os, io/fs, path/filepath |
os, pathlib, shutil |
std::fs, std::path |
fs, path |
| JSON / TOML / CSV | encoding/json, BurntSushi/toml, encoding/csv |
json, tomllib, csv |
serde_json, toml, csv |
builtin json, toml = codec/toml, csv = codec/csv |
| Crypto & TLS 1.3 | crypto/sha256, crypto/aes, crypto/ed25519, crypto/tls |
hashlib, hmac |
sha2, sha3, blake2, aes_gcm, ed25519, rustls |
crypto/{sha256,sha3,blake,aes,x25519}, tls13 = net/tls13 |
| Auth (JWT & TOTP) | golang-jwt/jwt, pquerna/otp |
pyjwt, pyotp |
jsonwebtoken |
jwt = auth/jwt, totp = auth/totp |
| Databases | jackc/pgx, lib/pq, go-redis |
psycopg, redis |
postgres, tokio_postgres, redis |
pg = db/postgres, redis = db/redis |
| Archives & Deflate | archive/tar, archive/zip, compress/gzip |
tarfile, zipfile, gzip, zlib |
tar, zip, flate2 |
tar = archive/tar, zip = archive/zip, deflate = compress/deflate |
| Net, Regex, Logs, CLI | net/netip, gorilla/websocket, regexp, log/slog, google/uuid, semver |
ipaddress, websockets, re, logging, uuid, difflib, tenacity |
std::net, tungstenite, regex, tracing, uuid, clap, semver |
ip = net/ip, ws = net/websocket, regex, slog, rnd = rand, diff, retry, cli, sv = semver |
- Honest Boundary Markers: Foreign or incompatible constructs (
C./ cgo,unsafe,sync.Mutex,Arc<Mutex>,async fn,try/except,shared,veb,sqlite) are always preserved with explicit// TODO(go2vk|py2vk|rs2vk|v2vk): ...comments so nothing is silently mis-translated. - Auto-Formatted Output: Every translator passes its generated
.vkcode throughveko fmt.
7. LLMs & Coding Agents (AGENTS.md, veko init --agents & llms.txt)
Because Veko has a compact prefix grammar, deterministic One Reference Only (ORO) ownership (zero <'a> lifetime loops), <10ms veko check feedback, and offline veko doc <module> introspection across all 95 embedded stdlib modules, LLMs write idiomatic .vk code immediately when AGENTS.md is present in the workspace root.
# Every new workspace created with `veko init` automatically includes AGENTS.md:
veko init my-service
# Add AGENTS.md, CLAUDE.md, .claude/settings.json, .cursor/rules/veko.mdc,
# and .github/copilot-instructions.md to any new or existing project:
veko init --agents .
# Or download the latest standalone AGENTS.md directly from veko-lang.org:
curl -fsSL https://veko-lang.org/AGENTS.md -o AGENTS.md
- Built-In Agent Introspection Loop:
AGENTS.mdteaches coding agents to callveko doc <module>,veko pkg search,veko inspect --tokens,veko init --sync,veko check --strict-types,veko fmt -w, andveko testinstead of guessing signatures. - Web &
@DocsIndexing (llmstxt.org): Indexhttps://veko-lang.org/llms.txtorhttps://veko-lang.org/llms-full.txtin Cursor@Docs, Claude Projects, ChatGPT, or Windsurf for full 95-module stdlib and 30-package context.
8. Environment Diagnostics, CI Scaffolding & Authoring .vkp Packages
veko doctor & veko init --ci
Verify your local SDK, embedded 95-module VKFS archive, ~/.veko_modules cache, veko.vk manifest, AGENTS.md, and registry connectivity in one command, or generate ready-to-push GitHub Actions CI + static container files:
# Inspect local SDK, workspace, AGENTS.md, and HTTPS package registry health
veko doctor
# Generate .github/workflows/veko.yml + multi-stage static ELF64 Dockerfile
veko init --ci .
Publishing & Hosting Signed .vkp Packages in 3 Commands
Any developer or team can author, Ed25519-sign, and host a decentralized static HTTPS .vkp package registry on S3, Cloudflare R2, GitHub Pages, or Nginx with zero server code:
# 1. Scaffold a publish-ready package workspace (src/mod.vk, examples/demo.vk, tests/, README.md, AGENTS.md)
veko init --pkg my_library
# 2. Generate an Ed25519 publisher keypair (prints your public `ed25519:<hex>` trust-key)
veko pkg keygen -o publisher.ed25519.key
# 3. Pack the signed VKP1 bundle & generate static registry catalog.json + trust-keys.json
veko pkg pack my_library/src -o dist/registry/my_library/0.1.0.vkp --key-file=publisher.ed25519.key --name=my_library --version=0.1.0
veko pkg index dist/registry --registry=https://pkgs.example.org
9. Runnable Tooling & Tail-Latency Proof Demos
Run examples/27_tooling_fmt_lsp_and_v2vk.vk and examples/41_oro_latency_and_memory_proof.vk to verify tooling round-trips and p50–p99.9 ORO tail-latency determinism:
veko run examples/27_tooling_fmt_lsp_and_v2vk.vk
veko run -C all examples/41_oro_latency_and_memory_proof.vk
veko bench benchmarks/ --save=dist/bench_baseline.json