larzqueue
A FIFO queue, named so intent reads clearly.
Built on a plain list - enqueue/dequeue/peek/is_empty/size, the classic FIFO vocabulary. dequeue() is O(n) (a real list shift via slicing), which is fine for the small, script-sized queues this language is meant for - not a ring-buffer for a million-item hot loop.
larzscript pkg install queue
What you get
- The classic FIFO vocabulary - enqueue/dequeue/peek
- Honest about the tradeoff: O(n) dequeue, script-sized by design
- Throws a clear error on empty-queue dequeue/peek
- Built on a plain list - easy to inspect
Try it
import "queue" as queue let q = queue.new() queue.enqueue(q, 1); queue.enqueue(q, 2); queue.enqueue(q, 3) print(queue.dequeue(q)) print(queue.peek(q)) print(queue.is_empty(q)) print(queue.size(q))
Output
1 2 false 2
Why it's in the Larz Stack
larzqueue is a real Larzscript package (larzscript pkg install queue) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.