O Language/Advanced/Runtime

From OnixOS
Revision as of 07:31, 25 August 2026 by Tedaryum (talk | contribs) (Protected "O Language/Advanced/Runtime" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Modules and Loading

Modules use the .olm extension. A module can define functions and values that become available to the program that loads it.

load "helpers.olm"

The path is resolved from the current project directory. Keep shared definitions in modules instead of repeating them in every entry point.

Web project loading

Web projects use one central loader:

load "lib/loader.olm"

boot.ola loads lib/loader.olm. The loader loads controllers, models, connections, libraries, and finally config/config.ola. Controllers must be loaded before the route configuration because route responses refer to handler functions.

When the web CLI creates or adds a project component, it updates the loader automatically. This keeps the boot process in one place.