Enough philosophy, let's talk code, let's talk Hello world!

hello.c2

module hello_world;

import stdio as io;

fn i32 main(i32 argc, char** argv) {
    io.printf("Hello World!\n");
    return 0;
}

Spot the six differences from C: Scroll down for the answer

.

.

.

.

.

.

.

.

Here it is:

  1. module keyword, see modules
  2. import replaced #include, see Import
  3. fn keyword precedes all functions
  4. i32 instead of int. In C2 you always specify the size
  5. char** argv instead of char* argv[]. Types are continuous and arrays are not allowed as argument
  6. io.printf, symbols are inside modules.