r2d4 / virgo

Graph-based Declarative Configuration Language
MIT License
133 stars 7 forks source link

The behavior of multiple edges is unspecified #2

Open CrazyPython opened 3 years ago

CrazyPython commented 3 years ago
a <- b
b -> a

Would a compliant parser return a Set (unique only) or List datatype? Or is it invalid?

r2d4 commented 3 years ago

I think it should support the most generic graphs. I didn't include any restrictions on cycles.

I did experiment a bit with adding a constraint directive to the language, allowing users to do something like the set builtin in bash to set different parameters, such as no-cycle, labeled (to enforce each node is labeled), or something else. However, I think that can get complicated quickly.

Ultimately I thought that it would probably be better off in a separate graph library (the CLI's topological sort enforces no cycle).

What do you think?