I’m excited to share Morsel, a modern, web-based visual editor for Modelica that I've been working on. It's part of the broader ModelScript compilation, analysis, and visualization framework.
Modelica is a powerful, object-oriented language for equation-based modeling of complex physical systems (mechanical, electrical, electronic, hydraulic, thermal, control, etc.). However, tooling in the Modelica ecosystem has historically been heavy, proprietary, or desktop-bound. I built Morsel to bring a fast, beautiful, and accessible Modelica modeling experience right to the browser.
Key Features ============
- Interactive Diagrams: High-performance visualization of Modelica connections and topologies using AntV X6.
- Synchronized Code Editor: Real-time, two-way synchronization between the visual diagram and the underlying Modelica code (powered by Monaco Editor).
- Intelligent Properties Panel: Easily edit component parameters, modifiers, and annotations through a responsive UI that directly manipulates the AST.
- Library Explorer: Navigate complex Modelica libraries (like the Modelica Standard Library) via an intuitive hierarchical tree view.
Under the Hood: ModelScript ===========================
Morsel is powered by ModelScript, a custom compilation engine written in TypeScript. ModelScript brings its own modern toolchain to Modelica:
- Custom Tree-Sitter Grammar: Fast and precise parsing for editor integrations and tooling.
- Semantic Analysis: Full scope and name resolution for complex Modelica hierarchies.
- Model Flattening: Translating hierarchical component architectures into flat Differential Algebraic Equations (DAEs).
Why I built this ================
I wanted an open-source (AGPL-3.0), modern front-end that could run entirely in the browser (or as a local web app) without sacrificing the power of the Modelica language. It's built on a modern stack (React, React Router, Vite, Tailwind, GitHub Primer) to provide a premium, responsive developer experience.
I am still actively developing Morsel and ModelScript and would love your feedback, bug reports, and contributions!
GitHub Repo: https://github.com/modelscript/modelscript
I'd be happy to answer any questions about the architecture, Modelica parsing, the tree-sitter grammar, or anything else!