Live data from Hacker News

Penrose – Create diagrams by typing notation in plain text

penrose.cs.cmu.edu

91–100 of 124 posts

Re: Penrose – Create diagrams by typing notation in plain text

#92
post #80
post #75

Earlier quoted context omitted.

What is laughable about it?

The displayed structure has nothing to do with how it really looks like [0]. It seems they just used a naive algorithm for automatic atom placement with a goal to minimize overlaps between the atoms. [0] https://en.wikipedia.org/wiki/Caffeine

That naive algorithm isn't even good since it can clearly be laid out without any edge crossings.

Re: Penrose – Create diagrams by typing notation in plain text

#93

A lot of replies here are missing the key idea behind Penrose: that the "substance" and "style" of any mathematical diagram are separable. For example, the "substance" of a diagram might be a collection of sets with known subset relationships: Set A, B, C IsSubset(B, A) IsSubset(C, A) That same substance can then be rendered in many different styles, e.g. as a Venn diagram or as a tree diagram (substance vs. style is…

This makes sense!

However, as I've commented on other software like this, why are none of the examples style-free Venn diagrams? That is, black on white 3 circle overlapping each other in pairs with a single shared triangle intersection at center? I apologize if one of these is already present. Style has little value there since it may obscure reality.

Re: Penrose – Create diagrams by typing notation in plain text

#94
post #68

Earlier quoted context omitted.

> substance vs. style is a lot like HTML vs. CSS Given the popularity of frameworks like TailwindCSS, it seems that people here don’t understand the advantage of separating HTML and CSS either, so I’m not sure if this analogy is helpful…

I think graphs are quite different from HTML. The "substance" in html is far too chaotic compared to the structured data for the graphs.

The substance in HTML is literally an annotated rooted tree (a subset of the complexity afforded by a graph).

Re: Penrose – Create diagrams by typing notation in plain text

#95
post #7

Related: CMU’s ‘Penrose’ Turns Complex Math Notations into Illustrative Diagrams (2020) - https://news.ycombinator.com/item?id=31632841 - June 2022 (1 comment) Penrose: From mathematical notation to beautiful diagrams - https://news.ycombinator.com/item?id=29674986 - Dec 2021 (21 comments) CMU’s ‘Penrose’ Turns Complex Math Notations into Illustrative Diagrams - https://news.ycombinator.com/item?id=23430282 - June 20…

Also our Penrose 3.0 release post from July 2023: https://news.ycombinator.com/item?id=36746047

Re: Penrose – Create diagrams by typing notation in plain text

#96
post #5

Penrose looks great. Beautiful diagrams and readable code. What are some other text-driven diagramming languages / tools? I know of: https://mermaid.js.org/ https://graphviz.org/ https://flowchart.fun/

Here's a page listing several more: https://text-to-diagram.com/

Re: Penrose – Create diagrams by typing notation in plain text

#98
post #96
post #5

Penrose looks great. Beautiful diagrams and readable code. What are some other text-driven diagramming languages / tools? I know of: https://mermaid.js.org/ https://graphviz.org/ https://flowchart.fun/

Here's a page listing several more: https://text-to-diagram.com/

This page was made by the company behind D2, so not exactly an unbiased source.

Re: Penrose – Create diagrams by typing notation in plain text

#99

A lot of replies here are missing the key idea behind Penrose: that the "substance" and "style" of any mathematical diagram are separable. For example, the "substance" of a diagram might be a collection of sets with known subset relationships: Set A, B, C IsSubset(B, A) IsSubset(C, A) That same substance can then be rendered in many different styles, e.g. as a Venn diagram or as a tree diagram (substance vs. style is…

Yeah, exactly! Also, possibly a third idea of Penrose is the way the selector matching blocks in the Style language can be used to construct the constrained optimization problem as you mention. This is inspired by CSS, but there are a lot of differences too.

With regard to the separation of substance and style, I think that idea can be profitably applied in other settings as well. For instance, Graphviz, tikz-cd, and Mermaid are all fairly declarative. But also, I feel like this idea could be even more profitably applied by building a diagramming library inside of a general-purpose programming language like Python.

For instance, take a look at the Substance code for our quaternion multiplication table example: https://penrose.cs.cmu.edu/try/?examples=group-theory/quater... It's about 83 lines of code. In contrast, by really taking the separation idea seriously, one can write a generic Python function for creating Cayley table diagrams, after which that particular example only takes about 5 lines of code: https://github.com/samestep/diagrams/blob/750f7a544635a6fd9f...

Re: Penrose – Create diagrams by typing notation in plain text

#100

I have always found "diagrams as code" tools to be limiting. There will be that scenario where the generated diagram is not what you expected. The flexibility you get by using code is outweighed by these limiting scenarios. I switched to Mermaid.js but ended up switching back to normal diagramming tools because of these limitations.

Same here. My problem is that I consider these diagrams to be low value documentation gimmick. They are nice but not really worth spending a lot of time on.

The promise of text driven diagrams is that you don't spend a lot of time on them. Which is nice. But of course then you run in a brick wall when it's not that nice to look at and you want to fix it and it turns out that there are a lot of things that you just can't do with them.

And of course the real problem is that if it's simple, it probably doesn't need a diagram at all (or it will just state the bleeding obvious). And if it's not simple, the diagram is probably going to be a PITA to get right no matter what tool you use. Especially if you are not sure what the diagram is going to be exactly. These tools are almost universally horrible for sketching stuff out quickly because you get sucked into doing a depth first let's specify everything and the kitchen sink mode. And then you get it wrong and it's a pain to change everything. My brain just works a couple of orders of magnitude faster than most of these tools and I get frustrated with just spending ages on the stuff I already understand (i.e. the stuff that I already know the design for) vs. the stuff I'm still unsure about (i.e. the hard to diagram stuff). As a design tool these are horrible tools. As a documentation tool they are mostly redundant.

I default to just skip diagramming it entirely. I don't enjoy it. I don't believe in it. I usually have better things to do. I find the output is write only: nobody ever looks at it or appreciates it beyond a "ah cool, we have stuff". I've found extremely few counter examples in my decades long career of diagrams that actually add value and are widely appreciated. It's mostly just endless nonsense of trivial amounts of boxes and arrows connected in mostly unsurprising and obvious ways.

If I need something quick and dirty, whiteboards are much nicer. And you can just take a photo and call it a day. And in my experience, nobody ever looks at those either. Those photos have very little value. You draw something on a whiteboard, you use it as a talking point, and then you wipe the whiteboard. Photo optional. Do it if it makes you feel good. You could spend a lot of time translating those into a pretty diagrams. But that sounds like the kind of monkey work that somebody should automate and that you shouldn't be spending time on.

Post reply on HN