How sathvikadevineni/rayven works
RayVen is a DSL and optical-simulation environment. A user writes an .rv program; the OCaml compiler tokenizes and parses it, checks semantics, and generates Python, which the Python/Pygame engine runs to simulate and render optics and optionally record video. The README documents the compiler stages and end-to-end flow; the sampled engine excerpt confirms its optical objects, ray interactions, simulation runtime, and recording. Compiler internals were not sampled, so their connections rely on README documentation.
Main entry points: RayVen_engine.py Simulation engine · parser.ml Parser · main.ml Compiler entry · tokenizer.ml Tokenizer
Components 17
DSL compiler
- Compiler entry
bin/main.ml - Tokenizer
lib/tokenizer.ml - Parser
lib/parser.ml - AST
lib/ast.ml - Static checks
lib/static_checks.ml - Python codegen
lib/codegen.ml
Optics simulation
- Optical objects
RayVen_engine.py - Ray tracing
RayVen_engine.py - Optics physics
RayVen_engine.py
Interactive output
- Generated Python
- Simulation engine
RayVen_engine.py - Simulation world
RayVen_engine.py - Pygame display
RayVen_engine.py - Video recording
RayVen_engine.py
Other components
- DSL author
- Simulation viewer
- MP4 video
Connections 15
- DSL author → Compiler entry: submits program
README.md - Compiler entry → Tokenizer: starts compilation
README.md - Tokenizer → Parser: produces tokens
README.md - Parser → AST: builds AST
README.md - Parser → Static checks: checks semantics
README.md - Static checks → Python codegen: feeds checked program
README.md - Python codegen → Generated Python: generates Python
README.md - Generated Python → Simulation engine: runs simulation
README.md - Simulation engine → Optical objects: creates optics
RayVen_engine.py - Simulation engine → Simulation world: manages world
RayVen_engine.py - Ray tracing → Optics physics: uses refraction
RayVen_engine.py - Simulation viewer → Pygame display: views simulation
README.md - Simulation engine → Pygame display: renders display
RayVen_engine.py - Simulation engine → Video recording: records frames
RayVen_engine.py - Video recording → MP4 video: writes video
README.md