← All projects
Project record1 mention
Originally shared on Hacker News

TXR Lisp

This project is TXR Lisp, a FOSS programming language. Recent work adds a 32-bit shift register to the random state so random/rand calls with small moduli draw only the needed bits from the PRNG in batches of 2, 4, 8 or 16 instead of a full 32-bit word, extends the glob* function's brace expansion with numeric and string range expansion (multi-character ranges like {AA..ZZ}, leading-zero preservation as in {000..999}, and step sizes, going beyond bash's support), and adds the same step-size capability to range iteration.

Last shared
01 / The problem

What it addresses

Random/rand functions with small moduli wasted entropy by still drawing a full 32-bit word from the PRNG; the extended glob* lacked numeric/string range expansion beyond the POSIX C library's brace expansion.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. TXR Lisp

    This project is TXR Lisp, a FOSS programming language. Recent work adds a 32-bit shift register to the random state so random/rand calls with small moduli draw only the needed bits from the PRNG in batches of 2, 4, 8 or 16 instead of a full 32-bit word, extends the glob* function's brace expansion with numeric and string range expansion (multi-character ranges like {AA..ZZ}, leading-zero preservation as in {000..999}, and step sizes, going beyond bash's support), and adds the same step-size capability to range iteration.

    Problem: Random/rand functions with small moduli wasted entropy by still drawing a full 32-bit word from the PRNG; the extended glob* lacked numeric/string range expansion beyond the POSIX C library's brace expansion.

    Posted by @kazinator · Original source ↗

    Source text · @kazinator · · Source ↗

    On the FOSS front, I've been doing some minor things in TXR Lisp land.