O Language

Project files

Know which O Language files hold source code, modules, package metadata, process settings and compiled output.

O Language pagesProject files
On this page

O Language projects use a few file conventions. The runtime does not require the source-file extension to parse a file, but the tools and project examples use these names.

File Purpose
.ola O Language source, commonly an application entry point.
.olm Loadable source module, commonly used for reusable definitions.
.olp JSON project or library manifest. The default filename is library.olp.
.ops INI-style process definition. The web scaffold uses proc.ops.
.obc Bytecode files are recognized by their header by the top-level runner. The current CLI does not expose a command that writes bytecode to an .obc file.

The extension names alone do not determine what a command can do. For example, olang install reads dependency information from an .olp manifest; it does not build the project’s main field or run its watch configuration. See project manifests and dependencies for the fields implemented by this runtime.

A small source project

sample/
  main.ola
  lib/
    helpers.olm
  library.olp

Load a module using its path:

load "lib/helpers.olm"

The path is resolved from the directory where olang is running, not automatically from the directory containing main.ola. Keep that in mind when launching the same program from a different working directory.

Web project files

The web CLI creates a larger convention-based layout, including boot.ola, lib/loader.olm, config/config.ola, controllers/, models/, connections/, templates/ and public/. The Web Framework guide explains how the CLI uses them.

Next