BT runtime information

BT runtime information

BT runtime information

Function

BT is a global read-only static object used to read the current interpreter version, platform, runtime snapshots, environment variable overlays, PATH entries and built-in capabilities tables.

Syntax

API List

APIDescription
BT constant Read VERSION, NAME, OS, ARCH, FAMILY, DEBUG, EXE_EXT, LIB_EXT, POINTER_WIDTH, THREADS.
BT.infoReturns the current runtime information snapshot.
BT.envRead valid environment variables.
BT.set_envWrite to the BT runtime environment variable overlay.
BT.remove_envRemove runtime environment variables and obscure OS environment variables with the same name.
BT.has_envDetermine whether the current valid environment variable exists.
BT.envsReturns the merged effective environment variable object.
BT.path_entriesReturns the list of currently valid PATH entries.
BT.add_pathAppend or prepend a path to a valid PATH.
BT.remove_pathRemove path from valid PATH.
BT.has_pathDetermine whether the valid PATH contains a path.
BT.systemReturns lightweight system fields.
BT.runtimeReturn the runtime uptime, threads, start_time.
BT.statsReturns I/O, task, timer, net, FFI and cache resource statistics.
BT.hasDetermine whether the current interpreter has a built-in capability.
BT.featuresReturns the current interpreter capability table.
BT.runtime_idReturns the current BT process running instance ID.

Examples

Notes

  • BT is a global static object and does not require construction.
- BT attributes are read-only and cannot overwrite BT itself, nor can attributes like BT.VERSION be written to.

- Runtime information is read on demand; BT.info() uses cached snapshots.

  • BT.stats() only reads the runtime resource status when called and does not add statistical overhead to ordinary expression execution.