Docs/Getting started

Getting started

Your first program

Create a file, declare a function and use the CLI development loop.

About 7 minVersion: 0.10.1

Create hello.orvi

OrviScript source files use the .orvi extension. Create hello.orvi and add the following program.

hello.orvi
1fn greet(name: string) -> string {2    return "Hello, " + name + "!"3}45let language = "OrviScript"6print(greet(language))

Read the program

  • fn declares a function.
  • Parameters and return values can have explicit types.
  • let creates a mutable binding. Use const for an immutable binding.
  • print accepts multiple values and writes one line to standard output.

Use the feedback loop

Run check in scripts and CI when you want validation without execution. fmt rewrites the file using the official formatter.

orviscript check hello.orvi
orviscript fmt hello.orvi
orviscript run hello.orvi