4 ms·
I do love the co_await, co_..., saga because JS has the same issue, only worse because all JS on the web always starts as source code, at least when you're runn
by olliej 3y ago
I do love the co_await, co_..., saga because JS has the same issue, only worse because all JS on the web always starts as source code, at least when you're running shipped C++ it has already been compiled and hence language changes don't impact already shipped code.
For example when JSC first implemented support for `let` (apparently first or with the most effective testing?) we rapidly found site breakages. The first one I looked at was (IIRC) the Le Monde newspaper in France, which was doing some kind of parsing with a variable named `let` for the current letter. Rather than making the language more annoying to use, we updated the spec to allow let to be an identifier, which is perfectly reasonable as the let syntax is unambiguous. That's a tiny amount of complexity for the implementer to produce a much cleaner to use language for developers.
There's similar with `of` in for loops - `of` is syntactically only valid in that location, there's negligible implementation cost in not requiring it to be a keyword, but it allowed the improved iteration syntax to be introduced to the language (Obviously there are a bunch of more common syntaxes that are more consistent with other languages, but for imo stupid reasons I couldn't use any of them and had to come up with a new one :-/).