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.
Subject | Description | Last change |
---|---|---|
Language | Describes the core language. | Corrected scope for reference definition in linkage. |
Declarations | Describes the equivalent of the standard library in other languages. | Alpha release. |
Benchmarks | Prescribes how to assess performance of Gamma code. | Alpha release. |
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.
To put it briefly, the points I took (almost) wholesale from C were:
#arr
actually returns the length of the array), obviating the need for things like strlen
;n1
,n2
,n4
,n8
and so on for unsigned types, and d1
,d2
,d4
and so on for floating-point types, where the number refers to the size of the type - this allows still supporting non-standard arches and byte sizes with considerably less byzantine type names);(a & b) == c
infelicity;float
to int
is an attempt at ignoring rounding), so there's no real loss here;*((float *)&i)
, are undefined behavior (due to differing alignments) even in C, and that pointer conversion is better handled by unions, so there's arguably no loss here;strtok
doesn't disturb you, then I guess this won't make much sense :-)