Axle v0.17.0
Package

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

TypeMethod and description
i64
now() : i64 Wall-clock milliseconds since the Unix epoch.
i64
nanoTime() : i64 Monotonic nanosecond counter; only deltas are meaningful.
string
osName() : string Host OS family — "Windows", "Linux", or "macOS".
string
osArch() : string CPU architecture — "x86_64", "aarch64", etc.
string
lineSeparator() : string Platform line ending — "\n" on Unix, "\r\n" on Windows.
string
fileSeparator() : string Platform path component separator — "/" on Unix, "\\" on Windows.
string
pathSeparator() : string Platform $PATH list separator — ":" on Unix, ";" on Windows.
void
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.
void
sleep(ms : i64) : void Pause for ms milliseconds. A task parks on a timer, so the other tasks
sharing its carrier keep running through the pause; main and a
Thread::run body sleep their thread. A pause of zero or less is a no-op.
string
osVersionRaw() : string The OS's own version string, or "" when it will not answer. The
seam, not the surface — osVersion is what source calls.
string
osVersion() : string 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.
void
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.
string
getProperty(key : string) : string Read an in-process property.
bool
hasProperty(key : string) : bool True iff key has been set via setProperty in this process.
void
setProperty(key : string, value : string) : void Set an in-process property (not inherited by child processes).

Method detail

#now

now() : i64

Wall-clock milliseconds since the Unix epoch.

#nanoTime

nanoTime() : i64

Monotonic nanosecond counter; only deltas are meaningful.

#osName

osName() : string

Host OS family — "Windows", "Linux", or "macOS".

#osArch

osArch() : string

CPU architecture — "x86_64", "aarch64", etc.

#lineSeparator

lineSeparator() : string

Platform line ending — "\n" on Unix, "\r\n" on Windows.

#fileSeparator

fileSeparator() : string

Platform path component separator — "/" on Unix, "\\" on Windows.

#pathSeparator

pathSeparator() : string

Platform $PATH list separator — ":" on Unix, ";" on Windows.

#exit

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.

Parameters
code exit status reported to the parent (0 = success).

#sleep

sleep(ms : i64) : void

Pause for ms milliseconds. A task parks on a timer, so the other tasks
sharing its carrier keep running through the pause; main and a
Thread::run body sleep their thread. A pause of zero or less is a no-op.

Parameters
ms duration to sleep, in milliseconds.

#osVersionRaw

osVersionRaw() : string

The OS's own version string, or "" when it will not answer. The
seam, not the surface — osVersion is what source calls.

#osVersion

osVersion() : string

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

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

getProperty(key : string) : string

Read an in-process property.

Parameters
key property name.
Returns the stored value, or "" if the key was never set.

#hasProperty

hasProperty(key : string) : bool

True iff key has been set via setProperty in this process.

Parameters
key property name to test in the in-process property map.

#setProperty

setProperty(key : string, value : string) : void

Set an in-process property (not inherited by child processes).

Parameters
key property name.
value value to store for the lifetime of this process.