Hello World & Scaffolding

Create your first Prady source file, compile it, and run it locally.

Now that you have the Prady compiler installed, let’s create and run your first program.

Creating a Source File

Prady source files use the .pr extension. Create a new directory and a file named main.pr:

mkdir my-prady-app
cd my-prady-app
touch main.pr

Open main.pr in your editor and add the following code:

// main.pr
fn main() {
    print("Hello, Prady v1.0.0!");

    let languages = ["Prady", "Rust", "TypeScript", "C++"];
    print("Welcome to modern systems development with: " + languages.join(", "));
}

Running the Code

To compile and execute the program immediately in development mode, use prady run:

prady run main.pr

Output:

Hello, Prady v1.0.0!
Welcome to modern systems development with: Prady, Rust, TypeScript, C++

Building a Standalone Native Binary

When you are ready to produce an optimized, standalone binary executable, run prady build:

prady build main.pr -o my-app

The Prady compiler passes the parsed AST through its optimization pipeline and invokes the LLVM code generator to produce native machine code (my-app.exe on Windows, or my-app on macOS/Linux).

You can run this binary directly on any matching machine with zero external dependencies:

./my-app

Checking Code Without Executing

If you want to run the compiler’s current parse and project checks without executing the program, use prady check:

prady check main.pr

If the implemented checks pass, the command exits with code 0. The current compiler does not provide complete static type checking.

Next Step: The Handbook

Continue reading The Basics in the Handbook to learn about variable declarations, mutability, primitive types, and scoping rules.