# D2 DSL or equivalent for diagramming in Crystal?

**URL:** <https://forum.crystal-lang.org/t/d2-dsl-or-equivalent-for-diagramming-in-crystal/9258>\
**Category:** Crystal Contrib\
**Created:** [November 3, 2026, 2:52am UTC](https://forum.crystal-lang.org/t/d2-dsl-or-equivalent-for-diagramming-in-crystal/9258 "2026-11-03T02:52:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mzs114](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@mzs114](https://forum.crystal-lang.org/u/mzs114)\
**Post date:** [November 3, 2026, 2:52am UTC](https://forum.crystal-lang.org/t/d2-dsl-or-equivalent-for-diagramming-in-crystal/9258/1 "2026-11-03T02:52:14Z")

</div>

D2 released TALA(their proprietary diagramming engine alt for Dagre, ELK) after more than 10 years of RnD.

What d2 is capable of: [https://d2lang.com/documents/d2\_cheat\_sheet.pdf](https://d2lang.com/documents/d2_cheat_sheet.pdf)

The project compared a few(Mermaid, Graphviz) and looks like D2 is the elegant one like how crystal is, concise and with low syntax verbosity.

The comparisons with other diagramming engines: [https://text-to-diagram.com/](https://text-to-diagram.com/)

Atm, when modifying Models or relationships in Crystal based frameworks, I need to update at two places and this risks drift and/or the documentation going stale.

D2 supports ERDs and UMLs, that make it easy for humans to visualize(and hopefully help us understand) the relationships between the models and objects in a framework.  
It helps for a developer to get this extracted from the stock code crystal code/script.

Reinventing something like d2 is hard, so maybe we can c2d2, a crystal wrapper to get d2 DSL( or maybe something different).

Their community plugins, there exists JS/TS and other libs that try to make it native to their setup. c2d2 can be one:  
[https://d2lang.com/tour/extensions/](https://d2lang.com/tour/extensions/)

The announcement: [TALA is open-source | D2 Documentation](https://d2lang.com/blog/tala-is-open-source/)

---

<div class="post-metadata">

**Author:** ![zw963](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/zw963/32/1623_2.png) [@zw963](https://forum.crystal-lang.org/u/zw963)\
**Post date:** [November 3, 2026, 2:21pm UTC](https://forum.crystal-lang.org/t/d2-dsl-or-equivalent-for-diagramming-in-crystal/9258/2 "2026-11-03T14:21:34Z")

</div>

Check this.

> **[GitHub - crystal-china/tetris: Tetris game powered by SDL3](https://github.com/crystal-china/tetris)**
>
> Tetris game powered by SDL3

---

<div class="post-metadata">

**Author:** ![mzs114](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@mzs114](https://forum.crystal-lang.org/u/mzs114)\
**Post date:** [November 3, 2026, 6:00pm UTC](https://forum.crystal-lang.org/t/d2-dsl-or-equivalent-for-diagramming-in-crystal/9258/3 "2026-11-03T18:00:25Z")

</div>

I did not understand, how a game is related to the DSL. Please elaborate.

---

<div class="post-metadata">

**Author:** ![zw963](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/zw963/32/1623_2.png) [@zw963](https://forum.crystal-lang.org/u/zw963)\
**Post date:** [November 4, 2026, 3:44am UTC](https://forum.crystal-lang.org/t/d2-dsl-or-equivalent-for-diagramming-in-crystal/9258/4 "2026-11-04T03:44:10Z")

</div>

Oops, I made a mistake, I thought you wanted a 2D binding for SDL
