Some older languages had no keywords at all, in particular PL / 1 , where
IF IF=THEN THEN BEGIN; END;
was the legal part of the code, but completely unreadable. (Look also at the APL as an example of a write-based programming language that is completely cryptic to read a few months later even by the author of the original code).
The C and C ++ language family has a set of keywords defined by the language specification. But there are very widely used languages with billions of obsolete lines of source code. If you (or their standardization committee) add a new keyword, there is a chance of a collision with some existing program, and, you guessed it, while others answered, this is bad. Therefore, if a standard was added, for example, enum_class as a new keyword, most likely someone would already use it as an identifier, and this object would be unhappy (to change the code when adopting the new C ++ standard).
It is also known that C ++ is parsed slowly (in particular, since standard headers such as <vector> stretch tens of thousands of lines of source code, and because the modules are not yet in C ++ and because the syntax is very ambiguous), therefore the analyzer’s complexity for processing new syntax is not a big problem (C ++ parsing has always been terrible). For example, the GCC community is much more complicated with respect to new optimizations than for new C ++ features (apparently, the latest features of the C ++ standard library require more work than parsing the new syntax), even if switching from C ++ 03 to C ++ 11 was a huge leap and required a lot of work in the C ++ interface. This is less true for jumping from C ++ 11 to C ++ 14.
Some other languages (for example, some Lisp dialects, such as General Lisp and some Scheme , where you can override the let or if macro and macros in homoiconic languages like these, are very different, because they work on AST , from an unreasonable text replacement in C or C ++ ...) allow you to override existing keywords; read also about hygiene macros . But this can make it difficult to understand the source code a few months later.
Basile Starynkevitch Sep 24 '15 at 9:59 2015-09-24 09:59
source share