4 ms·
It seems every new C-like has Rust's expressive if/else and implicit returns. And why not? They're strict improvements on the syntax. Makes me wonder why they d
by _bxg1 7y ago
It seems every new C-like has Rust's expressive if/else and implicit returns. And why not? They're strict improvements on the syntax. Makes me wonder why they didn't become prevalent many years ago.
- hybrids 7y agoBoth of these things were invented by Lisp. The reason C didn't include them was because C and its ancestors was designed to be easy to write a parser for (well, "relatively" anyway, it's not exactly as barebones as sexps) and to be usable with a preprocessor macro system, so you end up with a language designed with a lot of syntactic cruft (braces, semicolons, ternaries, etc.) meant as aids to compiler authors.
- lifthrasiir 7y ago> you end up with a language designed with a lot of syntactic cruft (braces, semicolons, ternaries, etc.) meant as aids to compiler authors. Many of those are not just for the easiness of implementation but also for the quality of partial parsing, frequently required for today's compilers. I do agree that they are not intentionally designed in that way.
- _bxg1 7y agoYes yes, Lisp invented everything, I know. I was talking about the fact that (to the best of my knowledge) Rust introduced them to the C-like syntax world.