AFAIK Apple forbid apps from providing local programming capabilities. You can't even do a JS console in Safari without attaching to a Mac and using Apple's development tools.
Once we go beyond Apple ecosystem, there have been dozens of visual/graphical programming environments. Good examples are Blender 3D modelling, special effects in music and video production tools. The downside is that "diagrams" quickly become very complex and hard to navigate.
For a good overview of the space, see: https://en.wikipedia.org/wiki/Visual_programming_language