2 ms·
I'm a really big fan of Rust, but I have to challenge this, GP was clearly talking about the complexity of the language itself, and that one is high. Extra fea
by whytevuhuni 4mo ago
I'm a really big fan of Rust, but I have to challenge this, GP was clearly talking about the complexity of the language itself, and that one is high.
Extra features and extra static checking add complexity. Extra complexity in the language can make simple programs harder, and they make complex programs easier to code and maintain, like you said.
However, nobody will ever be able to make a Rust equivalent of TinyCC, the language's rules are insanely complex, especially for things like GATs and the other tricky concepts it's trying to tackle.
- hurril 4mo agoUnless you or him define what you mean by complexity, we are not going to be able to come to an agreement there. This line of reasoning, it seems to me, is making the case that C is more complex than Assembly because the former has a number of formalizing, let's say, concepts that are not in assembly. I would on the contrary say that adding extra static checking deducts from the _actual_ complexity of the domain and its application.
- uecker 4mo agoBy complexity I mean roughly the number of language rules / techniques / idioms a programmer has to understand and keep in their head to be able to program effectively. I would say this is far lower in C than in Rust. I do not see how the additional hoops Rust makes you jump through makes it easier to achieve a goal, but I see how it can help prevent certain errors (but not many others). It also seems obvious that the problematic aspect of getting anything done in Rust is fully compensated by having a lot of libraries available quickly via Cargo, so people are essentially just assembling things at a high-level. And in principle, I think this is a very good thing, but in the way this is implemented it comes with severe supply chain risks.
- hurril 4mo agoI guess that depends on what goals you have in mind. If they are producing a correct program, then having the compiler verify your assumptions, forcing you do deal with domain complexity upfront is one way to do that. Tests( driven development) is another one. But in this context I feel that partial solutions are offered as alternatives to more complete ones. I.e.: if holes in your trousers is of no concern, then having tools to avoid that is of no value. Not picking on C here, as already mentioned, it is a wonderful language.
- uecker 4mo agoIn my experience is it also possible to avoid most holes in the trousers easily with C as well and not just by testing. For example, it is also often possible to build safe abstractions by designing an API around an incomplete type etc.
- hurril 3mo agoC is turing complete so of course. You can do anything with C but that is not the issue we are discussing here.