Hello World in AngelScript

Our first program will print the classic “hello world” message. Here’s the full source code.

void main()
{
	print("hello world\n");
}

To run the program, save the code in a .as file and use an AngelScript host application to execute it.

$ as_run hello-world.as
hello world

Sometimes we’ll want to compile our scripts into bytecode for faster execution. In AngelScript, you would typically integrate the script compiler into a host application.

Once compiled, you can run the bytecode like so:

$ as_run bytecode-file
hello world

Now that we can run and compile basic AngelScript programs, let’s learn more about the language.