2.2 KiB
2.2 KiB
EquiCompiler: Algebraic Portfolio DSL to Verifiable Low-Latency Compiler (MVP)
Overview
- This repository contains a minimal, production-ready MVP for a compiler stack that translates a domain-specific language for market strategies into a portable, verifiable execution graph. The MVP focuses on a small, well-formed core to enable safe extension by additional agents in the swarm.
What you get in this MVP
- A small DSL parser that reads a concise DSL and converts it into a canonical in-memory IR (EquiIR) represented as Python dicts.
- A minimal Python package equicompiler_algebraic_portfolio_dsl_to_ with a core module and a CLI entry point.
- A tiny test suite to validate DSL parsing and IR generation.
- A test runner (test.sh) that executes tests and builds the package to verify packaging metadata.
Usage
-
DSL to IR (programmatic): from equicompiler_algebraic_portfolio_dsl_to_.core import parse_dsl_to_ir dsl = "assets: AAPL, MSFT, GOOG\nobjectives: maximize_return\nconstraints: max_drawdown=0.2, var=0.95" ir = parse_dsl_to_ir(dsl) print(ir)
-
CLI (Python module): python -m equicompiler_algebraic_portfolio_dsl_to_.cli path/to/dsl_file.txt
Project structure
- AGENTS.md: architecture and testing guidelines for future agents
- README.md: this file
- pyproject.toml: packaging metadata
- equicompiler_algebraic_portfolio_dsl_to_/ (package)
- init.py
- core.py: DSL -> IR parser (minimal)
- cli.py: CLI entry point
- tests/test_core.py: small unit test for DSL parsing
- test.sh: test runner to validate test suite and packaging
Development notes
- The MVP intentionally keeps dependencies minimal to ensure fast iterations and deterministic tests.
- When adding features, try to keep changes small and focused on a single goal.
- Ensure tests cover the new functionality and avoid sensitive data in tests.
Next steps
- Implement a more expressive DSL and a richer IR (EquiIR) representation.
- Add more tests for edge cases and simple integration tests for the CLI.
- Expand packaging metadata and README with a longer developer and user guide.
This README intentionally stays light; the AGENTS.md contains the deeper architectural notes for the SWARM collaborators.