Introduction to Guardian

Guardian is a compiled, statically typed language designed for parallel computing with the Guard synchronization model.

If you have used another imperative, class-based language, such as Java or C++, you will find many aspects of Guardian familiar. To begin, let's look at some of the characteristics of Guardian which are not terribly unique:

Next, let's look at the fundamental principles of Guardian:

Hello World

Here is the obligatory Hello World program in Guardian:

namespace hi;

import gu4::Out;

value class Hello {
    entry fn main() -> void {
        Out::println("Hello, world!");
    }
}

Let's pick that apart.

But what about the value keyword? This denotes the type's sharing policy, which is a part of Guardian's model for safe concurrency. For now, all you need to know is that a value class is one that has either immutable state or no state at all (as in this case), and therefore can be freely shared between threads.

To continue, let's embark on the tour.