...
Side note: when I hear "Penrose diagrams" I have in mind Penrose tensor notation, as in https://www.math3ma.com/blog/matrices-as-tensor-network-diag....
https://en.wikipedia.org/wiki/Oliver_Byrne_(mathematician)
Archive.org, print: https://news.ycombinator.com/item?id=11628606
https://tex.stackexchange.com/questions/92691/is-it-possible...
Penrose, for mathematical drawings, might very well become what TeX, LaTeX, and Desktop Publishing programs are, to text!
I think you are on the right track to something grand!
Wishing you a lot of luck in this endeavor!
That said, looks cool and it is written in Haskell and React: https://github.com/penrose/penrose
Yes, minted works like that -- it starts a python child process to use pygments to do the syntax highlighting. But with minted and TikZ there's a single element of "source code" in the LaTeX file (a code listing or tikz code fragment respectively) that maps to a single element in the output (syntax-highlighted code, or a TiKZ image). Whereas with Penrose, there would be multiple source code files (the style and substance code). I'm not sure it quite fits the native LaTeX model does it? Maybe it's better just to use Make to generate the Penrose diagram for inclusion via \includegraphics?