Catalyst.jl icon indicating copy to clipboard operation
Catalyst.jl copied to clipboard

use MTK macro processing code instead of writing custom DSL code

Open isaacsas opened this issue 1 year ago • 3 comments

On a quick skim, it appears subsets of our DSL macro processing code overlap with MTK macro processing code. We should switch to MTK's code as much as possible to avoid needing to maintain our own macros (for example @equation), and to ensure feature compatibility with MTK.

edit: Perhaps this isn't possible but it would be good to really make sure we can't reuse their code (similar to how we defined @species using their code as a base).

isaacsas avatar Aug 14 '24 15:08 isaacsas

We do go through some MTK stuff, i.e. use the ModelingToolkit.parse_equations! for the equations. The rest of the equation code is basically just extracting differentials and variables from D(X).

Especially when MTK have settled down though, we should do a pass through everything to ensure that we are non unnecessarily re-implementing anything. Let's keep this open until we get there.

TorkelE avatar Aug 14 '24 15:08 TorkelE

OK, good. I missed that we use parse_equations! now (there is a lot of DSL code at this point...).

isaacsas avatar Aug 14 '24 15:08 isaacsas

yeah, the DSL code has gotten increasingly messy over the last while. I tried to clean it up a bit in https://github.com/SciML/Catalyst.jl/pull/985, but even after that more could probably be done to get it up to the standard of the rest of the package.

TorkelE avatar Aug 14 '24 15:08 TorkelE