Skip to content

Nihil v4.19.0

Choose a tag to compare

@github-actions github-actions released this 29 Nov 03:34
· 4 commits to main since this release
814471c

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) and ln(x) (within 2 ulp)
    on FLOAT, with nan, inf and 0 handled; and on INT isqrt(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. mulmod and
    powmod never 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 ln and Montgomery code, and its first
      version of ln lost 10 ulp just below 1; numbers belong in the standard library, written and checked once
  • 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 listings list() 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

Install

curl -fsSL https://nihil-lang.dev/install.sh | sh

Linux 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.