Thanks for taking the time to reply to my comment and sorry for the short reply from my side - I am in a hurry.
In case you were looking for a similar text-based integration of a layout engine with your tool there is a textual DSL for ELK called ELKT:
http://rtsys.informatik.uni-kiel.de/elklive/
One could certainly feed that into a binary running the kernel similarly to how a DOT file is fed into graphviz.
Also worth mentioning, the Sprotty project by Mirko.
https://github.com/eclipse/sprotty
This integrates with XText, ELK and the VS Code LSP and allows you to generate diagrams for your own DSL!
1. How do you even call a Java library from Go?
2. Graphviz generates diagrams, whereas according to the ELK page:
> Note that ELK itself doesn't render the drawing but only computes positions (and possibly dimensions) for the diagram elements.
It also wasn’t really clear to me from glancing at the page, what this does better than graphviz.