On behalf of all its developers, I am glad to announce the release of Mopsa 1.0! You can just opam install mopsa.
Mopsa stands for Modular and Open Platform for Static Analysis. It aims at easing the development and use of static analyzers. More specifically, Mopsa is a generic framework for building sound static analyzer based on the theory of abstract interpretation. Mopsa is independent of language and abstraction choices. Developers are free to add arbitrary abstractions (numeric, pointer, memory, etc.) and syntax iterators for new languages. Mopsa encourages the development of independent abstractions which can cooperate or be combined to improve precision.
Mopsa currently support the analysis of Python, C and Python+C programs. It reports run-time errors on C programs and uncaught exceptions on Python programs. Our benchmarks provide an illustrative overview of what Mopsa can currently analyze. All analyses currently provided are flow and context-sensitive (i.e, control-flow operators are taken into account by the analysis, and functions are analyzed by virtual inlining). The C analysis is actively developed and maintained. The Python and Python+C analyses work on real-world examples, but are not actively developed.
Please note that Mopsa is an academic tool under development. Feel free to submit issues if you encounter any bug!
As a professional python developer I am pretty interested in your static analysis features in that space. What is the main differentiating factor compared to say, ruff, mypy, etc.?
It sounds more extensible and thus offers richer analysis in the long run?
Thank you for your interest! One of the goals of Mopsa is to explore the design of new analyses. As such, we target analyses that are sound, and more precise than mypy’s. We aim to design sound analyses, meaning we take into account all behaviors of a program – which in the case of Python’s semantics can quickly be expensive. Regarding precision, we have analyses able to infer Python types, or track the length of lists for example. This however comes at the cost of less scalability, and the ability to analyze functions only when a given calling context is provided (i.e, analyzing Python libraries in isolation is currently not possible).
Mopsa is a research project, and I don’t think the Python analyses are stable enough to analyze arbitrary code and be used in production yet.