Repository navigation
Nihil v4.19.0
A new library and a fix for macOS. std:math.nihil brings sqrt and ln on FLOAT, and isqrt, mulmod,
powmod and is_prime on INT. On a Mac, path.list() gave an empty list after about 250 listings (each one left a
file descriptor open), and the IDE then showed every project empty.
-
std:math.nihil, numbers the library did not have:sqrt(x)(correctly rounded) andln(x)(within 2 ulp)
on FLOAT, with nan, inf and 0 handled; and on INTisqrt(n),mulmod(a, b, n),powmod(b, e, n)and
is_prime(n), a deterministic Miller-Rabin with the first 12 prime bases, exact for every INT.mulmodand
powmodnever overflow: past 2^31.5 they build the 128-bit product from 32-bit halves (Montgomery
multiplication for odd moduli, doubling otherwise). Checked against Python on 318,000 square roots (all equal),
1,000 logarithms and 18,000 integer cases;tests/stage1/std_math- Why: a study of prime numbers written in Nihil carried its own
lnand Montgomery code, and its first
version oflnlost 10 ulp just below 1; numbers belong in the standard library, written and checked once
- Why: a study of prime numbers written in Nihil carried its own
-
macOS:
path.list()no longer runs out of file descriptors. The runtime reads a directory through a DIR opened
on a copy of its descriptor, and closing it closed only the copy: after about 250 listingslist()gave an empty
list, and the IDE showed every project empty after a few minutes of use. The table of directories being read also
grows from 256 descriptors to 4096 (Linux reads directories with its own call and never had it)- Why: a long-running program that lists directories (the IDE's server polls the project's files) stopped seeing
any file
- Why: a long-running program that lists directories (the IDE's server polls the project's files) stopped seeing
Install
curl -fsSL https://nihil-lang.dev/install.sh | shLinux on x86_64 and on ARM64 (with binutils), and macOS on Apple silicon (with the Xcode Command Line Tools).
Each package has a build provenance attestation: gh attestation verify nihil-linux-x86_64.tar.gz --repo nihillang/nihil.