nupp.system
nupp.system reports four fixed ABI facts and estimates available parallelism. It retains the facts and selected query when the module loads.
const system = nupp.system
print(system.platform) -- macos
print(system.architecture) -- aarch64
print(system.endianness) -- little
print(system.pointerBits) -- 64
print(system.availableParallelism()) -- 10Under emulation these describe the ABI actually executing, not the one being emulated, which is the pair generated code was built against. A browser reports the guest instruction set, while its endianness and pointer width remain little and 32.
Submodules
| Module | Description |
|---|---|
nupp.system.spi | Implementation interface for environment facts. |
Module contents
Values
| Value | Kind | Description |
|---|---|---|
architecture | variable | The instruction set, by its canonical name. |
availableParallelism | variable | Estimates how many execution units this process may actually use. |
endianness | variable | Byte order: little everywhere Nupp runs today, or big. |
platform | variable | The operating system, lowercase. |
pointerBits | variable | Pointer width for the executing ABI, either 32 or 64. |
Values#
architecturevariable#
const architectureThe instruction set, by its canonical name.
Names include aarch64, x86_64, x86, and wasm32. This is what is executing, so an x86_64 binary under Rosetta returns x86_64.
availableParallelismvariable#
const availableParallelismEstimates how many execution units this process may actually use.
At least 1. Native hosts include operating-system restrictions in the estimate, while browser hosts use the value their browser exposes. It opens no worker pool, so it is a fair default for the limit one is opened with.
endiannessvariable#
const endiannessByte order: little everywhere Nupp runs today, or big.
platformvariable#
const platformThe operating system, lowercase.
macos, linux, windows, bsd, or browser. An unrecognized host returns its own name lowercased rather than a placeholder, so a new platform reads as itself.
pointerBitsvariable#
const pointerBitsPointer width for the executing ABI, either 32 or 64.
The browser ABI is 32-bit even when its guest instruction set is not wasm32.