HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
camel-cdr
cauldron
C2021–2025
camel-cdr / cauldron

cauldron

A collection of single-file C libraries. (generic containers, random number generation, argument parsing and other functionalities)

2Distinct people
9Mentions
0Explicit recommenders
143GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A collection of single-file C libraries. (generic containers, random number generation, argument parsing and other functionalities)

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year9 dated mentions

Observed mentions: 2021-01-31 19:41:55 UTC to 2025-07-26 07:11:59 UTC.

0123452021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC110
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC514
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC000
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC303

What Hacker News says

9 sources
That page ends with "This is the first efficient algorithm for generating random uniform floating-point numbers that can access the entire range of floating point outputs with correct probabilities". I am very skeptical. The same basic idea is described here [1] (though without any pretty pictures, but with a link to working code), and I know others have implemented the same insight [2]. This seems like the kind of thing that is reinvented every time some who cares about random numbers learns how IEEE 754 works. [1] http://mumble.net/~campbell/2014/04/28/uniform-random-float [2] https://github.com/camel-cdr/cauldron/blob/a673553dd7925b0f1...
In Show HN: Fast Random Library for C++17
I've written an algorithm that generates a uniform random float in the range [a,b] that can produce every representable floating-point value with a probability proportional to the covered real number range*: https://github.com/camel-cdr/cauldron/blob/main/cauldron/ran... * Well, almost. I messed up the probability around subnormals slightly and haven't gotten around to fixing it yet. Still, the algorithm it self should works for all other values and it was measurably more accurate than the regular algorithm. In terms of performance it is 10x slower compared to the regular implementation of `(randu32(x)>>8)*(1.0f/(1<<24))` on my Zen1 desktop.
In Perfect Random Floating-Point Numbers
The holy grail of random float generation is a function that takes two bounds and can generate ALL representable floating point numbers within the given bounds with the proper distribution, here uniform (and does so efficiently). I've written such an implementation with explanations [0], but it doesn't handle subnormals correctly. I've yet to find the time to revisit the problem. [0] https://github.com/camel-cdr/cauldron/blob/main/cauldron/ran...
In Higher quality random floats
Yeah, the amount of times I've seen `rand() % range` and other non-uniform distributions is staggering. I've actually held a presentation on the topic, with a chapter on generating uniform floats [1] There I also describe a simplified algorithm for generating uniform floats where every representable floating point value can occur with the appropriate probability. I'm still not 100% sure that my implementation is correct, but I did all I could think of to test it [2] [1] https://youtube.com/watch?v=VHJUlRiRDCY&t=2774s [2] https://github.com/camel-cdr/cauldron/blob/main/cauldron/ran...
In A Brief History of Random Numbers
I found that instead of adding format specifiers, one can create a construct that uses occurrences of '\0' in strings to insert values: FMT_BEGIN("a + b = \0 + \0 = \0\n") { FMT(float, (a)); FMT(float, (b)); FMT(float, (a + b)); } FMT_END; FMT_BEGIN("x = \0 = 0x\0 = 0b\0\na = \0\nb = \0\n") { FMT(uint, (x)); FMT(uint_base, ((unsigned)x, 16, "0123456789abcdef")); FMT(uint_base, ((unsigned)x, 2, "01")); FMT(Vec3, (a)); FMT(Vec3, (b)); } FMT_END; The major advantage here is that you don't need to parse a dsl, and you can still have formatting options. A final api would probably use automatic compound literal struct arguments to implement default arguments with names parameters. Type detection should also be possible, although you would need to register all print functions in a global macro. This is just a p
Read the rest
In Let's implement buffered, formatted output

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.