The shell is the language
Type an expression and get the answer, or write a whole program on the prompt. There is no separate scripting layer and no built-in calculator, because the compiler is the shell.
HolyC
One compiler is the shell, the scripting language and the application language. Pick an example.
"Hello, world!\n";A string on its own is a statement that prints. Top-level statements run as you type them, so the command line and the language are the same thing.
U0 Count(I64 n=3)
{
I64 i;
for (i=0;i<n;i++)
"Line %d\n",i;
}
Count;
Count(5);A call with no arguments needs no parentheses. Default values make short calls the norm.
class Pt
{
I64 x,y;
};
Pt p;
p.x=3; p.y=4;
"%d\n",p.x*p.x+p.y*p.y;A class is a struct. There is no inheritance machinery to learn before you can read the code.
U8 a=255; // unsigned 8 bit
I64 b=-1; // signed 64 bit
F64 c=2.5; // 64 bit float
U0 Nothing; // voidU8, I16, U32, I64, F64 and U0 say what they are. I64 is the default integer.
// a sketch of the Demo style
CDC *dc=DCAlias;
dc->color=RED;
GrCircle(dc,100,100,40);
DCDel(dc);Graphics is a library call, not a toolkit. Kosmos builds its windows, fonts and dock on this layer.
Snippets are short sketches of the style, not tested programs. The graphics one assumes the Demo-folder conventions.
What stands out when you come from C or C++.
Type an expression and get the answer, or write a whole program on the prompt. There is no separate scripting layer and no built-in calculator, because the compiler is the shell.
Code is compiled just in time, so there is no main function. A statement at the top of a file simply runs.
Include a file and it is compiled and loaded straight into the live namespace. One walkthrough reports compiling about 50,000 lines in under a second.
Names complete everywhere, including symbols, and you can jump to any definition from anywhere, the shell included.
Files, directories, documents and disassembly are hyperlinks. Disassemble a function, then click a symbol to land in its source.
Every class member can be enumerated with its name and offset, and given extra metadata such as defaults, ranges and format strings. C++ developers have wanted this for decades.
Animation is a loop that writes pixels. No window class, no message pump and no invalidate call.
No virtual memory to set up, no drivers to probe and no service manager. The walkthrough reports about half a second to boot, from an ISO of about 16 MB.
The shell, the editor, the documentation and the file browser share one hyperlink system, instead of four tools that barely talk to each other.
The trade-off: everything runs at the highest privilege level, so there is no safety net. A bad pointer or an uncaught exception takes the whole system down. That is why we run it in a VM and add protection around it; see Security and HC+.
Source: a C++ developer's walkthrough of TempleOS. We have not independently checked every figure in it.
TempleOS draws in the classic VGA palette. The desktop gets its greys and its softness from dithering and smoothing, not from more colours.
Click a colour. Its HolyC name is copied.
Build the image, run it in QEMU, and the desktop is there in a few seconds.