3 ms·
> (Everyone else should probably skip Pascal and take a look at Modula-2 and Oberon.) I did check out Oberon-07 because of its minimalism but i really couldn't
by badsectoracula 3y ago
> (Everyone else should probably skip Pascal and take a look at Modula-2 and Oberon.)
I did check out Oberon-07 because of its minimalism but i really couldn't get over the SHOUTY keywords :-P.
(Wirth used uppercase for Pascal's keywords too but unlike Oberon, Pascal is not case sensitive - my pet theory is that Oberon is case sensitive as a reaction to Pascal programmers not using shouty capitalization :-P)
- Rochus 3y agoYes, forcing uppercase keywords is rather unfortunate; have a look at https://oberon-lang.github.io/ https://oberon-lang.github.io/
- kazinator 3y agoFor a "Loberon" dialect!
- kazinator 3y agos/For/Fork/
- augustk 3y agoI think the main reason for keywords being uppercased in Oberon (which is case sensitive) is to free up the space for user-defined identifiers. As long as the programmer sticks to lowercase and mixed case identifiers, new keywords and predefined procedures can be introduced in the language without invalidating old programs.
- kazinator 3y agoWirth could have figured out a better way to do this, or asked around. You can have a way for a program to declare the version of the language it wants. Then keywords introduced in all newer versions of the language disappear (are treated as ordinary identifiers). Via a mechanism like Racket's #lang, Component Pascal could support Oberon-2, Oberon, Modula and even Pascal translation units in the same program. It does seem as if Wirth operated with serious academic blinders on. He had no concept of treating the language as a product, which supports existing users with dogged backward compatibility. The result was a fragmented landscape of languages, which helped eroded the popularity of the languages. The C preprocessor has been much maligned, and usually rightfully so, but with the preprocessor, I can take C code that uses C++ keywords like class and new, and make it work. We can easily write a macro convert(type, expr) which will expand to static_cast<type>(expr) when the code is compiled as C++, and to (type) (expr) when compiled as C. C itself has been able to bring in new keywords like bool, true and false without breaking old programs which use these, by requiring programs to include a <stdbool.h> header from which you get things like #define bool _Bool. Speaking of C++, most C programs can be easily converted to C++, often with little or no modification. Or at least that used to be true for a long time back in an era when it was important to be able to do that.