4 ms·
Initial Rust development set out to avoid symbol soup. With some switches in leadership, this was forgotten.
by selfmodruntime 2y ago
Initial Rust development set out to avoid symbol soup. With some switches in leadership, this was forgotten.
- johnisgood 2y agoThanks, this is interesting to know.
- steveklabnik 2y agoFwiw I don’t think your parent is lying but I also don’t feel it’s really accurate. If you read https://graydon2.dreamwidth.org/307291.html https://graydon2.dreamwidth.org/307291.html for example, there’s some references that imply this, but it’s not really that “less symbols” was a goal so much as it is a secondary effect of other choices. Graydon wanted a simpler language and that implies simpler syntax, not the other way around. Even the grammar bit isn't really about "symbol soup." Early Rust had other sorts of things that a lot of folks would consider readability problems unrelated to symbols too: no keyword was allowed to be over five characters, so return was ret, continue was cont, etc.
- selfmodruntime 2y agoIt‘s not a lie, it‘s a loose quote of Steve Klabnik when I asked him on Reddit
- steveklabnik 2y agoHa! Well maybe my opinion has changed over time. To be honest, I struggle to call Rust “symbol soup” now or then; other than lifetimes, which is just one symbol, I don’t think Rust is a particularly symbol heavy language, or at least, not much more than any other curly brace and semicolon language.
- johnisgood 2y agoWell, if you can have (and projects do have) >5 consecutive symbols, then it is symbol heavy. I am pretty sure I made this comment a long time ago with an example but paging on HN is dreadful and time-consuming. I will try to look for it. It was on GitHub. I came across it when I was interested in Rust and checked somewhat popular Rust codebases. Can you think of such cases?
- steveklabnik 2y agoI think it also depends on how you think of symbols; I see "::" as a single operator, not two symbols. Do () and <> count as individual symbols? I believe you do, given that you have an example upthread. If those are the case, well, I can construct something, but it's not something I've used directly. Four isn't unheard of if you're going by those rules, but five is a bit extra. You cited )?)?; a little while ago, I personally would write this code like the final example over here: https://news.ycombinator.com/item?id=43234284 https://news.ycombinator.com/item?id=43234284
- johnisgood 2y agoYes, I consider "::" as two symbols, also yeah I am against ")?)?" but I have seen "worse" in the wild. I think I will have to look for what I saw before we continue. I might not be able to reply to this comment, however.