I guess I'm leading a charmed life, because I can not recognise UML on sight? (I thought at first this was describing a grammar of fake pirate language or something.)
You have to learn UML because of the stupid arrows. Compare it to something like this which acknowledges the fact that nobody is going to casually memorise 10 different styles of arrow just to read occasional UML diagrams:
https://buck2.build/docs/concepts/concept_map/
Much better.
When reading a diagram, ideally you would read it by looking at the generated diagram, not text, as that's the entire point, but even when reading the raw text, it's apparent where the arrows are, based on "less than" and "greater than" characters, no?
through that's kinda true for a ton of tooling using the word "UML"
and in many case you also somewhat want something which is less precise (and verbose) then UML theoretically is
This tends to be "the" big problem with UML (and similar): Very few people care about, or have a reason to, stick 100% to UML. They want to "speak diagrams", and just like written or spoken language, our syntax and semantics is context dependent and dependent on the dialect and speech patterns and understanding of those we speak to.
So the "UML" people learn is often a dialect of sorts closer or further from the formal grammar, and a lot of tools fail to take that into account and try to force you into conformity. We accept that for programming languages, yet we still use pseudo-code in all kinds of contexts, but diagrams are one step up - one of the things we "escape to" when writing formal code is too complex or we want to explain things to people who don't know or care about the details.
There's a significant strain there between those conflicting goals of diagrams as communication, and the evolution of CASE tools that wants diagrams to be formal, that is much closer to how we deal with natural languages (people arguing over formal use vs. slang) than with programming languages, and it's fascinating.
[1]: https://d2lang.com/
Example:
The underlying js library will render straight to an HTML canvas or to SVG from a Node.js program. You can run it from the command line if you want to.
The code is reasonably easy to modify as well even if it isn't fully documented, so I was able to hack in a way to have tooltips on hover, and making certain boxes clickable linking to other diagrams. I'm really grateful for this awesome tool being open source!
[more loot] no ->[<end>e]
[<start>start] -> [<state>plunder] -> [<choice>more loot] -> [start]
[Pirate|
[foul mouth]<:-[beard]
[parrot]--[beard]
]
[<table>mischief| bawl | sing || yell | drink ]
[<abstract>Marauder]<:--[Pirate]
[Pirate] - 0..7[mischief]
[<actor id=sailor>Jolly;Sailor]
[sailor]->[rum]
[Pirate]-> *[rum|tastiness: Int|swig()]
[sailor]->[Pirate]I've used a few of these code-as-diagram products because I dream of a world where technical documentation, including diagrams, are part of the source code of a project. But my experience is that getting acceptable layouts, especially for external distribution but also just for internal use, is arduous.
And that frustration leads to at least two possible undesirable outcomes: the diagrams become unreadable or the diagrams become unmaintained.
To be honest, the idea of code-reviewing the documents during check-in is also a myth. In general the diffs on these kind of documents are extremely difficult to grok. It is almost impossible to meaningfully check the document is correct without rendering it and reviewing the output.
It is the kind of thing I really wish worked. Maybe one day it will become a solved problem.
On one end of the spectrum you could use something like SVG if there were standard or dominant tools used to import/export, but then you lose the ascii readability benefit of tools like this, dot, or d2.
It'd be nice to have a mixed text & GUI editor for something like Pikchr diagrams.
Edit: You're probably still going to have to render it as part of the review for non-trivial changes but when the visual result matters I don't see any way to avoid that.
I'm extremely excited about using WireViz[1] to automate wiring harness diagram creation, and if I can, I'd like to know the speedbumps before I hit them. I'm thinkin generous linking between diagrams will be one path - keep the individual diagrams fairly small in scope, link 'em together.
[1] Project:: https://github.com/wireviz/WireViz SandboxP:: https://kroki.io/#try [select Diagram>WireViz]
[Pirate|
[beard]--[parrot]
[beard]-:>[foul mouth]
]
parent posts Pirate table [Pirate|
[foul mouth]<:-[beard]
[parrot]--[beard]
]
this is upside down. Defining beard and parrot the order we want them to appear doesn't help: [Pirate|
[beard]
[parrot]
[foul mouth]
[foul mouth]<:-[beard]
[parrot]--[beard]
]
it is still upside down.I struggle to think of what this might be without it turning into some other natural language. For example, the tool that’s used to convey intentions and ideas in these comments is written English, which certainly has its own structure.
Being able to visibly label them would still make a lot of sense.
However, if I ran into this incidentally (not posted to HN for review), I would never use this. I'd see the lack of a github link on the top right, and assume it's a some kind of startup making some prototype hosted tool.
The only way to find out this is open-source is to click "about," read to the third paragraph, see github mentioned, click through the link, and click on the license.
My major piece of feedback is to add a github link to the icons at the top-right of the page. A .org might also be nicer than a .com.
To people asking why this and not a graphical tool?
To me, the overhead to moving a graphical tool is very large:
1) I like being able to manage files on github and be able to use common tooling.
2) If someone (including myself, two years later) needs to install Vizio, Illustrator, or whatever other tool to edit my diagrams, pay for a cloud service, or worse, recover something which was hosted in a discontinued tool, I'm SOL.
3) Discovery is big too. I can use normal search tools to find things. If something is locked away in a .ai file, a .docx file, or a cloud service, and I lose it, it's likely lost forever.
95% of the cost of most projects is maintenance, and even if I invest 10x the time up-front into making a diagram in a tool like this (e.g. an hour to learn it, tweak it, and get the diagram I want, instead of 5 minutes in my favourite GUI), that will pay much than an hour in dividends down the line. I use Markdown, LaTeX, and similar for large or important documents because, in the long term, they save time.
Yeah, it's absolutely horrible when the GitHub link is in the bottom right rather than the top right. Completely unforgivable. Geez.
Do (Free|Net|Open)BSD and GNU tools qualify as open source? No GitHub link as far as the eye can see :)
Ways I've seen this done:
- Clear github icon (visual cue)
- "Fork us on github" template
- Adding the words "open-source" somewhere (or even XXX-licensed). The "about" page could start "An open-source tool for drawing UML diagrams based on a simple syntax."
There's no reason to go over-the-top. Again, the reason people post things to HN is generally to generate visibility and to gain feedback. People don't write feedback to be mean but to help projects improve.
It's not "completely unforgivable" but I gave a bit of simple feedback which might reduce friction a bit and which would take a few minutes to implement. I appreciate similar feedback on my projects. In this case, for me (n=1), I've been derailed from adopting projects based on similar levels of friction. I will pull up a many things, prune them pretty quickly, and then do a deep dive into the most promising. I've always found user studies and friendly reviews helpful for avoiding these sorts of frictions in my own work.
There's actually another category. Open source software with paid plugins. I always wonder what happens when someone adds similar functionality to the open source version.
It's nice to have your diagrams as readable code which you can check in with the rest of your git repository and embed in READMEs, and the syntax is really intuitive and easy to learn. I haven't made the comparison with this particular tool yet, but in general I'd recommend this practice of including diagrams with your docs.
As a nice bonus, GPT-4 is pretty good at generating valid PlantUML. I have given descriptions of the diagram I want and gotten results that have gone into docs unchanged.
But in all those cases wouldn't it better to have something with an actual API in a programming language you are familiar with? Or at least a tool the takes something like JSON, for which there already are great tools for parsing, generating and manipulating.
You state this like a fact. A GUI might be your personal preference but markup is preferred by many. It takes me an order of magnitude longer to learn where all the buttons are than it does to internalize markdown syntax from a few good examples. In a GUI you spend time futzing around with visual details, In a markup chart you spend time building and communicating a coherent mental model. The difference in output quality is apparent to me.
There's an analogy to programming: sure we have visual programming tools but who uses them? they break down when things get mildly complex. A markup driven charting tool lets me edit in the comfort of my chosen IDE, check it into source control to collaborate, renders live instead of checking in an image artifact, and has clearly-defined semantics (ie not just a pile of incoherent boxes and arrows). IMO, it's superior in every way except fine-grained control of the layout (which is a fine tradeoff for me - I want my readers to focus on content - consistency is more valuable than styling). If your purpose is communicating complex ideas (not making a pretty picture) markup-based charts have some distinct advantages that you just can't get from a point-and-click interface.
I really don't think this is a good analogy. Clearly presenting an idea / architecture / model / workflow at a high level by creating a graphical representation is quite different than making an application does a lot of things at a low level (e.g. handling user interactions, processing data, providing GUI, communicating with other systems, handling errors).
I agree there may be some benefits to that but I guess it also depends on what kind of diagrams you are making. For example, I would never ever draw UML diagrams in markup. I want to be in control how elements look, where they are placed, where and how lines are drawn and where and how they are shown. In my experience, automatic placement even on GUI diagramming tools suck 99.9% of the time.
On the contrary, I use drag&drop tools for very simple diagrams but prefer using PlantUML for anything complex because its text-based interface makes it easy to generate, diff or store in a git repository. The best of both worlds would be a text-based tool to hold the semantics of your graph, and then a drag&drop interface to fix the layout.
Exactly this, I wonder why no one has come up with it yet. Maybe you could embed the layout details like coordinates of elements inside the markup in a separate section?
We don't have many options of approved diagramming software where I work though. Omnigraffle which I don't care much for, and Visio which doesn't work on Mac. Maybe I'd have a different opinion of we had something proper.
For random boxes and arrows I do typically go for Excalidraw though.
1. You can build tools to automatically generate these diagrams from existing software quite easily. I've used tools like this to generate diagrams that were impractical documentation (150+ sheets of A4 when printed), but showed class or module dependency hotspots in a way that would have taken weeks to understand from the code alone: a picture speaks a thousand words, and getting your code to give you a picture is useful.
2. You can version control them - and see change history - more easily through a markup/code approach than a GUI approach. When teams collaborate over a complicated piece of design, being able to see who contributed what and when in a diagram is as useful as it is seeing it for a piece of code. I'd argue the first responsibility of a programmer in a modern team is to communicate, and to do so in a collaborative fashion. Code, tests, documentation, should allow easy collaborative understanding, editing and iteration. Diagrams that don't have editable markup make this harder in a small way.
3. The semantics of the markup actually make you think through what it is you're trying to express. It's easy to draw a line connecting two shapes but what does that line actually mean? I find when I'm typing up markup for a diagram, this becomes something I more consciously consider.
4. A markup standard means there is likely to be multiple tools that support the reading, editing and creation of the artifacts you create. Some people feel it's easier to use a WYSIWYG word processor, but I think we can all agree that Markdown is a useful innovation that has stimulated some experimentation and development in the text editing domain.
5. Most "hand-drawn" GUI-based diagrams look ugly (most programmers can't design diagrams well), but using an algorithm to make layout choices provides consistency and better layouts.
6. Many "hand-drawn" diagrams are full of style inconsistencies. With a markup + parser = diagram approach, you can enforce a house style, update that style easily, and everybody's diagrams in a doc look aesthetically similar rather than each individual's personal preference on line weights and arrow styles. It's a bit like separating HTML and CSS - hard to do in a GUI-only approach. In larger teams with a dev wiki, all the diagrams looking similar is just nicer.
YMMV, but I'd give this approach serious consideration - this tool looks great, but there are others, and it's worth evaluating them if one doesn't impress you. I'm a graphviz guy, but I might consider looking at this more closely.
Got a hairy state machine? Stick a comment at the top with something like nomnoml's syntax and anyone can follow what's going on without having to trace through the code.
FWIW, Doxygen does diagrams-from-code out of the box. It's mostly a code documentation/literate programming tool, but also useful for these reverse engineering tasks starting from an existing codebase.
Look at the popularity of Markdown, a syntax that is just "simple html but it's easy to read in plain-text form". Or YAML, which is just "JSON and XML that doesn't make your eyes bleed, but has the worst type-inference ideas ever".
Yes, GUI tools can help. Doing image-links in Markdown is a PITA. Ditto good-looking tables. But still, the idea of "human-friendly-text-first" formats is valid.
Doing the same for UML just makes sense to me.
Now obviously there are implementation details I disagree with, both in the format and the renderer. But the idea is sound.
One day, someone on our team had the brilliant idea to log the state of the program as a dot graphviz text file and just render it with the tool. Our debugging effort was instant all of a sudden.
Sometimes these tools are amazing at visualizing data more than at building diagrams. It's surprisingly easy to generate valid text files programmatically. Note that I'm talking in general about this class of tools, not nomnoml specifically.
Yeah, the problem with these sort of layout algorithms is that they don't have a sense of proportionality.
I wonder if LLM can do this better. I've tried with 5 relations from this example one and ChatGPT comes up with this:
Place "Jolly Sailor" at point (1, 1).
Place "Pirate" at point (2, 1).
Place "rum" at point (3, 2).
Place "mischief" at point (2, 0).
Place "Marauder" at point (3, 0).
It looks okay, but I haven't checked with anything more complicated.[0]https://www.ilograph.com/blog/posts/its-time-to-drop-drag-an...
:sigh: technology.
And I think they’ve gotten to the point where “how can LLMs change this workflow” is a much more impactful question than basically any other UX improvement
a REAL tool
It blows my mind though how the moment that someone offers free stuff, the first comments are people asking for more free stuff.
If I wasn't paid to work full time on open source software, I'd think very carefully about whether to do any open source work nowadays.
If you create something from the perspective of "I had to make this on my unpaid spare time..", then requests for additional work do seem annoying.
But is that the case here?
If I made a utility I thought other people could also benefit from I'd personally be open to suggestions. I'd ignore a lot of them, but every now and then someone requests something interesting that sparks motivation to expand the utility.
HOWEVER...
I've had a few people who say things like "OMG. YOU MUST DO IT THE WAY I THINK YOU SHOULD DO IT" or "ADD THIS FEATURE OR YOUR NOT A REAL OPEN SOURCE CONTRIBUTOR." And that is definitely annoying. I have a thick hide and don't mind just ignoring those people, but that shouldn't be the default assumption. The people who work on open source projects are people, so don't be a pushy jerk when you're requesting features from FLOSS projects.
ALSO...
Let people revel in the approval of their peers before pointing out things you would have done differently. This is a cool bit of kit.
I've been maintaining open source software for two decades now, and I still love it when people ask for more stuff. It signals engagement and satisfaction and gives me very concrete directional guidance around where I should take my software.
I'm under no obligation to deliver on those requests.
My day job pays my bills, my open source stuff brings me joy.
Try to launch a free service for consumers and experience how they are entitled to stuff just because you offer this service.
Miro and others, I am always thinking visually. It's another step removed from the real thought process.
As you point out, these systems sometimes produce difficult to read diagrams. For particularly important communications, I will re-draw these in draw.io, or a similar sort of tool. But then I am thinking more about presentation, rather than relationship design and the tool is better for the job.
1. I want changes to the diagram to be peer reviewable and understandable. 2. I want something else to manually lay out things, rather than have to adjust it personally on every addition or change. 3. I want a parsable structure I can feed into grafana or similar, so I can decorate the graph with metric data. It seems like it would be cool to have a graph of RPC calls and which links were red.
I don't think this can do it, but it would be cool if it could.
Maybe someone can make another diagramming DSL for the Grafana Node Panel.
And personally, if you're going to suggest an alternative, Miro is not the one. Irritating SAAS nonsense