frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

BusyBeaver(6) Is Quite Large

https://scottaaronson.blog/?p=8972
89•bdr•2h ago•52 comments

MCP: An (Accidentally) Universal Plugin System

https://worksonmymachine.substack.com/p/mcp-an-accidentally-universal-plugin
306•Stwerner•4h ago•136 comments

Addictions Are Being Engineered

https://masonyarbrough.substack.com/p/engineered-addictions
152•echollama•4h ago•70 comments

We ran a Unix-like OS Xv6 on our home-built CPU with a home-built C compiler

https://fuel.edby.coffee/posts/how-we-ported-xv6-os-to-a-home-built-cpu-with-a-home-built-c-compiler/
166•AlexeyBrin•6h ago•13 comments

BYU study: Why some people choose not to use artificial intelligence

https://news.byu.edu/intellect/byu-study-finds-the-real-reasons-why-some-people-choose-not-to-use-artificial-intelligence
15•computator•1h ago•7 comments

Is being bilingual good for your brain?

https://www.economist.com/science-and-technology/2025/06/27/is-being-bilingual-good-for-your-brain
27•Anon84•2h ago•18 comments

2025 ARRL Field Day

https://www.arrl.org/field-day
4•rookderby•12m ago•1 comments

Unheard works by Erik Satie to premiere 100 years after his death

https://www.theguardian.com/music/2025/jun/26/unheard-works-by-erik-satie-to-premiere-100-years-after-his-death
147•gripewater•8h ago•31 comments

Show HN: A Go service that exposes a FIFO message queue in RAM

https://github.com/raiyanyahya/zapq
11•RaiyanYahya•3d ago•2 comments

Use Plain Text Email

https://useplaintext.email/
13•cyrc•1h ago•3 comments

Sirius: A GPU-native SQL engine

https://github.com/sirius-db/sirius
35•qianli_cs•4h ago•3 comments

Parsing JSON in Forty Lines of Awk

https://akr.am/blog/posts/parsing-json-in-forty-lines-of-awk
46•thefilmore•3h ago•9 comments

Show HN: I'm an airline pilot – I built interactive graphs/globes of my flights

https://jameshard.ing/pilot
1381•jamesharding•1d ago•183 comments

No One Is in Charge at the US Copyright Office

https://www.wired.com/story/us-copyright-office-chaos-doge/
51•rntn•1h ago•11 comments

Lossless LLM 3x Throughput Increase by LMCache

https://github.com/LMCache/LMCache
114•lihanc111•4d ago•32 comments

Engineer creates ad block for the real world with augmented reality glasses

https://www.tomshardware.com/maker-stem/engineer-creates-ad-block-for-the-real-world-with-augmented-reality-glasses-no-more-products-or-branding-in-your-everyday-life
177•LorenDB•6d ago•113 comments

Why the moon shimmers with shiny glass beads

https://phys.org/news/2025-06-moon-shimmers-shiny-glass-beads.html
6•PaulHoule•3d ago•1 comments

Verifiably Correct Lifting of Position-Independent x86-64 Binaries (2024)

https://dl.acm.org/doi/10.1145/3658644.3690244
13•etiams•3d ago•2 comments

Lago (Open-Source Usage Based Billing) is hiring for ten roles

https://www.ycombinator.com/companies/lago/jobs
1•AnhTho_FR•7h ago

ZeQLplus: Terminal SQLite Database Browser

https://github.com/ZetloStudio/ZeQLplus
29•amadeuspagel•6h ago•7 comments

History of Cycling Maps

https://cyclemaps.blogspot.com/
67•altilunium•9h ago•8 comments

US Justice Department settles antitrust case for HPE's $14B takeover of Juniper

https://www.reuters.com/business/us-doj-settles-antitrust-case-hpes-14-billion-takeover-juniper-2025-06-28/
14•awat•1h ago•1 comments

LLMs Bring New Nature of Abstraction

https://martinfowler.com/articles/2025-nature-abstraction.html
25•hasheddan•3d ago•27 comments

JWST reveals its first direct image discovery of an exoplanet

https://www.smithsonianmag.com/smart-news/james-webb-space-telescope-reveals-its-first-direct-image-discovery-of-an-exoplanet-180986886/
311•divbzero•1d ago•134 comments

Boeing uses potatoes to test wi-fi (2012)

https://www.bbc.com/news/technology-20813441
12•m-hodges•1h ago•5 comments

After successfully entering Earth's atmosphere, a European spacecraft is lost

https://arstechnica.com/space/2025/06/a-european-spacecraft-company-flies-its-vehicle-then-loses-it-after-reentry/
40•rbanffy•3d ago•14 comments

Republican governors oppose 10-year moratorium on state AI laws in GOP tax bill

https://www.politico.com/live-updates/2025/06/27/congress/gop-govs-urge-thune-to-nix-ai-moratorium-00430083
47•MilnerRoute•2h ago•23 comments

C++ Seeding Surprises (2015)

https://www.pcg-random.org/posts/cpp-seeding-surprises.html
23•vsbuffalo•3d ago•18 comments

I deleted my second brain

https://www.joanwestenberg.com/p/i-deleted-my-second-brain
458•MrVandemar•13h ago•291 comments

Reinforcement learning, explained with a minimum of math and jargon

https://www.understandingai.org/p/reinforcement-learning-explained
172•JnBrymn•4d ago•12 comments
Open in hackernews

C++ Seeding Surprises (2015)

