-
-
Notifications
You must be signed in to change notification settings - Fork 35
Description
This issue tracks the ongoing development of the new mago analyzer, introduced in PR #230
The initial version has been merged in an experimental state to unblock further development and allow for incremental releases. This issue outlines the roadmap toward a stable, production-ready analyzer.
-
Core Tasks for Stabilization:
- Remove Panics: Systematically replace all instances of unwrap() and unreachable!() with proper error reporting.
- Centralize Error Reporting: Refactor error reporting logic so that each unique error is handled by a single, dedicated function for consistency.
-
Performance Optimizations 🚀:
- Reduce clone() operations: Profile and minimize clone() calls within mago-codex and mago-analyzer to improve memory usage and speed.
- General Performance Tuning: A dedicated round of optimizations will be undertaken before a stable release.
-
Feature Implementation:
-
Implement unsafe/safe/limbo System (Must-have):
@unsafe
: For functions/types that can only be used in other@unsafe
contexts.@safe
: Guarantees a function/type can only use other@safe
symbols.
-
Implement Effect System (Nice-to-have)
- Introduce
@effects X, Y, Z
to supersede@pure
,@mutation-free
, etc. @throws Exception
will become@effect Throws<Exception>
.@no-effects
will signify a pure function.
- Introduce
-
-
Future Ideas 💡:
- Typed Linter Integration: Explore passing type information to a linter to enable typed linting rules, similar to typescript-eslint.
-
Quality Assurance & Verification:
-
Cross-Project Bug Verification: Review the last 100 bug reports for
vimeo/psalm
andphpstan/phpstan
to ensure mago avoids similar pitfalls. -
CI: Real-World Project Testing: Add the following projects to the CI pipeline to test the analyzer against real-world codebases.
- azjezz/psl
- veewee/xml
- Roave/BetterReflection
- veewee/reflecta
- psalm/endtoend-test-collections
- psalm/endtoend-test-phpunit
-