ModelingToolkit, Modelica, and Modia: The Composable Modeling Future in Julia
stochasticlifestyle.com
stochasticlifestyle.com
It really feels like a gold rush to me, like the grand visions of the early computer science pioneers (Englebart, Licklider, Kay...) coming to life.
I'm curious what the emergent properties of large Julia codebases will be. The composability of Julia packages helps keep things modular, but there are places it breaks down (ex: Unitful x AbstractArray x Zygote), and those are the places where the expression problem sets back in & toolkits revert to frameworks.
OTOH, multiple dispatch makes it easier to dissolve the entanglement -- refactoring of the package dependency structure. That makes it possible for alternate solutions to get hot-swapped into the system if they prove advantageous. Formal interfaces would streamline this in a big way.
Unitful quantities with heterogeneous units don't have a `zero` function that works correctly, which gets in the way inside numerical routines. [0] There are other places where 0 or 1 is added, which is an error for quantities but not for plain real numbers. [1]
Zygote doesn't handle mutating arrays. [2]
[0]: https://github.com/PainterQubits/Unitful.jl/pull/472 [1]: https://github.com/SciML/NonlinearSolve.jl/issues/36#issueco... [1]: https://github.com/rakeshvar/Zygote-Mutating-Arrays-WorkArou...
[1] https://math.stackexchange.com/questions/1144214/on-the-jaco...
(The generalization of vector law is described in the first few eqs of the mathSE answer)
As of now, Modias DSL feels more familiar and less boilerplate-y to me (as a modelica dev) but I guess that's probably because they just focus on similar capability to Modelica unlike MTK which has a lot of expandability.
With that being said, having a decent component library (like MSL) and a GUI (or preferably some auto diagram) to compose and browse through them would be the minimum needed to be able to beat Modelica in the acausal modeling space.
Possibly with a DSL.