Hello, World!
English

Hello, World!

Now that you have a compiler, let’s make it do something visible.

Create a file named hello.scpp:

import std;

int main() {
    std::println("Hello, world!");
    return 0;
}

If you installed scpp onto your PATH in the previous section, build it like this:

scpp hello.scpp
./a.out

If you are still working directly from the repository checkout, use ./build/scpp hello.scpp instead.

Output:

Hello, world!

std::println comes from scpp’s standard library and prints one complete line of text.

There are already a few important ideas hiding in this tiny program:

In the next section, we will keep the program just as small, but place it in a real manifest-based project.


← Previous: Building the Compiler · Table of Contents · Next: Hello, Project Builds →