GizStack
View .mdOpen in ChatGPTOpen in Claude

GizStack Platform Architecture

Gizlang provides a vertically integrated native software stack where language semantics, data models, storage engines, network protocols, user interfaces, and AI execution share a single source of truth. Rather than stitching together external ORMs, serialization schemas, message brokers, and web frameworks, one typed declaration drives the entire lifecycle from disk layout to live browser updates and agent tool invocations.

Architectural Principles

  1. Single Source of Truth (Shape, Policy, Operation): A record definition in gizmodel simultaneously defines SQL table schemas, binary wire codecs, form validators, access control policies, and strongly typed agent tool signatures.
  2. One Owner, One Copy: Every cross-cutting concept has exactly one canonical implementation module enforced by bin/gizlang structure against structure/concepts. Higher layers extend or compose the owner module rather than introducing parallel abstractions.
  3. Zero-Copy Native Execution: Programs compile via LLVM to native machine code (x86-64 with runtime dispatch for v2/v3/v4 SIMD levels, aarch64, riscv64, and freestanding bare-metal targets) linked against a deterministic C/Gizlang runtime.
  4. End-to-End Reactivity: Committed transactions in GizDB and revision updates in GizFS publish directly to the change feed, streaming incremental DOM patches over GizWeb live views without polling.

End-to-End Stack Dataflow

LayerCanonical PackageResponsibilityPrimary Internal Reference
Language & Compilercompiler, compiler-driverLexing, parsing, ownership/effect checking, LLVM IR emission, and sub-100ms live incremental rebuildsCompiler internals
Runtime & OSruntime, sdkGenerational precise heap, task scheduler, io_uring/libuv I/O, freestanding C library, and per-process isolation and confinementRuntime, Memory, System
Hardware & Computehw, aiCPU/cache topology, CUDA/Vulkan/Metal GPU kernels, tensor autograd, LLM/diffusion inference, and classical MLCompute internals, Hardware guide
Storage EnginefsRaft-replicated storage ranges, Reed-Solomon erasure coding, content-addressed blobs, S3 gateway, and FUSE/ublk mountsStorage internals
Data & Query Enginemodel, db, db-mlTyped relational/document/KV/vector engine, PostgreSQL wire protocol, HNSW vector search, and in-database ML (pgml)Database internals, SQL ML
Web, Browser & UIweb, browser, apps.ghtml server-rendered & live views, design system tokens, zero-syscall HTML/CSS layout engine, and Wayland desktop shellWeb internals, GHTML reference
Polyglot VM & Workspacevm, vm-lua, deskJS/TS/Python/Wasm/Lua virtual machines, CPython/N-API coroutine bridges, and the GizDesk agent workspaceVM internals, GizDesk guide

Shared Platform Concepts

The table below is generated and verified by bin/gizlang structure --doc from structure/concepts. Defining any reserved type or calling any reserved constructor outside its owner file fails the structural check.

<!-- structure:concepts -->

ConceptOwner fileWhat it isNames reserved to it
Policymodel/policy.gizGrants and the row and field rules that the data layer enforces (the one list of who may do what)Policy
Operationmodel/model.gizEvery change as a typed input and result with risk, idempotency, approval, audit and meterOperation
Shapemodel/model.gizThe one type source that a table, a form and a view all followShape
Change feeddb/core/journal.giz, db/kv/local.gizThe committed change feed for live queries, notifications, search and automations: the SQL journal's rows, and the KV engine's keys by revision (two engines share no storage)Change, ChangeFeed, Feed
HTTP serverweb/app.giz, sdk/net/http.giz, sdk/net/tls.gizThe one HTTP server loop: GizWeb serves, on the standard library server. A hosted app does not write a second loopHttpServer
TLSsdk/net/tls.gizTLS for clients and servers, and its certificate chain and keysTls, TlsStream, TlsServer
QUICsdk/net/quic.gizThe QUIC transport (RFC 9000) under HTTP/3: endpoints, connections, streams and packet protectioninitialSecrets
Loss recoverysdk/net/recovery.gizRTT estimation, loss detection timers and NewReno congestion control, for QUIC now and the GizOS TCP laternewPath, probeTimeout, lossDelay
Build slotstools/cli/slots.gizThe machine's build admission: the slots file reader, the slot kinds and the local slots that a build holdsslotWords, slotKind, localSlots, holdSlot
Store evictiontools/cli/files.gizThe one eviction policy of the machine store ($GIZLANG_CACHE): seven days unused, at most once a daypruneArtifacts, pruneEntries
Unit keytools/cli/build.gizThe key of a compiled program or unit in the store: its sources, the toolchain and the link recipeunitKey
Shared-cache signaturetools/cli/buildstore.gizThe signature of a store entry that another machine may use (GIZLANG_SHARED_CACHE, GIZLANG_TRUSTED_KEYS)sharedMessage, signBuilt, verifyShared
Program linktools/cli/build.gizLinking IR and objects into an executable for one target and profilelinkParts, optimizedLink
SQL identifiersdk/core/text.gizOne SQL delimited identifier: the name quoted, with its embedded quotes doubledquoteIdentifier
Hexsdk/core/text.gizLowercase hexadecimal of bytes, and its strict decoderhexEncode, hexDecode
Aggregate namesmodel/sql/aggnames.gizWhich SQL function names are aggregates: the parser, the binder and the catalog checks read them hereisAggregate, isAggregateCall
Integer parsingsdk/core/text.gizStrict decimal and radix integer parsing: each text is ok, invalid or overflow, never a guessparseI64, parseRadix
Date and time formatsdk/core/time.gizA time as text in a format string, and the reverse: formatTime and parseTime of the one time moduleformatTime, parseTime
HTTP datesdk/net/http.gizThe HTTP date of RFC 9110 (IMF-fixdate, RFC 850 and asctime): one writer and one parserhttpDate, parseHttpDate
Expression SQLmodel/sql/render.gizA syntax tree printed as SQL text of a dialect, with the values bound as parametersmutation, bound, boundMutation, expressionText, boundCondition
HTML textsdk/format/html.gizThe Html value, and the escaping of text and attribute values that every HTML writer sharesHtml, escape, unescape
HTML parserbrowser/html.gizHTML bytes to a Document in one pass, and the serializer back to HTMLdocumentSource, documentEncoding, serialize
CSS sheetbrowser/css.gizCSS text to a Sheet: rules with their selectors, declarations and media conditionsDeclaration, Rule, declarations
CSS tokensbrowser/syntax.gizCSS Syntax 3 tokens: the one tokenizer, and the token walks that the later stages shareToken, tokenize
CSS selectorbrowser/selector.gizSelectors (Selectors Level 4) compiled once to flat parts, and matched against the documentSelector, parseList, matches, query, matchesText
DOMbrowser/dom.gizThe document as flat columns of nodes and atoms, with the input edits and text steps of a pageEdit, Step

<!-- /structure:concepts -->