How open2b/scriggo works
Main Components
• Compiler Module (internal/compiler/*)
• Runtime Module (internal/runtime/*)
• AST Module (ast/*)
• Native Interface (native/*)
• Built-in Functions (builtin/*)
b. Supporting Components:
• Template Engine
• Program Interpreter
• File System Interface
Architecture Layers (top to bottom)
Layer 1 - Public API:
• Template API
• Program API
• Native Interface API
Layer 2 - Processing:
• Compiler
• Parser
• Type Checker
• Code Generator
• Runtime Environment
• VM
• Memory Management
• Error Handling
Layer 3 - Core Infrastructure:
• AST Implementation
• Built-in Functions
• File System Abstraction
a. Data Flow:
• Source Code → Parser → AST → Type Checker → Code Generator → Runtime
• Templates → Template Engine → Compiler → Runtime
• Native Code ↔ Runtime Environment
b. Dependencies:
• Template Engine → File System
• Compiler → AST
• Runtime → Built-in Functions
Special Elements
a. Security Boundaries:
• Isolation between user code and native code
• Package access controls
b. Extension Points:
• Native package integration
• Custom built-in functions
• File system implementation
Implementation Details
• Rectangles: Major components
• Rounded rectangles: Interfaces
• Hexagons: Security boundaries
• Diamonds: Decision points
• Blue: Core components
• Green: Public APIs
• Yellow: Security features
• Gray: Infrastructure
• Red: Critical paths
Additional Notes
Callouts for:
• Template inheritance system
• Markdown support
• Security features
• Performance optimization points
Runtime execution flow
Remember to include important interfaces like:
• scriggo.Build()
• scriggo.BuildTemplate()
• native.Declarations
• builtin package interfaces
This will create a comprehensive visualization of Scriggo's architecture while maintaining clarity and usefulness for technical discussions.