News for hackers. Stuff that matters.
Re:Ask HN: What's your favorite illustration in Computer Sci... by adrianmonk on Wednesday January 11, 2023 @04:49PM (#34345438)
I like railroad diagrams for language grammars. So much easier than just looking at production rules.

https://en.wikipedia.org/wiki/Syntax_diagram

They're used at https://json.org/, for example.

Re:Ask HN: What's your favorite illustration in Computer Sci... by salgernon on Wednesday January 11, 2023 @05:23PM (#34345890)
The Apple Pascal poster has a very 70s vibe: https://www.whatisepic.it/wp-content/uploads/2022/05/apple_p...
Re:Ask HN: What's your favorite illustration in Computer Sci... by bagels on Wednesday January 11, 2023 @05:38PM (#34346074)
It's not very useful as a technical reference. The text is so de-emphasized in comparison to the graph, it's impossible to read.
Re:Ask HN: What's your favorite illustration in Computer Sci... by thristian on Wednesday January 11, 2023 @08:04PM (#34347647)
> Instead of learning how Raskin’s color scheme worked, Jobs hired an artist, San Francisco’s Tom Kamifuji, who was a hot, up-and-coming artist in the late 70’s / early 80’s. Jobs gave him free reign to make it more artistic, though Jobs failed to explain that the original color scheme was important for using the chart easily.

— https://vintagecomputer.ca/the-history-of-apples-pascal-synt...

Re:Ask HN: What's your favorite illustration in Computer Sci... by gpderetta on Wednesday January 11, 2023 @06:43PM (#34346756)
Ah they are called railroad diagrams, it makes sense. I first saw the in sqlite documentation [1]. Thanks for giving them a name!

[1] https://www.sqlite.org/lang_select.html

Re:Ask HN: What's your favorite illustration in Computer Sci... by markandrewj on Thursday January 12, 2023 @02:17AM (#34350239)
Another place that uses this style of diagram is the original JSON spec.

https://www.json.org/json-en.html

Re:Ask HN: What's your favorite illustration in Computer Sci... by pamelafox on Wednesday January 11, 2023 @06:45PM (#34346786)
I also love railroad diagrams! I taught them briefly as part of CS61A at Berkeley last year, when we were learning BNF/Scheme/Interpreters.

https://inst.eecs.berkeley.edu/~cs61a/sp21/assets/slides/33-...

They're used in the SQLite docs as well, where I think they're really well suited.

Re:Ask HN: What's your favorite illustration in Computer Sci... by andrewl on Wednesday January 11, 2023 @09:23PM (#34348325)
Agreed. I find the SQLite diagrams very helpful. They are generated with Pikchr, which itself was created by the SQLite developers I believe:

https://pikchr.org/home/doc/trunk/doc/sqlitesyntax.md

Re:Ask HN: What's your favorite illustration in Computer Sci... by Sophistifunk on Wednesday January 11, 2023 @09:07PM (#34348162)
I would like to see a lot more of them in the world, as interactive tools as well as simply diagrams. I think they would make a great basis for a UI to design multi-step async processes where things can fail at any point and you want to handle different failures differently.
Re:Ask HN: What's your favorite illustration in Computer Sci... by jackgolding on Wednesday January 11, 2023 @09:11PM (#34348205)
Love these for finite state machines - one of my favourite topics at uni.
Re:Ask HN: What's your favorite illustration in Computer Sci... by banana_giraffe on Thursday January 12, 2023 @12:13AM (#34349476)
SQLite also uses them on the website.

Bit of a discussion on how they're created here: https://wiki.tcl-lang.org/page/Generating+Syntax+Diagrams+Us...

Re:Ask HN: What's your favorite illustration in Computer Sci... by unsafecast on Thursday January 12, 2023 @03:06AM (#34350559)
Re:Ask HN: What's your favorite illustration in Computer Sci... by hienchu on Thursday January 12, 2023 @03:29AM (#34350708)
It's my favorite, too!
Re:Ask HN: What's your favorite illustration in Computer Sci... by Hirrolot on Thursday January 12, 2023 @05:16AM (#34351506)
It's strange that most of the times, they just confuse me more. I'd prefer just looking at the BNF grammar...
Re:Ask HN: What's your favorite illustration in Computer Sci... by asicsp on Thursday January 12, 2023 @05:53AM (#34351777)
railroad diagrams for regular expressions: https://www.debuggex.com
Re:Ask HN: What's your favorite illustration in Computer Sci... by JustSomeNobody on Thursday January 12, 2023 @08:35AM (#34353250)
Yes, I love these!
Re:Ask HN: What's your favorite illustration in Computer Sci... by tempodox on Thursday January 12, 2023 @01:00PM (#34357766)
There is a generator for railroad diagrams on GitHub:

https://github.com/GuntherRademacher/rr

Re:Ask HN: What's your favorite illustration in Computer Sci... by michaelcampbell on Friday January 13, 2023 @07:47AM (#34366972)
I learned Pascal with these, which seemed to be all the rage in the 80's, or for Pascal, or the intersection of them.

SQLITE uses them now as well: https://www.sqlite.org/lang_aggfunc.html