The Programming Language of God?
Recently I came across something which was unlike anything I had seen before. I was surfing on YouTube and I saw a video by Linus on TempleOS.
TempleOS, formerly known as J Operating System, SparrowOS and LoseThos is written by the late Terry A. Davis. It is a bible themed OS built to be the third temple prophesied in the Bible. Davis said that he built the OS after a revelation from God. It is a rendition of the Commodore 64 Operating System, an 8-bit computer system from the 1980’s. TempleOS however has a resolution of 640x480 VGA with 16 colours with a single audio voice. According to Davis, these specifications were in line with what he was instructed by God.
Building an Operating System alone is a big feat in itself. What amazed me more was that the kernel, compiler as well as the native language, all was created by Davis himself! So I took a look at the native programming language he created, HolyC. HolyC incorporates some features of C as well as C++, meaning it does have classes. Some interesting features are :
- There is no main() function. Any code outside of functions gets executed upon start-up, in order.
- Built-in types include I0,I8,I16,I32,I64 for signed 0-8 byte ints and U0,U8,U16,U32,U64 for unsigned 0-8 byte ints and F64 for 8 byte floats. (There is no F32 Float)
- Function with no args, or just default args can be called without parentheses.
- Type casting is postfix. To typecast int or F64, use ToI64(), ToBool() or ToF64().
- Variable arg count functions (...) can access their args with built-in variables similar to 'this' in C++. They are 'I64 argc' and 'I64 argv[]'. (This is similar to command line arguments)
- Allows "5<i<j+1<20" instead of "5<i && i<j+1 && j+1<20".
- Allows ranges like "case 4...7:" in switch stmts.
- The "`" operator raises a base to a power.
- There is no question-colon operator.
- No #define functions or typedef exists.
- There is no type checking.
- There is no continue stmt. Use goto.
- Only one base class is allowed.
- All values are extended to 64-bit when accessed. Intermediate calculations are done with 64-bit values.
I found it to be really intriguing. Davis’ life and work was somewhat controversial owing to his frequent use of racial and homophobic slurs. He was suffering from schizophrenia and he used to think that his critics were from the CIA trying to manipulate him. Aside from his personal problems, we can clearly see that he was an excellent programmer. He died in 2018 and this article can be considered as my tribute to his work.
Note : The source of this information is mainly the documentation of TempleOS as well as some public forums. You can find TempleOS at https://templeos.org/ and the documentation at https://web.archive.org/web/20170305045050/https://www.templeos.org/Wb/Doc/
Student of Science and Engineering
2 年I've never seen ANYTHING like this before... Temple OS https://www.youtube.com/watch?v=LtlyeDAJR7A