News for hackers. Stuff that matters.
Re:D2: A new declarative language to turn text into diagrams by alixanderwang on Tuesday August 30, 2022 @03:27PM (#32654039)
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 local editing. We're a small team and working on one thing at a time.

2. We're aware of PlantUML, Graphviz, Mermaid, of course. These are mature offerings, but I see plenty room for improvement that we intend to tackle with D2. https://d2-lang.com/tour/faq#how-does-this-compare-to-mermai...

Feel free to ask any questions!

Re:D2: A new declarative language to turn text into diagrams by sigy on Tuesday August 30, 2022 @07:01PM (#32656281)
It seems that open sourcing it while it is growing up actually makes more sense. If you want community involvement, ideas, testing, contributions, and so on, then hiding the project source is antithetical to why most people participate in open source in the first place.

Open source can mean more than just a license. It should mean more than just gifting a code base once you think you're done.

I don't mean to come across as bitter or entitled. I just question the value of waiting till the last minute. For now, the promise only stands as a way to pull people into the fold. I've seen this kind of promise many times before in projects much like this.

Re:D2: A new declarative language to turn text into diagrams by alixanderwang on Tuesday August 30, 2022 @08:24PM (#32656873)
thank you for the advice, I do appreciate it, as I'm no expert in open source. one thing to clarify is the idea that we're tying a bow and chucking it across the fence. we'll be far from finished when we open source d2. the intention was to internally seed the initial design (of both the language and the code) -- the first minute of building -- quickly, within a small team. i'm really grateful for all the interest today from everyone, hopefully HN will let me post the repo to update people shortly (w/o considering it a dupe).
Re:D2: A new declarative language to turn text into diagrams by jrmiii on Friday September 02, 2022 @11:00AM (#32691627)
The guidelines for dupes require "substantially new information", IMHO the source absolutely constitutes substantially new information and I look forward to seeing it - I think your video demo was very compelling.

It reminds me of that adage, "Start your business, the tool you build to run your business is now your business"

Re:D2: A new declarative language to turn text into diagrams by kaladin_1 on Tuesday August 30, 2022 @04:57PM (#32654952)
Nice intro video on the landing page. I liked the capabilities shown.

I do think you could have made it obvious in the Getting Started section that this is not a local runnable language. I spent some time looking for how to install it only for me to realise that it is some form of SaaS.

Re:D2: A new declarative language to turn text into diagrams by alixanderwang on Tuesday August 30, 2022 @05:08PM (#32655080)
Thanks! The caveat is on the intro/home page. We very much intend to support a high quality locally runnable experience before we'd call it a v1.
Re:D2: A new declarative language to turn text into diagrams by flashgordon on Tuesday August 30, 2022 @03:50PM (#32654259)
By the way do you have a BNF grammar (or something more of a formal spec for this?). The cheat sheet does look good though.
Re:D2: A new declarative language to turn text into diagrams by alixanderwang on Tuesday August 30, 2022 @04:11PM (#32654470)
No unfortunately not yet. The docs are like 75% caught up to all the language right now and it's still changing not infrequently, so we'll make some formal specs once it's stable. This reveal caught us off guard =).
Re:D2: A new declarative language to turn text into diagrams by mdaniel on Tuesday August 30, 2022 @05:38PM (#32655485)
> I posted this on Reddit to get some feedback

> This reveal caught us off guard

Hmmm

Re:D2: A new declarative language to turn text into diagrams by alixanderwang on Tuesday August 30, 2022 @05:42PM (#32655527)
hah, so the line of logic was: "let's post on reddit to get some low stakes feedback in preparation for a HN launch"
Re:D2: A new declarative language to turn text into diagrams by atonse on Wednesday August 31, 2022 @08:37AM (#32661288)
I can buy this reasoning. This crowd gives solid, tough, but highly constructive feedback.

I, like others, will keep an eye out for when it becomes open source mainly to see which license.

Re:D2: A new declarative language to turn text into diagrams by ListenLinda on Wednesday August 31, 2022 @01:52AM (#32658850)
Will you be able to make computer network diagrams? None of the existing open source programs are very useful for this mostly because you can’t put text at the beginning, middle, and end of connectors.
Re:D2: A new declarative language to turn text into diagrams by alixanderwang on Wednesday August 31, 2022 @02:12AM (#32658977)
we only support 1 label for connections right now, but that's a good suggestion. i'll put it on our roadmap, ty!
Re:D2: A new declarative language to turn text into diagrams by eevilspock on Tuesday August 30, 2022 @09:33PM (#32657332)
> 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 by ryukoposting on Tuesday August 30, 2022 @09:06PM (#32657153)
The syntax reminds me a bit of PIC. Is that coincidence, or intentional?
Re:D2: A new declarative language to turn text into diagrams by alixanderwang on Tuesday August 30, 2022 @09:12PM (#32657188)
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
Re:D2: A new declarative language to turn text into diagrams by ryukoposting on Tuesday August 30, 2022 @09:24PM (#32657269)
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

Re:D2: A new declarative language to turn text into diagrams by SonOfLilit on Tuesday August 30, 2022 @11:34PM (#32658083)
Those probably descended through PlantUML
Re:D2: A new declarative language to turn text into diagrams by alixanderwang on Tuesday August 30, 2022 @11:52PM (#32658179)
the -> probably descended from cave paintings