https://www.pcg-random.org/posts/cpp-seeding-surprises.html
23•vsbuffalo•3d ago

Comments

rramadass•4h ago
Relevant: A old Reddit discussion by the same author - https://old.reddit.com/r/cpp/comments/32u4m7/the_behavior_of...
nynx•4h ago
Is it possible to initialize a prng in C++’s std correctly?
on_the_train•3h ago
No one uses the <random> header as it's cursed and the usual cult of backwards compatibility ensures it'll stay that way.

There are several high quality alternatives that people use.

thechao•3h ago
I've found it easier to write my own PRNG than to use the std. Using the std PRNG is about as buggy as my implementation, so the trade-off is reasonable. I usually need non-cryptographically strong PRNGs, so xorshift128+ is sufficient.
nynx•3h ago
How did it get into the standard then?
loeg•3h ago
It was better than the bad, C interface LCG rand(), I guess. (There are LCG parameters that make for ~objectively better PRNGs than MT, but rand()'s parameters aren't great and its state is too small.)
rramadass•2h ago
You need to understand PRNGs to answer that question. It is complicated and nothing to do with C++ language itself.

Here is cppreference on PRNGs (note the various engines available) - https://www.cppreference.com/w/cpp/numeric/random.html You have to "know" how to combine the various options available to get an optimal sequence.

The Mersenne Twister (MT) was one of the best engines and was the default in many other languages/packages too. See "Applications" section in wikipedia - https://en.wikipedia.org/wiki/Mersenne_Twister

The author identified distribution problems with the 32-bit versions of MT (i am not sure whether similar problems exist with its 64-bit versions) and proposed a different one named "Permuted Congruential Generator (PCG)" which has now been adopted as the default by many of the languages/packages - https://en.wikipedia.org/wiki/Permuted_congruential_generato...

As you can now appreciate, the subject is mathematically complicated and the defaults chosen by the language/package implementer becomes the "most commonly used" and hence reference case. While this is good enough for most "normal" applications if you are doing any special simulations (Monte Carlo or otherwise) and/or specific Numerical Computations it is your responsibility to understand what it is that you need and program accordingly using the various options (if available) or roll your own.

o11c•1h ago
> (i am not sure whether similar problems exist with its 64-bit versions) and proposed a different one named "Permuted Congruential Generator (PCG)"

The 64-bit version might be a bit faster (for certain workloads, on 64-bit hardware) than the 32-bit version, but still wastes the same space and has the same mathematical flaws.

PCG is still not perfect (128-bit math hurts, though the new DXSM variant at least reduces that to 128x64), but its mathematical properties are nicer than the xor* family (its main competitor), and both families are miles ahead of any other RNG out there.

rramadass•26m ago
It is understanding the non-trivial statistical properties (even at a simple conceptual level) that is of paramount importance. PRNG is one of the most difficult subjects in Numerical Computation and has nothing whatever to do with any language/package/library etc.

From https://en.wikipedia.org/wiki/Pseudorandom_number_generator

Even today, caution is sometimes required, as illustrated by the following warning in the International Encyclopedia of Statistical Science (2010).

The list of widely used generators that should be discarded is much longer [than the list of good generators]. Do not trust blindly the software vendors. Check the default RNG of your favorite software and be ready to replace it if needed. This last recommendation has been made over and over again over the past 40 years. Perhaps amazingly, it remains as relevant today as it was 40 years ago.

loeg•3h ago
Sadly, people that don't know better use std::mt19937 all the time :-(.
on_the_train•3h ago
And the only reason is its cool name. Humans are weird
loeg•3h ago
Well, it's in std. So there's an appeal to authority (the C++ language authors should be smart, right?) and convenience.
on_the_train•2h ago
There are still others in <random>. Yet they always use the cool twister one with the funny numbers
slavik81•24m ago
What alternative within <random> would you recommend and why?
slavik81•25m ago
I used it because it was recommended by Stephan T. Lavavej, maintainer of Visual Studio's C++ Standard Library, in his "rand() Considered Harmful" talk, back when <random> was introduced. See 11m30s. https://youtu.be/LDPMpc-ENqY?t=10m50s
loeg•3h ago
If you're aware/concerned about seeding, you probably aren't using the C++ std prng (mt19937) anyway -- other prngs have desirable properties like vastly smaller state, better performance, or cryptographic security.
cjfd•3h ago
This talks about 'bad' seeding quite a lot. But it really depends on what you need what is bad and what is good. Sometimes you need to have a reproducible program so you need to write the random number generator yourself and/or otherwise fix the algorithm. Then you can use '5' as the seed. This is quite often good enough for simulations. Sometimes you want to create cryptographic randomness. Then you need to somewhere find some seed of true randomness that is not guessable. In a computer game where the level needs some random elements just seeding the random number generator with the current time might be fine. And so on.
b0a04gl•3h ago
found one more flakiness over cross platform, when seed mt19937 same way on linux and windows, same compiler, same code... but problem is std::random_device or libc internals differ under the hood. some platforms do random_device as true hardware entropy, others fake it or seed from diff system sources. so seed retrieved isn't stable cross platform. that means mt19937 starts from diff states, causing different random sequences

it's not a bug in mt19937 itself, it's how random_device (or libc randomness) works differently across environments. makes cross platform tests flaky even when logic is rock solid

>>

std::random_device rd; // might differ per platform

std::mt19937 gen(rd()); // seed depends on rd output

std::uniform_int_distribution<> dist(1, 100);

int random_number = dist(gen); // different on linux vs windows tho same code