Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Rust Discovery, Or: How I Figure Things Out (carol-nichols.com)
173 points by steveklabnik on May 11, 2015 | hide | past | favorite | 15 comments


Nice find with the grammar mismatch! Thanks for showing your methods in depth. I also liked the intro bit about knowing how to delve into a system. Seems like hoisting the entire Rust compiler distribution into one brain would be uncomfortable; there's so much going on in there.

Tangentially, digital archaeology is fascinating. I want to see some kind of VR "Git Simulator 201X" for exploring history in 3D. Maybe render commits projected spatially by date and be able to zoom into the diffs? If it could pull down all the PR comments from GitHub and then annotate the graph/blames... well, it might be useful, or might be more distracting than productive. Maybe a project for some rainy winter...


Thanks! There's more grammar and reference work to be done, hint hint to anyone reading this and looking for something to do on Rust ;)

I'd love to be able to follow a chunk of code around visually, wherever it gets moved, play back the commits touching it... not sure how it'd work exactly, but I think you're onto something there :)


Dead comment by user bombless. Reposting so Carol gets to see the comment (since she asked specifically for additional ways to find information) in case she doesn't have show dead on.

>About the ‵mod′ keyword in ‵use′, if you ask it on IRC I'm sure many people including me would point you the relevant PR that was made around October. Nice article by the way.


Thank you, both of you! :)


This post is really great. Often when trying out a new ecosystem the longest part of the learning process isn't learning the language or tools themselves, but learning a process that works best for the language. This gives a lot of insight about how you approach Rust and the other tools in your toolbox.


Thank you! <3


Thanks so much for working on the grammar docs! This is much needed and very helpful, considering how quickly Rust's grammar has been evolving.


You're welcome! <3


Great write-up! (And great work).

A little surprised there's no mention of looking at the implementation (src/grammar/parswr-larl.y, eg line 308) -- perhaps in the next installment?


Yeah, I was going to get into the implementation when I was going to figure out what `path` should be, which was also when I decided the post was getting too long ;)

Note that src/grammar/parser-lalr.y is a reference grammar for testing [1] and the actual implementation is in src/libsyntax, afaik.

[1] - https://github.com/rust-lang/rust/pull/21452


So, there's three "official" grammars for Rust? The one in the documentation, the reference grammar (that serves as documentation and testing) - and the actual grammar, used in the reference implementation? No wonder there are inconsistencies...

Sounds like paring it down to two: a reference/testing grammar that is well documented; perhaps written/maintained with a literate programming tool and the actual implementation is a good idea. Kill off the "only documentation" grammar and/or merge it with the larl-one.


I was also wondering why not autogenerating a "documentation" grammar out of the working code.


There were only three temporarily: today, the reference grammar is all gone, subsumed into the documentation/testing grammar.


What is this stream of consciousness?


Welcome to my brain. Please use a coaster.




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

Search: