std/sys
std/sys — runtime constants and primitives.
Hosts everything inherent to the runtime as opposed to the
running process (which lives in std/sys/process):
• clocks (now / nanoTime)
• OS / arch / line-separator info
• process exit / sleep
API shape: free functions, some auto-imported into every file's
prelude (exit, sleep, now, nanoTime), the rest reachable
via use std::sys::osName; and friends.
Free functions
| Type | Method and description |
|---|---|
| now() : i64 Wall-clock milliseconds since the Unix epoch. |
| nanoTime() : i64 Monotonic nanosecond counter; only deltas are meaningful. |
| osName() : string Host OS family — "Windows", "Linux", or "macOS". |
| osArch() : string CPU architecture — "x86_64", "aarch64", etc. |
| lineSeparator() : string Platform line ending — "\n" on Unix, "\r\n" on Windows. |
| fileSeparator() : string Platform path component separator — "/" on Unix, "\\" on Windows. |
| pathSeparator() : string Platform $PATH list separator — ":" on Unix, ";" on Windows. |
| exit(code : i32) : void Terminate the process immediately with status code.The runtime's own departure, bound straight to it: a compiled program already leaves through this symbol, and a second spelling of the same stop would be a second answer to what flushes and in what order. |
| sleep(ms : i64) : void Pause for ms milliseconds. A task parks on a timer, so the other taskssharing its carrier keep running through the pause; main and aThread::run body sleep their thread. A pause of zero or less is a no-op. |
| osVersionRaw() : string The OS's own version string, or "" when it will not answer. Theseam, not the surface — osVersion is what source calls. |
| osVersion() : string Best-effort host OS version string; format is host-dependent. Falls back to osName() when the platform declines to answer, so acaller always has something printable. |
| gc() : void No-op: Axle has no garbage collector. Heap-shared objects are refcounted and arena objects are freed when their scope ends, so there is no collection to ask for and nothing this could start. Kept so source ported from a collected language compiles rather than failing on an unknown identifier; it will gain meaning only if a generational collector ever lands. |
| getProperty(key : string) : string Read an in-process property. |
| hasProperty(key : string) : bool True iff key has been set via setProperty in this process. |
| setProperty(key : string, value : string) : void Set an in-process property (not inherited by child processes). |
Method detail
#now
Wall-clock milliseconds since the Unix epoch.
#nanoTime
Monotonic nanosecond counter; only deltas are meaningful.
#osName
Host OS family — "Windows", "Linux", or "macOS".
#osArch
CPU architecture — "x86_64", "aarch64", etc.
#lineSeparator
Platform line ending — "\n" on Unix, "\r\n" on Windows.
#fileSeparator
Platform path component separator — "/" on Unix, "\\" on Windows.
#pathSeparator
Platform $PATH list separator — ":" on Unix, ";" on Windows.
#exit
Terminate the process immediately with status code.
The runtime's own departure, bound straight to it: a compiled program
already leaves through this symbol, and a second spelling of the same
stop would be a second answer to what flushes and in what order.
code exit status reported to the parent (0 = success).#sleep
Pause for ms milliseconds. A task parks on a timer, so the other tasks
sharing its carrier keep running through the pause; main and aThread::run body sleep their thread. A pause of zero or less is a no-op.
ms duration to sleep, in milliseconds.#osVersionRaw
The OS's own version string, or "" when it will not answer. The
seam, not the surface — osVersion is what source calls.
#osVersion
Best-effort host OS version string; format is host-dependent.
Falls back to osName() when the platform declines to answer, so a
caller always has something printable.
#gc
No-op: Axle has no garbage collector. Heap-shared objects are
refcounted and arena objects are freed when their scope ends, so
there is no collection to ask for and nothing this could start.
Kept so source ported from a collected language compiles rather than
failing on an unknown identifier; it will gain meaning only if a
generational collector ever lands.
#getProperty
Read an in-process property.
key property name."" if the key was never set.#hasProperty
True iff key has been set via setProperty in this process.
key property name to test in the in-process property map.#setProperty
Set an in-process property (not inherited by child processes).
key property name.value value to store for the lifetime of this process.