Skip to content

Source File

Paul T edited this page May 23, 2017 · 1 revision

Every CTalk source file must have the file extension of .ct if has a chance of being imported. That have been said, by convention, even the ones that will never be imported should follow the same file extension.

Here is an example of a Hello, world! program

import std::io;

function main:int argc:int, argv:[[char]]
    std::io::println str:"Hello, world!";
    return 0;
end;

Assuming the file was saved as hello.ct, to compile the file:

CTalk hello.ct main:argc:argv > hello.c
gcc hello.c -o hello

Due to the way CTalk mangles its names, it is necessary to provide the full name of the main function.

Note: The GNU C Compiler should be used to compile the result as it includes some gcc specific things.

Clone this wiki locally