The author has made DSL in Python by (ab?)using context managers and the bitshift operator. It's very interesting, and I haven't seen anything quite like it. Python can lend itself to horrific abuses through shenanigans like this. I sometimes feel that siren call myself, and usually regret it. So by default I'm pretty skeptical of this kind of thing, but I'm actually on the fence about this one.
Diagram as Code
71–77 of 77 posts
Re: Diagram as Code
#72The author has made DSL in Python by (ab?)using context managers and the bitshift operator. It's very interesting, and I haven't seen anything quite like it. Python can lend itself to horrific abuses through shenanigans like this. I sometimes feel that siren call myself, and usually regret it. So by default I'm pretty skeptical of this kind of thing, but I'm actually on the fence about this one.
Check out Sagemath for an entire Mathematica thing done entirely through overloading.
(n.b. I have only used SymPy, not Sagemath. I'm assuming they're similar)
I think sympy (and maybe sage) is a bit different because they're (mostly?) overloading operators for their intended purpose -- that is, the "+" operator does semantically add python objects that represent symbolic math.
Re: Diagram as Code
#73Earlier quoted context omitted.
Check out Sagemath for an entire Mathematica thing done entirely through overloading.
Yes! A good point of comparison. (n.b. I have only used SymPy, not Sagemath. I'm assuming they're similar) I think sympy (and maybe sage) is a bit different because they're (mostly?) overloading operators for their intended purpose -- that is, the "+" operator does semantically add python objects that represent symbolic math.
Re: Diagram as Code
#74If you don't mind sharing (or if anyone knows of any toolkits/libraries): I wanted to try getting at drawing some custom diagrams and was unsure where to begin coding just project. Any know of anything that comes to mind?
Re: Diagram as Code
#75I have been thinking about using this for some diagrams, but whats been on the back of my mind since I heard about it is how to combine it with Terraform, or Troposphere, and have your infrastructure as code also draw the diagrams automatically.
...but if a tool that simplifies configuration or code into a diagramable state exists, i'd like to know :)
Re: Diagram as Code
#76It seems to be hyperfocused on system architecture diagrams. There are some other kinds of diagrams would we like to draw that’s not system architecture diagrams, eg: - algorithms - decision trees - UML/ER Diagrams Mermaid (JS) helps draw quality diagrams quickly - more than system architecture diagrams. It would have been perfect if the development cycles that went here was used to create Mermaid templates instead.…
Nice suggestion. The headline appears misleading to me, I like what I see there, but it's really "Diagram as Config" not source code generally.
Yup!
As "Diagram as Config" this tool is a great fit but not for "Diagram as Code". There are better alternatives out there.
Re: Diagram as Code
#77I was hoping this tool would support directionality/sequencing of nodes. A tool I've used in the past is SequenceDiagram.org for diagraming a sequence of service calls. While a bit old-school, it's good for its purpose. I've also used Whimsical[0] to model flows and graph-like relationships. It's got the added benefit of allowing multiple users to view and edit the same document. Whimsical is still my favorite tool r…
For quick sequence diagrams I really like https://swimlanes.io/ It's text-based (build on Mermaid if I'm not mistaken) and really easy to work with for simple interactions. Also because it's purely text-based you can pass around the full context in the URL. This makes it a little awkward to collaborate vs. a true hosted solution, but it also lowers the barrier to entry significantly.