The Scala of C

Documents

These PDF documents collectively form the specification of Gamma, detailing what must be made available to programmers. Keep in mind that they were written on extremely short notice, and thus gaps, repetitions and even contradictions may be present.

SubjectDescriptionLast change
LanguageDescribes the core language.Corrected scope for reference definition in linkage.
DeclarationsDescribes the equivalent of the standard library in other languages.Alpha release.
BenchmarksPrescribes how to assess performance of Gamma code.Alpha release.

Background

Even though I came up with the language as described in these documents only in November of 2019, the concepts in this language had been rolling around in my mind for the past year or so.

The reason why I decided to work at C's level, instead of at a higher level or at the level of assembly, is because I feel that C occupies a niche that simply won't go away. The simple fact is that Linux is written in C; Windows is written in C at the core; Redox even has to offer a C standard library implementation; C++ still keeps backwards compatibility; Python, PHP, Java and other dynamic languages use implementations written in C; and even IoT is often done in C. The message is clear: C may not behave like a portable assembler, but it sure as hell is used like one.

The problem is, it has dangers which are not relevant to its applications. Operator precedence was chosen for backwards compatibility with B; null-terminated strings came from the personal experience of Dennis Ritchie and Ken Thompson; integer conversions and promotions only made sense back in the 80s; the increment and decrement operators only really promote unreadability while introducing moronic possbilities for undefined behavior; and the lexer hack doesn't make me think that the language is easy to parse. Then again, C got to where it is because of Unix and Linux, and we all know how Unix and Linux got to where they are.

This language may remind people of Ada - and indeed, I will not deny I have taken a look at it. That said, while the specification here should be at least usable, it shouldn't be considered complete; I am not ruling out adding (or perhaps removing) features in the future, but I will not do so without taking a wide look at all of the prior art in the industry.

Summary

To put it briefly, the points I took (almost) wholesale from C were:

while the points which I took the liberty of extending were: the points which I took the liberty of modifying were: and the points which I took the liberty of eliminating were:

Discussion

Meet me in #gamma on Libera for any questions (9:00-23:00 UTC+1); you will need to be registered to join.