O Language/Advanced
From OnixOS
Advanced Topics
Use this section after Getting Started. It covers the runtime model and language features used in larger programs.
Modules
Move reusable definitions into .olm modules and load them by path. The complete loading order and project loader conventions are described in Modules and Loading.
Runtime control
O Language can start external processes, work with environment values, and coordinate asynchronous work. The reference details are in Runtime and Concurrency.
Sockets
Message-oriented socket communication is available through the sock, sock_listen, and sock_send APIs. Use it when an HTTP request/response model is not appropriate.
sock socket "tcp4" "9050" "0.0.0.0"
def messages = {"ping": "pong"}
sock_listen(socket, messages)
See System APIs for the full socket and process reference.
