Live data from Hacker News

D2: A new declarative language to turn text into diagrams

d2-lang.com

91–100 of 130 posts

Re: D2: A new declarative language to turn text into diagrams

#91

Hi all, creator of D2 here. I posted this on Reddit to get some feedback but was hoping to improve the docs and offer a playground environment before posting on HackerNews. Ah well. I wanted to clarify some things: 1. D2 will be open source and usable outside of Terrastruct. Terrastruct will remain the best interface to D2, with bidirectional updates from GUI, but we already have vscode and vim plugins ready for loca…

> D2 will be open source and usable outside of Terrastruct. Terrastruct will remain the best interface to D2, with bidirectional updates from GUI

Any honest open source project would not say such a thing categorically, and would welcome and support community improvements that take it to an even higher level.

But instead it sounds like you will rig the game, with "open source" just meaning "let's get people to work on our proprietary product for free, and we can fly the banner of open source while we're at it!".

Re: D2: A new declarative language to turn text into diagrams

#92
post #46

Looks cool. Any inherent limitations or performance issues with graphs that are very large? (20M+ elements)

Unless you use instanced rendering via some GPU API it's going to take some galaxy brain code to make that work.

We do webgl rendering of big graphs as part of Graphistry, and before the 20M nodes break the system, the ~10X more edges will ;+)

But more seriously, a careful webgl implementation gets you maybe halfway there, and most I've seen break well before then. It gets tricky with browser js memory limits and raw perf. We are looking into hitting more 100M level with interactive speeds... But takes creativity & opts I wouldn't expect for a diagramming tool :) and, if your kind of thing, we are hiring :)

Re: D2: A new declarative language to turn text into diagrams

#93
post #4

The last question in the FAQ makes it clear that this can only be used in the context of their account-based online tool. Their free offering literally says "3 diagrams". Above this, the FAQ tries to compare their tool to Mermaid, Graphviz, PlantUML which are all open source, locally runnable, etc. Their comparison totally skips the fact that, because D2 can only be used in their service, a broad number of use cases…

Good to know. Thanks for the list of alternatives.

Re: D2: A new declarative language to turn text into diagrams

#94

A problem with semantic markup is when it doesn't do what you want, and you need to wig-wam it. Does this mean you actually wanted presentation markup? Or, since you are trying to convey meaning, does it mean that the semantics aren't rich enough to describe what you mean? In this D2 example ( https://d2-lang.com/assets/images/intro-example-a917149ff3b7... ), the diagram is nicely designed to be centered on the nexus…

before introducing anything, I'd like to see more instances where something needs to be on one side of something else, which I haven't found to be the case in software architecture diagrams.

Having a diagram drawing tool that automatically lays things out in an elegant fashion by default is really wonderful -- especially when I am just getting started on any given project.

But if that diagram drawing tool does not graduate to allowing me full control over every detail of the output (albeit that might be verbose or awkward) then it cannot grow with me as my requirements become more complex and it is good only for toy-sized or throw-away projects.

Re: D2: A new declarative language to turn text into diagrams

#95
post #4

The last question in the FAQ makes it clear that this can only be used in the context of their account-based online tool. Their free offering literally says "3 diagrams". Above this, the FAQ tries to compare their tool to Mermaid, Graphviz, PlantUML which are all open source, locally runnable, etc. Their comparison totally skips the fact that, because D2 can only be used in their service, a broad number of use cases…

Wow, thanks for the clarification. Totally missed this part. After having already evangelized this with my coworkers, I may need to take it back. If they made the core open and allowed users to use this language independently of their online service, there's still a ton of value they could have added with premium services on top of this. For writing the docs, sharing with teams, comments / versioning, etc. Visual fig…

Looks like it will, just not yet:

> INFO: It's currently in alpha. During this time, it's only housed on Terrastruct, which provides the most well-supported interface (IDE) for it. Once we have a stable v1, we'll release and continue development of it in open source and make local options available.

Re: D2: A new declarative language to turn text into diagrams

#96
post #17

I am taken a little aback by the name. There is, of course, already the D programming language, which has even had a major version number of 2 for quite some time. It also brings to mind the JavaScript library d3, which, while not strictly for making diagrams, can easily lend itself to the purpose. Calling this thing "D2" seems potentially confusing.

We have: "D" the programming language [0] "D" the data language specification [1] "D" the programming language for DTrace [2] "D3" the javascript library [3] "D4" library/tool for Declarative Data-Driven Documents[4] "D4" implementation[5] of the data language specification[1] Overall, I think "D2" is objectively the best choice here. We have at least three "D"s, two "D4"s, and one "D3", so it makes sense to put it i…

"D1" CloudFlare's database thing

Re: D2: A new declarative language to turn text into diagrams

#97

Earlier quoted context omitted.

Perhaps reading the article is a useful way to get information? If the headline contained everything everyone would conceivably want to know, it would be the article. It's not like the headline was misleading: "a new $tool" is a common phrase for software in alpha and beta stages.

So, to you, "Tool" or "Language" do NOT imply that you can use it independently of a specific online service? I mean, I agree, that "new" is marketing speak for "alpha/beta", but -to me- there is a difference between a "language/tool" and a "Single-Vendor-WebService". Or is my understanding of the semantics of the English language outdated?

Not even outdated - just incorrect. There have been proprietary tools longer than there have been computers, it's the point of patents - grant a monopoly on your proprietary tool for X years in exchange for making it's workings public knowledge.

Even patents aside, why wouldn't this D2 thing qualify as:

   COMPUTING
    a piece of software that carries out a particular function, typically creating
    or modifying another program.
(source: google "define tool")

While it isn't creating or modifying a program, I'd consider "parsing text in a specific syntax to create a diagram" more like a compiler than a site that just provides information or crud sites with some forms. I'm not entirely certain how where it runs affects it's tool status, but it certainly is a consideration to be made while evaluating it for any particular use case.

(also from define tool:

   a thing used in an occupation or pursuit.
and depending on where you stand on the "thingness" of software may also apply here, but that feels diversionary)

I can think of quite a few single vendor languages - various IBM mainframe languages like JCL, K, matlab, multiple .Net and MS languages until recently, applescript, etc.

Re: D2: A new declarative language to turn text into diagrams

#99

Earlier quoted context omitted.

coincidental, i actually thought i'd researched all the available options before embarking. can you share a link to an example? I found the wikipedia but haven't found what the syntax looks like

Okay, maybe it's not as close as I remember it! PIC is designed to be embedded inside of TROFF, so it's... not pretty, to say the least. It does have the -> arrow thing, and the label: value syntax, though. For as hideous as it is, it's surprisingly easy to use. https://yingtongdiddleipo.ee.wits.ac.za/help/gpic.pdf

Those probably descended through PlantUML

Re: D2: A new declarative language to turn text into diagrams

#100

Earlier quoted context omitted.

Okay, maybe it's not as close as I remember it! PIC is designed to be embedded inside of TROFF, so it's... not pretty, to say the least. It does have the -> arrow thing, and the label: value syntax, though. For as hideous as it is, it's surprisingly easy to use. https://yingtongdiddleipo.ee.wits.ac.za/help/gpic.pdf

Those probably descended through PlantUML

the -> probably descended from cave paintings
Post reply on HN