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
BT.VERSION BT.info() BT.env('PATH') BT.has('process')
API List
| API | Description |
|---|---|
| BT constant | Read VERSION, NAME, OS, ARCH, FAMILY, DEBUG, EXE_EXT, LIB_EXT, POINTER_WIDTH, THREADS. |
| BT.info | Returns the current runtime information snapshot. |
| BT.env | Read valid environment variables. |
| BT.set_env | Write to the BT runtime environment variable overlay. |
| BT.remove_env | Remove runtime environment variables and obscure OS environment variables with the same name. |
| BT.has_env | Determine whether the current valid environment variable exists. |
| BT.envs | Returns the merged effective environment variable object. |
| BT.path_entries | Returns the list of currently valid PATH entries. |
| BT.add_path | Append or prepend a path to a valid PATH. |
| BT.remove_path | Remove path from valid PATH. |
| BT.has_path | Determine whether the valid PATH contains a path. |
| BT.system | Returns lightweight system fields. |
| BT.runtime | Return the runtime uptime, threads, start_time. |
| BT.stats | Returns I/O, task, timer, net, FFI and cache resource statistics. |
| BT.has | Determine whether the current interpreter has a built-in capability. |
| BT.features | Returns the current interpreter capability table. |
| BT.runtime_id | Returns the current BT process running instance ID. |
Examples
info = BT.info() // Output: 1.1.0 print info.version
Notes
- BT is a global static object and does not require construction.
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.