frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Postgres LISTEN/NOTIFY does not scale

https://www.recall.ai/blog/postgres-listen-notify-does-not-scale
289•davidgu•3d ago•109 comments

Show HN: Pangolin – Open source alternative to Cloudflare Tunnels

https://github.com/fosrl/pangolin
23•miloschwartz•4h ago•3 comments

Show HN: Open source alternative to Perplexity Comet

https://www.browseros.com/
154•felarof•8h ago•52 comments

What is Realtalk’s relationship to AI? (2024)

https://dynamicland.org/2024/FAQ/#What_is_Realtalks_relationship_to_AI
231•prathyvsh•10h ago•78 comments

FOKS: Federated Open Key Service

https://foks.pub/
175•ubj•13h ago•42 comments

Batch Mode in the Gemini API: Process More for Less

https://developers.googleblog.com/en/scale-your-ai-workloads-batch-mode-gemini-api/
20•xnx•3d ago•4 comments

Graphical Linear Algebra

https://graphicallinearalgebra.net/
179•hyperbrainer•10h ago•12 comments

Turkey bans Grok over Erdoğan insults

https://www.politico.eu/article/turkey-ban-elon-musk-grok-recep-tayyip-erdogan-insult/
82•geox•2h ago•56 comments

Flix – A powerful effect-oriented programming language

https://flix.dev/
216•freilanzer•12h ago•88 comments

Measuring the impact of AI on experienced open-source developer productivity

https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/
514•dheerajvs•9h ago•326 comments

Red Hat Technical Writing Style Guide

https://stylepedia.net/style/
159•jumpocelot•11h ago•71 comments

Yamlfmt: An extensible command line tool or library to format YAML files

https://github.com/google/yamlfmt
24•zdw•3d ago•12 comments

Belkin ending support for older Wemo products

https://www.belkin.com/support-article/?articleNum=335419
52•apparent•7h ago•46 comments

Launch HN: Leaping (YC W25) – Self-Improving Voice AI

49•akyshnik•8h ago•25 comments

How to prove false statements: Practical attacks on Fiat-Shamir

https://www.quantamagazine.org/computer-scientists-figure-out-how-to-prove-lies-20250709/
198•nsoonhui•16h ago•153 comments

Show HN: Cactus – Ollama for Smartphones

107•HenryNdubuaku•7h ago•45 comments

eBPF: Connecting with Container Runtimes

https://h0x0er.github.io/blog/2025/06/29/ebpf-connecting-with-container-runtimes/
34•forxtrot•7h ago•0 comments

Regarding Prollyferation: Followup to "People Keep Inventing Prolly Trees"

https://www.dolthub.com/blog/2025-07-03-regarding-prollyferation/
39•ingve•3d ago•1 comments

Grok 4

https://simonwillison.net/2025/Jul/10/grok-4/
177•coloneltcb•6h ago•147 comments

Not So Fast: AI Coding Tools Can Reduce Productivity

https://secondthoughts.ai/p/ai-coding-slowdown
54•gk1•2h ago•30 comments

Analyzing database trends through 1.8M Hacker News headlines

https://camelai.com/blog/hn-database-hype/
115•vercantez•2d ago•61 comments

Diffsitter – A Tree-sitter based AST difftool to get meaningful semantic diffs

https://github.com/afnanenayet/diffsitter
89•mihau•13h ago•26 comments

Matt Trout has died

https://www.shadowcat.co.uk/2025/07/09/ripples-they-cause-in-the-world/
139•todsacerdoti•18h ago•41 comments

Is Gemini 2.5 good at bounding boxes?

https://simedw.com/2025/07/10/gemini-bounding-boxes/
259•simedw•13h ago•57 comments

The ChompSaw: A Benchtop Power Tool That's Safe for Kids to Use

https://www.core77.com/posts/137602/The-ChompSaw-A-Benchtop-Power-Tool-Thats-Safe-for-Kids-to-Use
80•surprisetalk•3d ago•64 comments

Foundations of Search: A Perspective from Computer Science (2012) [pdf]

https://staffwww.dcs.shef.ac.uk/people/J.Marshall/publications/SFR09_16%20Marshall%20&%20Neumann_PP.pdf
3•mooreds•3d ago•0 comments

Show HN: Typeform was too expensive so I built my own forms

https://www.ikiform.com/
166•preetsuthar17•17h ago•86 comments

Final report on Alaska Airlines Flight 1282 in-flight exit door plug separation

https://www.ntsb.gov:443/investigations/Pages/DCA24MA063.aspx
130•starkparker•5h ago•141 comments

Radiocarbon dating reveals Rapa Nui not as isolated as previously thought

https://phys.org/news/2025-06-radiocarbon-dating-reveals-rapa-nui.html
16•pseudolus•3d ago•6 comments

Optimizing a Math Expression Parser in Rust

https://rpallas.xyz/math-parser/
127•serial_dev•16h ago•55 comments
Open in hackernews

Show HN: CXXStateTree – A modern C++ library for hierarchical state machines

https://github.com/ZigRazor/CXXStateTree
38•zigrazor•3d ago
Hi HN!

I've built [CXXStateTree](https://github.com/ZigRazor/CXXStateTree), a modern C++ header-only library to create hierarchical state machines with clean, intuitive APIs.

It supports: - Deeply nested states - Entry/exit handlers - State transitions with guards and actions - Asynchronous transitions with `co_await` (C++20 coroutines) - Optional runtime type identification for flexibility

It's ideal for complex control logic, embedded systems, games, robotics, and anywhere you'd use a finite state machine.

I’d love feedback, use cases, or contributions from the community!

Repo: https://github.com/ZigRazor/CXXStateTree

Comments

jeffreygoesto•3d ago
Nice and compact. I only wound have two nitpicks:

