by devinus · 13y ago · 0 comments
The Rust compiler is in many different 'dialects' of Rust, since it's been around for so long. Parts of it haven't been touched in a while.
We're working on a general style guide here: https://github.com/mozilla/rust/wiki/Note-style-guide
Better than that would be a goftm like tool, that applies the style guide.
People (including me) love that about Go. (I've actually never read a negative comment about it and many possitives).
It puts an end to all issues with formatting, really.
I don't know how reusable the parse is -- it would make something like this even easier.
You can't figure out what a pretty printer should pretty print until the style is figured out.
My C++ style is identical to the first Draft ANSI C++ book I read. I've carried that style to Java and even to C (I hated pre-ISO K&R though mine looks now nearly identical to 1TBS). Heck, even when playing with Go, I used that style (gofmt be damned).
Now if Rust looked more like Python...
Not really. Go solves this with gofmt.
You might insist on your own style (as you say) but for most people it's a command line away to format it in the standard way, and all GitHub projects etc will be gofmt'ed anyway.
It may not be a "critical technical challenge" but if you are writing a new language there is really no excuse to not cement things like that down before it is too late.
If you don't they'll find something fundamental to be dissatisfied with. E.g., the lack of full TCO or a Turing complete type system.