Architecture
Monorepo Strategy
Haskell is the core implementation language. Editor integrations stay thin and are written only in the languages required by each host editor.
Haskell packages
tynix-core- AST
- parser
- type checker
- declaration emitter
.tynix -> .nixcompiler
tynix-clicompilecheckemit
tynix-lsp- diagnostics
- hover
- signature help
- document formatting (re-render; no-op when comments are present)
- go to definition
- declaration lookup
Internally split into focused modules.
Session.hsis now a thin request-dispatcher layer; the heavy lifting lives in:AnalysisCache— content-keyed memoization of driver runsSessionTypes— shared records (Documents, IndexedSymbol, etc.)SessionDocuments— didOpen/didChange/didClose + workspace loaderSessionWorkspace— workspace traversal and marker discoverySessionSymbols— document / workspace symbol indexSessionReferences— definition / references / rename resolutionSessionText— pure span / boundary helpersSessionDiagnostics— diagnostic inspection and quick-fix buildersSessionSemanticTokens— semantic-tokens providerSessionFolding— folding-range providerSessionLinks— document-link providerSessionInlayHints— inlay-hint provider for inferredlettypes
Editor packages
editors/vscode- TypeScript
- managed by
pnpm - built and checked with
vp
editors/zed- a thin Rust launcher
editors/neovim- a thin Lua setup helper
Development Environment
- environment provisioning with
nix - TypeScript package management with
pnpm - task runner with Vite+ via
vp
nix develop is expected to provide:
ghccabalhaskell-language-servernodepnpmvprustccargo
Compiler Pipeline
- parse
- parse
.tynixand.d.tynixinto ASTs
- parse
- collect declarations
- type aliases
- ambient declarations
- workspace declaration sidecars
- type check
- inference
- subtype and consistency checks
- diagnostics
- emit
- generate
.nix - generate
.d.tynix
- generate
LSP Responsibilities
- parse and type-check the current
.tynixbuffer - index workspace
.d.tynixfiles - resolve declarations for
importtargets - publish diagnostics
- return inferred types and declaration origins in hover
Editor Integration Strategy
VS Code
- TextDocumentSync
- diagnostics push
- hover
- signature help
- document formatting
- semantic tokens in a later phase
Zed
- a minimal extension whose main job is starting
tynix-lsp - treat
.tynixas a Nix-like language
neovim
- a thin helper around
vim.lsp.start - no custom UI layer
Test Strategy
The most important tests live in tynix-core.
- parser golden tests
- subtype and consistency tests
- inference tests
- conditional and
infertests - declaration emitter tests
- compile erasure tests
- regression fixtures
The LSP and editor integrations stay thin and mainly verify startup, protocol wiring, and small regression cases.
Quality Strategy
- prefer explainable errors
- keep generated
.nixreadable - stabilize
.d.tynixas an API contract format - keep implementation files below 250 lines with clearly separated responsibilities