Penrose – Create diagrams by typing notation in plain text
Penrose is a research project from CMU that generates mathematical diagrams from plain-text domain-specific languages, separating “substance” (the underlying relationships) from “style” and using constrained optimization to lay out visuals. Commenters compare it with other text-based diagram tools like Mermaid, Graphviz, TikZ, and D2, praising its expressiveness and reusable styling while questioning the learning curve, performance, and suitability for everyday UML‑style or business diagrams. There is also debate over the quality and correctness of some showcased examples (such as chemical structures) and over naming the project after Roger Penrose, alongside interest in future integrations with LaTeX, IDEs, and large language models to make authoring easier.
Getting started & DSL structure
- Some struggled to find the notation; answers pointed to “Learn Penrose”, “Documentation”, and the example gallery.
- Each diagram uses three components:
- Substance – the abstract data/objects.
- Style – vector-graphics-level layout and appearance.
- Domain – domain-specific typing/relations.
- The style files often contain most of the complexity; some find the three-way split powerful but heavy, with plans mentioned to eventually unify the DSLs.
Separation of substance and style
- A central idea: separate what the diagram represents from how it looks, akin to HTML vs CSS.
- Same substance (e.g., set-subset relations) can be rendered as different diagram types (Venn, tree, etc.).
- Diagram generation is framed as a constrained optimization problem, enabling automatic layouts and exploration via constraints rather than fixed coordinates.
Comparison to other tools
- Compared with Mermaid, Graphviz, D2, TikZ, MetaPost, Asymptote, PlantUML, Pic/Pikchr, etc.
- Seen more as an alternative to MetaPost / mathematical-figure systems than to business/UML tools (Mermaid, D2).
- Some users prefer WYSIWYG tools (Inkscape, Illustrator, Excalidraw) for direct control and sketching.
Usability, ergonomics, and AI
- Several find the DSL intimidating and “too much” for quick diagrams; others value the expressiveness and reuse of styles.
- Critiques of “diagrams as code”: hard to sketch, brittle when requirements change, often low ROI beyond simple cases.
- Others value source-control friendliness and code-generated diagrams (e.g., from state machines).
- Multiple comments suggest using LLMs to generate Penrose/Mermaid code; the project itself is researching LLM-based Penrose authoring.
Rendering, integration, and performance
- There is a CLI tool that can export SVG without a browser, using a canvas/Cairo-style backend.
- Memory issues in the browser are acknowledged, tied to repeated Wasm allocations; workarounds (memory reuse, workers, future Wasm GC) are being explored.
- Users express interest in tighter integration with LaTeX and note early/uncertain plugins (e.g., Obsidian).
Example quality and domain correctness
- Some examples are praised as beautiful; others are criticized as confusing or messy, with commented-out code harming their value as teaching material.
- Chemistry diagrams (e.g., caffeine, methane combustion) drew strong criticism for physically incorrect structures; maintainers admit these are naive “no-overlap” layouts and plan better domain-aware approaches.
- One commenter notes Penrose likely needs multiple specialized layout engines for different domains.
Scope, randomness, and control
- Questions about controlling positions without explicit coordinates highlight the tension between auto-layout and precise placement.
- Some want deterministic, hand-tuned layouts by default; others see value in stochastic exploration with constraints.
- Comparisons are made to tools like GeoGebra that keep constructions deterministic but responsive to changes.
Naming and terminology
- Confusion with “Penrose diagrams” in relativity and Penrose tensor notation is noted; separate tools exist for spacetime diagrams.
- Debate over calling the system “Penrose” (and naming the CLI “roger”) centers on whether using a living scientist’s name without clear affiliation is in poor taste; others point out the surname is not unique.
- Clarification that “plain text” in the tagline means non-binary, editable text files, not natural-language English.