Lynxer

Documentation

sys

Runtime, process and platform information.

Backend: native — stdlib/sys.so, built from stdlib/sys.cpp. Import: import("sys") → global.sys.*

FunctionSignatureNotes
platform() -> strHost operating system: linux, darwin, freebsd, netbsd, openbsd, dragonfly or win32; otherwise unknown
architecture() -> strCanonical syscall architecture of this build: amd64 or arm64; "" otherwise. Pass with platform() to syscalls(...)
cpuCount() -> intOnline processors (0 when unknown)
pageSize() -> intMemory page size in bytes (0 when unknown)
memoryTotal() -> intTotal physical memory in bytes (0 when unavailable)
memoryAvailable() -> intAvailable physical memory in bytes (0 when unavailable)
uptime() -> intSeconds since boot (0 when unavailable)
bootTime() -> intBoot time as a Unix timestamp (0 when unavailable)
loadAverage() -> strJSON array [1m, 5m, 15m]; [] when unavailable
version() -> strLynxer version, e.g. Lynxer 0.1.8.4
versionInfo() -> strJSON {major, minor, micro, patch, releaselevel, serial}
implementation() -> strLynxer
apiVersion() -> str0.1
isFrozen() -> boolAlways false
getpid() -> intProcess id
getMaxSize() -> intMaximum value of size_t
getByteOrder() -> strlittle or big
getDefaultEncoding() -> strutf-8
getFilesystemEncoding() -> strutf-8
isatty() -> boolWhether stdout is a terminal
stdinName / stdoutName() -> str<stdin> / <stdout>
executable() -> strPath of the running executable, or "" when the host does not expose it
prefix / execPrefix() -> strDirectory containing the executable, or "" when unavailable
argv() -> strThe program's command line as a JSON array
argCount() -> intNumber of program command-line entries
getArg(int index) -> strEntry at index, or ""
exit(int code)Exits immediately with code
exitOk / exitError()Exits with 0 / 1

Because Lynxer has no Python runtime, version() reports the Lynxer version and there is no sys.path, sys.modules or recursion-limit surface. argv describes the program's own command line: entry 0 is the script path (lynxer prog.lynx a b → ["prog.lynx", "a", "b"]), or the executable itself for a compiled program, followed by the arguments passed after it.

CPU/page-size/load-average queries use POSIX facilities; physical memory and boot-time values use the host's system-information interfaces on Linux and the supported BSD/macOS targets. Any unavailable host value uses the sentinel in the table rather than fabricating a result.

Example

global setup(){ import("sys"); }

global main(){
    println(global.sys.platform());
    println(global.sys.architecture());
    println(global.sys.version());
    println(global.sys.argCount());
}

See also