How nevalang/neva works
Neva is a statically typed compiled dataflow language. A user invokes the CLI to build or run a Neva project: the builder loads module sources, the compiler parses and analyzes them, lowers the network representation, then emits Go, native/Wasm, or visual IR output. The runtime supplies concurrent message passing and language functions; indexing and formatting are additional user-facing capabilities. The graph follows documented and indexed connections; several backend, runtime, and CLI details are unsampled, so their internal links are omitted.
Main entry points: build.go Build command · compiler.go Compiler frontend · parser.go Source parser · builder.go Module builder
Components 24
CLI and modules
- Neva CLI
internal/cli/cli.go - Build command
internal/cli/build.go - Module builder
internal/builder/builder.go
Compiler pipeline
- Source parser
internal/compiler/parser/parser.go - Flow AST
pkg/ast/flowast.go - Static analyzer
internal/compiler/analyzer/nodes.go - Type resolver
internal/compiler/typesystem/resolver.go - Network lowering
internal/compiler/desugarer/network.go - IR generation
internal/compiler/irgen/network.go - Compiler IR
internal/compiler/ir/ir.go - Compiler frontend
internal/compiler/compiler.go
Targets and tools
- Go backend
internal/compiler/backend/golang/backend.go - Native backend
internal/compiler/backend/golang/native/backend.go - Wasm backend
internal/compiler/backend/golang/wasm/backend.go - IR exporters
internal/compiler/backend/ir/backend.go
Execution runtime
- Dataflow runtime
internal/runtime/program.go - Message types
internal/runtime/messages/message.go - Runtime functions
internal/runtime/funcs/registry.go
Workspace views
- Workspace indexer
pkg/indexer/indexer.go - Visual projection
pkg/view/projector.go - Source formatter
pkg/formatter/formatter.go
Other components
- Developer
- Go compiler
- Native or Wasm output
Connections 28
- Developer → Neva CLI: invokes
- Neva CLI → Build command: registers
- Build command → Module builder: loads sources
internal/cli/build.go - Module builder → Source parser: supplies source
- Source parser → Flow AST: produces
internal/compiler/parser/parser.go - Build command → Compiler frontend: configures build
internal/cli/build.go - Compiler frontend → Module builder: loads modules
internal/compiler/compiler.go - Compiler frontend → Source parser: parses modules
- Compiler frontend → Network lowering: lowers network
- Compiler frontend → IR generation: generates IR
- Source parser → Static analyzer: readies AST
- Static analyzer → Type resolver: checks types
internal/compiler/analyzer/nodes.go - Network lowering → Type resolver: resolves types
internal/compiler/desugarer/network.go - IR generation → Compiler IR: builds representation
- Build command → Go backend: selects target
internal/cli/build.go - Build command → Native backend: selects target
internal/cli/build.go - Build command → Wasm backend: selects target
internal/cli/build.go - Build command → IR exporters: selects format
internal/cli/build.go - Go backend → Go compiler: emits Go
- Go compiler → Native or Wasm output: compiles
- Native backend → Native or Wasm output: produces target
- Wasm backend → Native or Wasm output: produces target
- Dataflow runtime → Message types: transports messages
internal/runtime/program.go - Runtime functions → Dataflow runtime: provides functions
- Developer → Workspace indexer: indexes workspace
- Workspace indexer → Static analyzer: analyzes build
pkg/indexer/indexer.go - Developer → Visual projection: requests view
- Developer → Source formatter: formats source