The Readme sais "zero heap allocations" but the code uses list and unordered map and moves, did you mean "zero allocations after state tree building"?

Also for embedded it would be useful to separate all in/out, dot export etc. to a second library that you can omit on small targets.

zigrazor•3d ago
yes, it means "zero allocations after state tree building". Thank you for the suggestions, I think we could separate target with compilation switch. If you want you can open an issue on the repo. Thank you so much
happyweasel•9h ago
vcpkg it
zigrazor•8h ago
You can open an Issue on that on the repo (https://github.com/ZigRazor/CXXStateTree/issues) so we can track these changes.

Another idea is to create a Python binding with a release of a package

dgan•8h ago
i am by no means a C++ expert, but isn't "pragma once" frowned upon?
kookamamie•7h ago
No, it is the way. Edit: no one has time for inventing unique names for include guards.
hdhdjd•7h ago
Does anyone write those by hand anyway in any kind of project the size where it would matter?

#pragma once is broken by design

bogwog•6h ago
I don't understand what you're saying here. #pragma once does the job that include guards used to do, but with less work, and in a less error prone way. How is it broken, and how is the size of a project relevant?
motorest•6h ago
> I don't understand what you're saying here. #pragma once does the job that include guards used to do, (...)

They don't. They are not C++ and at most they are compiler-specific.

It's fine if you opt to not write C++ and instead target specific compilers instead. Just don't pretend it's not frowned upon or kosher.

bogwog•6h ago
TIL about the existence of a passionate #pragma once hating subculture.

Since you seem to be more knowledgeble about this, I'm curious to know which C++ compilers lack support? I know that at least the 3 big ones do (GCC, Clang, and MSVC) and they have for a very long time.

jcelerier•2h ago
it's absolutely not frowned upon in 2025. All the compilers that matter (GCC, Clang and MSVC) support and have supported them for two decades. Major projects use #pragma once internally - I see files using it in Qt, LLVM, etc.
quietbritishjim•6h ago
> Does anyone write those by hand anyway in any kind of project the size where it would matter?

I think you're suggesting that you don't need to make up the names for include guards because all tools / IDEs for C++ write them for you automatically anyway. But that isn't my experience. Many IDEs don't write include guards for you automatically ... because everybody uses #pragma once already.

> #pragma once is broken by design

I think you're referring to the historical problem with #pragma once, which is that it can be hard for the compiler to identify what is really the same file (and therefore shouldn't be included a second time). If you hard link to the same file, or soft link to it, is it the same? What if the same file is mapped to two different mount points? What if genuinely different files have the same contents (e.g., because the same library is included from two different installation paths)? In practice, soft/hard links to the same file are easily detectable, and anything more obscure indicates such a weird problem with your setup that you surely have bigger issues. #pragma once is fine.

(Historically, it also had the benefit that compilers would know not to even re-read the header, whereas with traditional include guards they would need to re-include the file (e.g. in case the whole file is not wrapped in the #ifdef, or in case something else has undefined it since) only to then discard the contents. I've even seen coding guidelines requiring external include guards wrapped around every use of headers with #include <...>. Yuck! But modern compilers can work out when include guards are meant to mean that so today that difference probably no longer exists.)

jcelerier•2h ago
Even if you don't write header guards by hand you get issues. The amount of time I got bitten by someone naming a file "widget.h" or "utils.hpp" three levels of libraries down with the corresponding #ifndef WIDGET_H which broke the build in incredibly mysterious ways...

https://github.com/search?q=ifndef+WIDGET_H&type=code

motorest•6h ago
> No, it is the way.

No, this is completely wrong. Pragma once is non-standard compiler directive. It might be supported by some compilers such as msvc but technically it is not even C++.

There are only two options: include guards, and modules.

quietbritishjim•6h ago
What major compiler does not support it?
motorest•6h ago
> What major compiler does not support it?

The whole point is that it's not supported and it's not standard, thus using #pragma once needlessly introduced the risk of having the code break.

You should ask yourself what are you doing and why are you using non-standard constructs that may or may not work, specially when it's rather obvious and trivial to just use include guards. Using #pragma once isn't even qualify as being clever to gain anything.

phkahler•6h ago
Maybe you should ask why you're using a non-standard compiler if it's not supported.

Not being part of the official standard doesn't necessarily mean it's not well supported.

AndriyKunitsyn•4h ago
The whole point of C/C++ is knowing your environment. It's not Java, it's not TypeScript. It's one level above assembly, and if you change the compiler and things break, then it's your fault.

If the standards still don't have a proper replacement for include guards, then too bad for the standards. The C++ standard wasn't aware of multithreading before C++11, this didn't stop people from writing multithreaded programs.

As to why - #pragma once is just cleaner to look at.

gpderetta•2h ago
> the standards still don't have a proper replacement for include guard

It does with modules... and in ten year if modules support is widespread, I'll consider stoping using pragma once.

spacechild1•6h ago
Yes, it is non-standard, but I don't know any compiler that does not support it.
alt187•2h ago
All terrestrial compilers support `#pragma once`.

In the C++ community (as lots of other things are), rejecting `#pragma once` is a long-standing tradition of worshipping the decaying body of prehistoric compilers for

It's unclear what benefits this approach has achieved, but don't disturb it, or else.

sam_bishop•2h ago
I've avoided #pragma once because of reports that it slows down gcc/g++: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58770

But given that I haven't seen any mention of that issue in other comments, I wonder if it really is an issue.

baymotion•5h ago
Related idea for those using python: https://github.com/baymotion/smax.
wangii•1h ago
how is it better than https://github.com/boost-ext/sml ?

there are about 1 million c++ state machines, and sml happens to be the best, or one of them. how does yours differentiate?