Open zekenie opened 4 months ago
I'm not on this project but a prerequisite is probably understanding a bit more about the D2 parser :) If that means learning a bit more Go, that's an entry point.
Disregarding gen-ai for now, maybe a good short term goal is to compile D2 into a target that runs the services you want? You can do that by any quick and dirty means you like, you don't necessarily need to use the Go parser.
I like the idea, it just needs a bit more legwork.
I've been thinking about it and i think if i can understand a json structure I could get out of the parser, then, i could do a lot of the work and treat the go/parser part as a solvable problem.
I also was thinking about it and the d2 spec doesn't quite have enough information. It's so close, though. For example with the database tables, i can't tell which column points to which table. I know that two tables are related, and I know that a column is a foreign key, but i don't know which col points to which table. i might be able to derive it from the name in some cases....
I almost wonder if I should treat D2 as an inspiration for a diagrammable prototype DSL, instead of thinking of it as the literal DSL i want. Like maybe i make a new DSL that can compile to D2 but that I have more control over.
Which spec are you looking at? I had a quick search and couldn't find it.
Since this project has goals around extensibility, a JSON representation from the parser doesn't seem too far-fetched.
Happy to help as I'm keen to learn more about D2.
I have some ideas for slightly unconventional use cases for D2 and I'm looking for feedback. For example, I think D2 could make a quite AI-enabled prototyping environment for a sort of single-file http server.
Imagine the following D2 example
Now imagine you could run
and have a fully running HTTP server, backed by sqlite or something, that would do more or less what your diagram described. If you add in the possibility that you could make comments processed by gen-ai, it could get pretty interesting.
I'm interested in hacking on this on a weekend project some time in the next few months. What's getting in the way for me is understanding how I can parse D2. I don't want to write my own parser. I'm not a go expert. I'd love some help understanding the prior art and how feasible this idea is.