Comma separated list of node IDs


Maintainer of and a Graphviz language server here. Someone reported an issue with my implementation. Basically, it’s about comma-separated node IDs that are pointing to each other. Ref:

In short, this code:

d:e, m:e -> v01:w, v02:w

Should be equivalent (according to the grammar/spec on to this:

d:e m:e -> v01:w v02:w

As linked in the issue above, it is not the case when looking at Graphviz’ implementation of the grammar. It’s actually more like

{d:e m:e} -> {v01:w v02:w}

With the exception that the port information is dropped when using sub graphs.

However, the spec denotes:

Semicolons and commas aid readability but are not required. Also, any amount of whitespace may be inserted between terminals.

What’s the intended behaviour in this case? Are there other scenarios that don’t align 100% with the formal spec? If this is intended (which I assume), is it planned to update the formal grammar?

(personal opinions:)

There pain in my heart that the formal grammar doesn’t have semantics, given the programming language background of some of the people that started this project, but, it’s true.

All-in-all, I like the “looseness” of the language. I believe it make the language more approachable by non “computer” people.

Dave Korn gets the credit; I was going to make the language more strict. He said, you should make it easy to use. This was all in the pre-SGML era.

CS theory tried hard, but basically, failed to make languages convenient for programming by non-theorists. In some ways Graphviz is a little microcosm of that.

And those who tried too hard were cursed to live in interesting times.

I didn’t know that, but I’m not surprised, either.