by sradman · 6y ago · 0 comments
Neither Python nor Go are ideal languages for implementing an Internal DSL, compared to say Ruby or Groovy, so the first question is why an Internal DSL vs. the DOT language (or another External DSL) and the second question is whether Python or Go are expressive enough for this use case? I think the answer in this case is that any language that supports Class-like structures can provide a namespace to describe the common resources, relationships, and constraints found in cloud IaaS.
I'm assuming that the DOT language does not have the facilities to add domain specific names and constraints so an Internal DSL is a perfectly reasonable approach even if it generates intermediate DOT files.
[1] https://github.com/mingrammer/diagrams
[2] https://en.wikipedia.org/wiki/DOT_(graph_description_languag...
I haven't used Python or Go diagrams but I have been a big user of plantuml for over a decade now. Off the top of my head, here are the main logistical problems with it:
* It sits on its own
* Hard to "share" metadata
* Difficult to manipulate once put into the DSL
* PlantUML has 12 different languages in one tool
I took a look at Python diagrams and a light bulb went off. Something that would make it so much easier for _everyone_ to contribute. Most people don't want to use PlantUML. But a DSL in Python? Could pay dividends.I will seriously consider Python diagrams for my next project.