4 ms·
I like railroad diagrams for language grammars. So much easier than just looking at production rules. https://en.wikipedia.org/wiki/Syntax_diagram https://en.w
by adrianmonk 4y ago
I like railroad diagrams for language grammars. So much easier than just looking at production rules.
https://en.wikipedia.org/wiki/Syntax_diagram https://en.wikipedia.org/wiki/Syntax_diagram
They're used at https://json.org/ https://json.org/, for example.
- salgernon 4y agoThe Apple Pascal poster has a very 70s vibe: https://www.whatisepic.it/wp-content/uploads/2022/05/apple_pascal_syntax.jpg https://www.whatisepic.it/wp-content/uploads/2022/05/apple_p...
- bagels 4y agoIt's not very useful as a technical reference. The text is so de-emphasized in comparison to the graph, it's impossible to read.
- thristian 4y ago> 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-syntax-poster-1979-80/ https://vintagecomputer.ca/the-history-of-apples-pascal-synt...
- gpderetta 4y agoAh 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 https://www.sqlite.org/lang_select.html
- markandrewj 4y agoAnother place that uses this style of diagram is the original JSON spec. https://www.json.org/json-en.html https://www.json.org/json-en.html
- pamelafox 4y agoI 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-Review_Regular_Expressions_+_BNF.html#/14 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.
- andrewl 4y agoAgreed. 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 https://pikchr.org/home/doc/trunk/doc/sqlitesyntax.md
- Sophistifunk 4y agoI 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.
- jackgolding 4y agoLove these for finite state machines - one of my favourite topics at uni.
- banana_giraffe 4y agoSQLite 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+Using+Tk https://wiki.tcl-lang.org/page/Generating+Syntax+Diagrams+Us...
- unsafecast 4y agoAlso at http://om-language.org http://om-language.org
- hienchu 4y agoIt's my favorite, too!
- Hirrolot 4y agoIt's strange that most of the times, they just confuse me more. I'd prefer just looking at the BNF grammar...
- asicsp 4y agorailroad diagrams for regular expressions: https://www.debuggex.com https://www.debuggex.com
- JustSomeNobody 4y agoYes, I love these!
- tempodox 4y agoThere is a generator for railroad diagrams on GitHub: https://github.com/GuntherRademacher/rr https://github.com/GuntherRademacher/rr
- michaelcampbell 4y agoI 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 https://www.sqlite.org/lang_aggfunc.html