How santhosharulsamy/sandy works
Sandy is a Python-implemented scripting language. The main workflow is a user running a .sy program through the CLI: runtime processing lexes and parses source, optionally type-checks it, then executes it with the tree-walking interpreter or bytecode VM; typed programs can also be built with the C backend. Separate capabilities include modules and packages, built-ins and standard library, concurrency, formatting, and editor support. The README and source index establish the major engine and tooling relationships; unsampled subsystem connections are omitted where their callers are not shown.
Main entry points: runtime.py Runtime Orchestrator · lsp.py Language Server · cli.py CLI · interpreter.py Tree Interpreter
Components 24
Language Front End
- Lexer
sandy/lexer.py - Tokens
sandy/tokens.py - Parser
sandy/parser.py - AST Nodes
sandy/nodes.py - Type Checker
sandy/typecheck.py
Execution Engines
- Tree Interpreter
sandy/interpreter.py - Bytecode Compiler
sandy/compiler.py - Bytecode
sandy/bytecode.py - Bytecode VM
sandy/vm.py - C Backend
sandy/cbackend.py - Runtime Values
sandy/values.py
Language Ecosystem
- Built-ins
sandy/builtins.py - Concurrency
sandy/concurrency.py - Standard Library
sandy/stdlib - Package System
sandy/packages.py - Registry Server
sandy/registry_server.py
Developer Tools
- Formatter
sandy/formatter.py - Language Server
sandy/lsp.py - Interactive REPL
sandy/repl.py - Browser Playground
web/playground.html
Program Entry
- CLI
sandy/cli.py - Runtime Orchestrator
sandy/runtime.py
Other components
- Program Author
- C Compiler
Connections 29
- Program Author → CLI: runs program
README.md - CLI → Runtime Orchestrator: dispatches execution
sandy/cli.py - Runtime Orchestrator → Lexer: tokenizes source
sandy/runtime.py - Lexer → Tokens: emits tokens
sandy/lexer.py - Runtime Orchestrator → Parser: parses tokens
sandy/runtime.py - Parser → AST Nodes: builds AST
sandy/parser.py - Runtime Orchestrator → Type Checker: checks types
sandy/runtime.py - Runtime Orchestrator → Tree Interpreter: runs AST
sandy/runtime.py - Runtime Orchestrator → Bytecode Compiler: compiles program
sandy/runtime.py - Bytecode Compiler → Bytecode: emits instructions
sandy/compiler.py - Runtime Orchestrator → Bytecode VM: executes bytecode
sandy/runtime.py - Runtime Orchestrator → C Backend: generates native code
sandy/runtime.py - C Backend → C Compiler: invokes compiler
- Tree Interpreter → Runtime Values: uses values
sandy/interpreter.py - Tree Interpreter → Built-ins: dispatches built-ins
sandy/interpreter.py - Built-ins → Concurrency: provides concurrency
sandy/builtins.py - Bytecode VM → Tree Interpreter: reuses runtime behavior
sandy/vm.py - Bytecode VM → Runtime Values: uses values
sandy/vm.py - Tree Interpreter → Package System: loads modules
sandy/interpreter.py - Package System → Registry Server: serves packages
sandy/packages.py - CLI → Interactive REPL: starts REPL
sandy/cli.py - CLI → Formatter: formats source
sandy/cli.py - CLI → Language Server: starts language server
sandy/cli.py - Language Server → Lexer: uses lexer
sandy/lsp.py - Language Server → Parser: uses parser
sandy/lsp.py - Language Server → Type Checker: checks diagnostics
sandy/lsp.py - Language Server → Formatter: formats documents
sandy/lsp.py - Program Author → Browser Playground: tries language
README.md - Browser Playground → Runtime Orchestrator: runs implementation
README.md