Site Menu Project Specification Implementation Recommendations Reference Needs Updating Work in Progress Wastebasket Wiki Manual |
FAQWhy revive a long-forgotten 30-year old programming language?In short, it seemed more promising to modify a thirty year old notation and modernise it than to try to fix a contemporary one. The goal was a notation that adheres to engineering principles, contemporary notations mostly don't. Over the last thirty years, the world of information technology has become a very dangerous place. By exploiting vulnerabilities, determined attackers can walk right into our computers and devices to sabotage them or steal data at will and with impunity. Over the same period software has become overly complex, heavy and unreliable. All this is a result of a change in the mindset of software practitioners and their development tools. The prevailing mindset, programming languages and associated tools have been proliferating security and reliability issues for many years. Thirty years ago, the prevailing mindset was firmly rooted in engineering principles and best practises. The motto was "An engineer measures twice and cuts once". This is in stark contrast to today's mottos "because we can, it's cool" and "ship early, fix later". Back then not everything that was possible to do was also considered worth doing. Safeguards took centre stage. Ada and Modula-2 represent this mindset like no others. Unlike Modula-2 though, Ada does not follow Einsteinian simplicity principles and it has not managed to influence the prevailing mindset. Modula-2 once educated an entire generation in best practises. Somebody had to bring it back. We adopted this as our mission. Who gave you permission to use the Modula-2 name?Professor Wirth has given us permission to use the Modula-2 name for a modernisation of the language. Is the revision backwards compatible with the classic language?No. The language has been out of favour for so long that backwards compatibility was not a design goal. There are a number of changes that render legacy sources in classic Modula-2 incompatible with the revised language. For the migration of legacy code we intend to provide a source-to-source translator. Wasn't there an ISO Modula-2 after Wirth's classic version? Why didn't you start out with that?We participated in and learned from the ISO standardisation but preferred to start out with the simpler design defined by Wirth. We carefully considered each feature in view of our own design principles and only adopted those that passed our rigid scrutiny. From ISO Modula-2 we adopted the If safety and readability is of concern, why not use Ada?Ada is a very large language. It has a very steep learning curve and developers are hard to find. Building an Ada compiler and verifying its correctness is an immense undertaking. The only available free compiler is the GNU Ada Translator (GNAT). When software is compiled with GNAT it becomes GPL encumbered. Commercial Ada compilers are rare and very expensive. Pricing is not publicly available. Within the context of our project's goals and design principles, the top five shortcomings of Ada are (1) user defined ADTs are not first-class, (2) overall too large and too complex, (3) too many features with rare use cases, (4) too heavy on synonym syntax, that is different ways to express what is essentially the same construct, (5) language report is too heavy on Ada specific terminology which makes it very difficult to comprehend. If you need to do systems programming, why not use C/C++?C and C++ are inherently unsafe and they are not literate. Their widespread use for system software is a major root cause for most of the world's information security problems. These languages do not solve but proliferate security issues. To reach a future in which information systems are safe, their use must eventually be abandoned altogether. Within the context of our project's goals and design principles, the top five shortcomings of C are (1) user defined ADTs are not first-class, (2) very poor type safety, (3) very poor readability, (4) no separation of casting and conversion, (5) type promotion. Within the context of our project's goals and design principles, the top five shortcomings of C++ are (1) overall too large and too complex, (2) too many features with rare use cases, (3) poor type safety, (4) very poor readability, (5) type promotion. If you like simplicity in a language, why not use Oberon?The approach Professor Wirth has taken with Oberon is best described as custom dialect development on a per project basis, leaving out everything that is not strictly required by the project for which the dialect is custom made. This approach leads to very lean language designs but it also leads to language balkanisation and is not suitable for large industrial projects where software reuse and interfacing to existing technologies is important. Within the context of our project's goals and design principles, the top five shortcomings of Oberon are (1) user defined ADTs are not first-class, (2) no separation of interface and implementation, (3) absence of enumeration types, (4) absence of structured literals, (5) poor readability of number literals. What's up with those UPPERCASE words? Why didn't you change that?Modula-2 is a descendant of Algol. When Algol was specified there was no standard yet for character encoding. All the designers could do was to define how Algol source code would be presented in print while leaving the encoding implementation dependent. The Algol-60 report presented reserved words in lowercase boldface underlined and predefined names in lowercase boldface italic. This established a de-facto standard for the publication of algorithms that is still in use today, albeit minus the underlining. Since there was no standard way to represent boldface and italic on computer hardware at the time, Algol implementations used a technique called stropping to tag reserved words and predefined names. Some implementations used leading or trailing apostrophes, some used national currency symbols. When both uppercase and lowercase character sets became widely available, Wirth used uppercase in his Algol-W language as a form of stropping. Modula-2 follows this approach. The benefit of uppercase stropping is two-fold. It makes reserved words and predefined names stand out even in the absence of any formatting and colouring and thereby contributes to readability of source code. Further, it allows the addition of new reserved words and predefined names when the language undergoes a revision without concern for name collision with existing legacy code. By contrast, in C, language revisions have added reserved words and predefined names with leading and trailing lowline characters. However, the recommended presentation for Modula-2 remains that of the Algol-60 report, minus the underlining. To that end we have contributed a multi-dialect rendering plug-in for Modula-2 to the Pygments source code rendering framework. Our plug-in supports an Algol rendering mode by which reserved words are rendered in lowercase boldface and predefined names in lowercase boldface italic. We intend to provide similar plug-ins to other frameworks and for various source code editors. In Oberon, Wirth removed type CARDINAL. Why didn't you follow that?We have taken Professor Wirth's dislike of unsigned types into consideration but found that their removal would come at the expense of both readability and utility. Consequently we could not justify their removal. There are two important use cases which we believe deserve language support. Many operating system and library APIs pass unsigned types back and forth. When interfacing with these APIs from Modula-2 it is necessary to pass and receive unsigned types. Furthermore, when implementing filesystems and databases, an unsigned type is required to represent the index of addressable content cells. To express all addresses in a linear fashion an unsigned type or a larger signed type is required. Alternatively, if the negative values of an unsigned type are to be used, the address space is no longer linear. If Modula-2 had no unsigned type, and used a signed type of the same size instead, the replacement type would then need to be interpreted with unsigned semantics which would diminish clarity and provide opportunity for error. To read a file of a file system that uses an address space of the bit-width of the largest integer, the file's index would need to be incremented for the first half of the address space and then counter-intuitively decremented for the second half. This is ugly, confusing and not worthy of a literate programming language. In Oberon, Wirth removed enumerations. Why didn't you follow that?Enumerations provide type safety. A language with true enumeration types guarantees that no invalid values can be used for a variable or parameter of an enumeration type. In a language without enumeration types, or with fake enumeration types (such as C) programmers must manually check that values are not out of range but very few actually do so. This is a very important area of safety that should never be compromised. Professor Wirth stated the potential of name collisions when importing an enumeration type as a reason for removal. In our revision we require that enumerated values are qualified with the type identifier, thereby solving the problem of potential name collisions on import in a different way. In Oberon, Wirth introduced type promotion. Why didn't you follow that?When we asked Professor Wirth about his experience with type promotion, or type inclusion as it is called in Oberon terminology, he responded "Type inclusion turned out to have been an incredibly bad idea. I have removed it in my latest revision of Oberon."!!! We have been using C for too long not to know just how bad this feature really is. In general terms, implicit magic is almost always a bad thing because it can lead to misinterpretation and subsequent introduction of errors. Type promotion is one such implicit magic. In our revision we require explicit type conversion. This is so central to our design that we added a dedicated type conversion operator. You are using C-like number literals. Why the change?As a general rule, prefixed literals are both easier to read and less effort to parse than suffixed literals. In addition, the B and C suffixes used by classic Modula-2 were also legal base-16 digits, making such literals particularly confusing and very hard to parse when applying a one-character lookahead. The prefix based literal notation popularised by C is far better readable, especially when using a lowercase prefix. It is also far less effort to parse, in particular when applying a one-character lookahead. You replaced variant records with extensible records. Why the change?First and foremost, variant record types are fragile. It is not possible to anticipate all future variants. If and when a new variant needs to be added later, the change will break all client libraries using the type, even if the client libraries are not making any use of the newly added variant. In the world of OOP this is known as the fragile base class problem. Secondly, most implementations of variant records superimpose variant fields to save memory usage. Without a safeguard that only allows retrieval of that variant which has actually been stored, but not any other variant, such an implementation is not type safe. Of all the languages that provide variant record types, Ada is probably the only one that employs such a safeguard and it is quite complex. In Oberon, Professor Wirth introduced extensible record types as an alternative to variant record types. Wirth's solution solves both issues in an elegant fashion and with simplicity. Naturally, we adopted this superior approach. You replaced the
|