Skip to content
Beskid Beskid

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Write and run a program

beskid run analyzes the source, compiles it ahead of time, links an executable with the matching runtime kit, and runs that executable in a subprocess.

Complete Install Beskid. Work in an empty directory where you can create a file.

  1. Create Main.bd with this source:
i32 Main() {
return 0;
}
  1. Analyze the source:

    Terminal window
    beskid analyze Main.bd --plain
  2. Check its canonical format:

    Terminal window
    beskid format Main.bd --check
  3. If the format check reports drift, update the file before the next check:

    Terminal window
    beskid format Main.bd --write
    beskid format Main.bd --check
  4. Execute the program through the AOT pipeline:

    Terminal window
    beskid run Main.bd --plain
  5. Check the process status with the command that your shell provides. A status of 0 is success.

flowchart LR
  accTitle: Source to AOT execution
  accDescr: The CLI resolves and analyzes Main.bd, lowers it, compiles and links a native executable with the runtime kit, and then starts it as a subprocess.
  A[Main.bd] --> B[Resolve and analyze]
  B --> C[Lower]
  C --> D[AOT compile]
  D --> E[Link runtime kit]
  E --> F[Run subprocess]
  1. The CLI resolves Main.bd and checks its syntax, names, and types.
  2. The compiler lowers the checked program and emits native object code.
  3. The linker uses the matching runtime kit to create an executable.
  4. The CLI starts the executable as a subprocess and returns its status.

Analysis completes without an error diagnostic. The format check exits successfully. The program prints no text and exits with status 0.

If analysis points to the function name, use the exact default entrypoint Main. If formatting fails, run the documented --write command. If linking reports a missing or incompatible runtime kit, reinstall the same toolchain release; do not combine compiler and runtime files from different releases.

Connect the editor and language server, then use build, run, and test for development work.