← Back to Docs

Project Structure

VDX programs are simple — each .vdx file contains one or more class declarations. There is no special project layout required.

Minimal project

my-project/
  main.vdx

Run it with:

vdx main.vdx

File extension

All VDX source files use the .vdx extension. The VDX interpreter only accepts .vdx files.

Entry point

VDX does not have a main() function. Instead, code inside a class body runs top-to-bottom when the file is executed. Functions are registered first, then statements run in order.

class App {
    // Functions are registered first (pass 1)
    fn sayHi() {
        print("hi");
    }

    // Then statements run in order (pass 2)
    sayHi();
    print("done");
}

Comments

Line comments start with //. There are no block comments yet.

// This is a comment
print("hello"); // inline comment