Try-Mopsa: Relational Static Analysis in Your Pocket
Raphaël Monat
TL;DR
Static analyzers are powerful but rely on large dependencies, hindering adoption. Try-Mopsa provides a zero-install, client-side browser implementation by compiling Mopsa to JavaScript with Js_of_ocaml and replacing server-side or C-based components with browser-friendly alternatives, including Menhir parsers, a JavaScript Zarith, and the Verified Polyhedra Library for relational domains. It preserves Mopsa’s core capabilities—multi-language analysis, relational domains, and an interactive abstract debugger—while offering a responsive UI, a web-worker computation model, and a progressive web app option suitable for teaching and demonstrations. The work evaluates interface design and browser compatibility, notes a practical performance trade-off (roughly 5x slower than native Mopsa but under 1s for toy cases), and discusses maintainability and future optimizations such as WebAssembly. Overall, Try-Mopsa enables zero-install experimentation with relational static analysis in a broadly accessible, educational setting, lowering entry barriers for learners and instructors alike.
Abstract
Static analyzers are complex pieces of software with large dependencies. They can be difficult to install, which hinders adoption and creates barriers for students learning static analysis. This work introduces Try-Mopsa: a scaled-down version of the Mopsa static analysis platform, compiled into JavaScript to run purely as a client-side application in web browsers. Try-Mopsa provides a responsive interface that works on both desktop and mobile devices. Try-Mopsa features all the core components of Mopsa. In particular, it supports relational numerical domains. We present the interface, changes and adaptations required to have a pure JavaScript version of Mopsa. We envision Try-Mopsa as a convenient platform for onboarding or teaching purposes.
