API Reference › Os › Os.platform
method

Os.platform

Os.platform() -> string

The host platform as a short id: "macos", "linux", or the raw uname system name on other Unixes. Derived from the operating-system name, which is portable across every Unix host. Non-deterministic host input — read it to branch on platform, not inside the simulation.

Example

program Platform {
  entry {
    if Os.platform() == "macos" { print(1) } else { print(0) }
  }
}
← All symbols