Live data from Hacker News

Create system diagrams with Go

github.com

31–40 of 70 posts

Re: Create system diagrams with Go

#31
Go-Diagrams is a Golang port of diagrams [1], an Internal DSL for Python. Diagrams (the name of a software project) models cloud IaaS resources as network graphs and exports DOT [2] files that can be processed by Graphviz compatible tools.

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...

Re: Create system diagrams with Go

#32
post #15

Great! I am a fan of seeing diagrams being generated instead of manually drawn. I was a bit disappointed however to find out the project uses Graphviz/DOT under the hood. What would be the reason not to try a newer rendering engine such as as the Eclipse Layout Kernel (ELK)?

Curious, what's wrong with graphviz?

Re: Create system diagrams with Go

#33
post #15

Great! I am a fan of seeing diagrams being generated instead of manually drawn. I was a bit disappointed however to find out the project uses Graphviz/DOT under the hood. What would be the reason not to try a newer rendering engine such as as the Eclipse Layout Kernel (ELK)?

Hey that’s cool, I didn’t know about this. But there are a few things that would make this difficult to use:

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.

Re: Create system diagrams with Go

#34
post #14
post #11

Earlier quoted context omitted.

It's written in GO! :P

Is this tool beyond creating diagrams? If not, I don’t grasp the point of porting, writing the diagram is like scripting, for which python is arguably a better choice. I hope this isn’t a trend similar to Atwood's Law: “Any application that can be written in JavaScript, will eventually be written in JavaScript.”

It is, and with "written in Go" being part of the advertisement.

Re: Create system diagrams with Go

#35
post #32
post #15

Great! I am a fan of seeing diagrams being generated instead of manually drawn. I was a bit disappointed however to find out the project uses Graphviz/DOT under the hood. What would be the reason not to try a newer rendering engine such as as the Eclipse Layout Kernel (ELK)?

Curious, what's wrong with graphviz?

I've used it for auto generated diagrams of our code. Partly because it's what I know, partly because, surprisingly, there isn't anything free similar.

It's crashy for moderate sized graphs. And doesn't have quite enough layout and styling features. It's good enough but I'm on the lookout for something better.

Re: Create system diagrams with Go

#36
post #15

Great! I am a fan of seeing diagrams being generated instead of manually drawn. I was a bit disappointed however to find out the project uses Graphviz/DOT under the hood. What would be the reason not to try a newer rendering engine such as as the Eclipse Layout Kernel (ELK)?

Hey that’s cool, I didn’t know about this. But there are a few things that would make this difficult to use: 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…

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.

Re: Create system diagrams with Go

#37
post #36

Earlier quoted context omitted.

Hey that’s cool, I didn’t know about this. But there are a few things that would make this difficult to use: 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…

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!

Re: Create system diagrams with Go

#39
post #32
post #15

Great! I am a fan of seeing diagrams being generated instead of manually drawn. I was a bit disappointed however to find out the project uses Graphviz/DOT under the hood. What would be the reason not to try a newer rendering engine such as as the Eclipse Layout Kernel (ELK)?

Curious, what's wrong with graphviz?

I was thinking about writing a markdown extension that would render a code block into an image using this and this extra system dependency is also what turned me off. It's just an extra roadblock for users and whole block of extra instructions for each platform that users have to figure out. It would be better if it would just work out of the box.

Re: Create system diagrams with Go

#40

Very nice, but IMHO this should be the engine behind a file that could easily be parsed such as YML / JSON. I really don't see the point in having to write a Go snippet to describe the architecture: in the end you're providing only data as an input. I guess I'll try to do what I just described because I feel like this could have a lot of potential for my system diagrams

Given that this uses Graphviz, you may as well just write you diagram using that if you want something declarative.
Post reply on HN