Hacker Newsnew | past | comments | ask | show | jobs | submit | hardmath123's commentslogin

Here's another blog post on this theme! https://github.com/kach/art-deco/blob/main/art-deco.ipynb


Re: Low FPS webcam - here's an approach that attempts to analyze coin tossing data from the _sound_ rather than the _video_, since sound is typically recorded at a much higher sampling rate (high enough to "hear" the spinning of the coin). https://cs.stanford.edu/~kach/can-one-hear-the-fate-of-a-coi...


Relatedly: The Second Eigenvector of the Google Matrix

https://nlp.stanford.edu/pubs/secondeigenvalue.pdf


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 a lot like HTML vs. CSS). Importantly, Penrose's vision is that experts will author libraries of domains and styles, and end-users need only express the substance of their diagrams (i.e. the three lines of code above).

The second beautiful idea in Penrose is that diagram generation is expressed as a constrained optimization problem. This lets you easily experiment with layouts by writing constraints and sampling a variety of potential diagrams via stochastic search.

These two ideas set Penrose apart from most other diagram software out there. I really hope it gains wider adoption. Give it a try!


> 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…


Or that they understand it just fine, but don't think it has a particular advantage worth the extra complexity tradeoff.


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).


The comparison to CSS for separating style vs (semantic) data was also the first thing that came to mind for me.


> Importantly, Penrose's vision is that experts will author libraries of domains and styles, and end-users need only express the substance of their diagrams (i.e. the three lines of code above).

In that case, would it be a good idea to start the tutorial with some predefined domains and styles? Part of the intimidation factor here is not just the programming language, but also the abstraction one is faced with using and trying to understand before seeing their first picture. If the goal is to have predefined libraries, then why not start with pre-defined domains and styles and first teach people only how to do the substance, and leave domain & style definitions for advanced tutorials?

What are the advantages of making everything a constrained optimization problem? I like the idea that I can experiment with layouts sometimes, but I don’t really want a random diagram all the time. I realize it doesn’t have to be random, I have the choice to explicitly pin things down, but that takes extra work with Penrose, I’m asking why random is the default. Having done a lot of technical diagramming in papers and books, I would expect to almost always pin things down, and maybe once in a while free up a few elements to move around. Letting the whole thing go random is rarely if ever something I’d choose, especially near the end of making a more complicated diagram. What I’m wondering is whether this design is good for experts, and why, or if it mostly helps beginners.

I recently discovered GeoGebra, and would love to hear some compare & contrast notes. It doesn’t use constrained optimization, and it does separate style from substance as needed, but in a different way than Penrose. The important feature seems to be that it lets you define the relationships between elements of the diagram, so if you move a point, the line attached follows, and then parallel and perpendicular lines attached follow, and so on, everything in the diagram becomes responsive to adapt to the change while letting you put something right where you want it. This way I still get to experiment with layouts, but nothing in the construction needs to be random. Most of the style definitions are point & click GUI actions. Are there reasons that workflow is inferior to Penrose?


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...


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.


I think upset diagram would be even better. https://upset.app/


To say I'm speechless is a mild understatement.

Thanks so much for sharing upset given the context of my question!

Their explication of Venn diagrams is exemplary and compelling, particularly the banana and the way the Venn is elucidated and visualized through the accompanying meta-detail, for lack of a better phrase.

I cannot thank you enough. This will literally propel much of my work on data going forward.


I was inspired by this Rest of World post https://restofworld.org/2022/wordle-viral-turkish-japanese-t... to make a Hindi-language "Wordle" https://kach.github.io/shabdle/ just for fun. It was a little tricky figuring out how to adapt the game for Hindi's script, but I'm quite happy with my solution of using U+25CC ("dotted circle") to mark missing consonants.


Indeed, you can "learn" (by gradient descent) new parameters to this algorithm, to generate fractals in any target shape that you want! https://hardmath123.github.io/chaos-game-fractal-foliage.htm...


This reminds me of a small experiment I did with a friend, where we asked different people to independently write the HTML and CSS for a website (without communicating), and then put the HTML and CSS files together to see how well they worked. https://kach.github.io/generative-adversarial-web-developmen...


Taylor did a great job


He understood the assignment!


You might also like this little book, "Computational Cooking," which is also, in a way, a meditation on the language of recipes. http://diyhpl.us/~bryan/papers2/CompCook.html


Great book, thanks for sharing!


If you liked this, you might enjoy this little trick you can do with moiré patterns -- near the end of the post, I talk a little bit about the math behind the FFT connection. https://hardmath123.github.io/moire.html


Or for those who studied electrical engineering (or anyone one who took a Signal and System course):

https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampli...

https://matthews.sites.wfu.edu/misc/DigPhotog/alias/


I don't know about "practical," but you might enjoy this: https://github.com/kach/recreational-rosette


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: