frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

The original URL for this prediction will no longer be available in 11 years (2011)

http://longbets.org/601/
103•doubletwoyou•2h ago•19 comments

My server is a phone now

https://seg6.space/posts/phone-server/
256•seg6•8h ago•92 comments

Melatonin impairs morning cognition in healthy young adults

https://academic.oup.com/sleep/article/46/Supplement_1/A34/7181621
76•bohaska•6h ago•22 comments

Microsoft Word for Windows 1.1a, Native X64 Port

https://github.com/jmarshall23/msword
17•BruceEel•1h ago•5 comments

Improving Heuristics for A* Pathfinding

https://www.redblobgames.com/pathfinding/heuristics/differential.html
181•bobbiechen•1w ago•18 comments

Shopify replaced Redis with MySQL for inventory reservations–and it scaled

https://shopify.engineering/scaling-inventory-reservations
152•adletbalzhanov•8h ago•83 comments

Incentives are for losers

https://www.experimental-history.com/p/incentives-are-for-losers
70•bkudria•5h ago•32 comments

Fastmail offers EU data region

https://www.fastmail.com/blog/fastmail-offers-eu-data-region/
378•groomlake•14h ago•190 comments

Os8088: A powerful Mac-like OS for the IBM XT, 286, 386

https://os8088.com/
128•jggonz•7h ago•52 comments

Dithered QR Codes

https://www.andrewt.net/dithered-qr-codes/wtf/
137•jmusall•7h ago•15 comments

Unexpected events and prosocial behavior: the Batman effect (2025)

https://www.nature.com/articles/s44184-025-00171-5
43•davidbarker•6d ago•8 comments

_for-sale DNS records

https://specification.website/spec/foundations/for-sale-dns/
383•shaunpud•17h ago•141 comments

Making difficulty curves in games

http://www.davetech.co.uk/difficultycurves
100•hakkikonu•3d ago•37 comments

TheoremDB – A public workspace for machine mathematics

https://theoremdb.org/
27•frozenseven•5h ago•0 comments

Open-source interactive map for the Aug 12 total solar eclipse

https://eclipsefan.org/?v=2&t=max&layers=eclipse%2Cbesselian%2Cumbra-live%2Cshadow-3d%2Ccloud-pro...
127•MarcoDewey•11h ago•27 comments

Retraction: The App Store Rejection of the Week That Was a Correct Rejection

https://daringfireball.net/2026/08/retraction_app_store_rejection_of_the_week
122•minimaxir•3h ago•8 comments

Illinois just told every operating system to start reporting your kid's age

https://itsfoss.com/news/illinois-age-verification-bill/
55•WaitWaitWha•2h ago•28 comments

Assert(): A Modern How To

https://fiberfs.io/blog/assert_a_modern_how_to
8•nyc_pizzadev•5d ago•3 comments

Building a local positioning system to track runners using Ultra-Wideband

https://zeus.ugent.be/blog/25-26/12urenloop-uwb/
70•robinpdev•1w ago•5 comments

Triton: DirectX 11 Driver for QEMU

https://blog.getutm.app/2026/introducing-triton-directx-11-driver-for-qemu/
163•electricant•17h ago•31 comments

Finding zombies in our systems: A real-world story of CPU bottlenecks

https://medium.com/pinterest-engineering/finding-zombies-in-our-systems-a-real-world-story-of-cpu...
42•fagnerbrack•6d ago•8 comments

Real-time MCP interceptor that blocks .env reads and dangerous commands agents

https://marketnow.site/
8•eddyflores•3h ago•0 comments

Fixing my tooltip accessibility mistake

https://jakearchibald.com/2026/my-tooltip-a11y-mistake/
22•robin_reala•1w ago•1 comments

The Sound and Music of 'Hyper Light Drifter' [video]

https://gdcvault.com/play/1024135/The-Sound-and-Music-of
42•hyperific•4d ago•9 comments

Message your other Claude Code sessions

https://code.claude.com/docs/en/cross-session-messaging
106•mfiguiere•15h ago•44 comments

Lost my phone at the office. Claude suggested tracking Bluetooth signal strength

https://twitter.com/un1c0rnioz/status/2084686552299634805
267•ilamont•1d ago•192 comments

DDisasm: Reversible (bi-directional) Disassembler

https://github.com/GrammaTech/ddisasm
34•aboardRat4•6d ago•5 comments

“Code was never the hard part” is an insult to all programmers

https://blog.senko.net/code-was-never-the-hard-part-is-an-insult-to-all-programmers
693•senko•16h ago•414 comments

Preventing Misfolding by Preventing Folding

https://www.science.org/content/blog-post/preventing-misfolding-preventing-folding
59•surprisetalk•4d ago•3 comments

Can Intel finally beat ARM on performance per Watt?

https://hackaday.com/2026/08/08/want-energy-efficiency-dude-youre-getting-a-dell/
186•gumby•14h ago•144 comments
Open in hackernews

Assert(): A Modern How To

https://fiberfs.io/blog/assert_a_modern_how_to
8•nyc_pizzadev•5d ago

Comments

RossBencina•9m ago
Interesting article about a worthy topic, even though I disagree with some it. Side note: I expected to see mention of design by contract and function preconditions/invariants/postconditions.

I don't think the article is well founded. Before you can discuss usage you need to establish the semantics for assert(). The author touches on this in the introduction but then leaves the details unexamined. In particular I'd need to know: can assertions be disabled (as with C/C++ NDEBUG)? does the project have a policy of leaving asserts in production builds? or are asserts only ever enabled for development and testing. if used in production, do you care about the overhead of checking assertions in performance critical code? if an assertion is hit does it always log and panic/terminate? or does it throw a catchable exception? What is the runtime context of the code: is it a server process with a supervision tree? is the failure paradigm "let it crash"? is it an interactive program where the only supervisor is the user? is it a use-case where a program crash is undesirable and/or safety critical? is it a library with unknown use-cases? Are the developers in full control of the program inputs and outputs that trigger asserts?

As a general principle for layered systems, when there is a policy decision to be made, lower-level code should delegate upwards to higher levels, which should implement the policy. Throwing an exception or returning an error code is frequently better than terminating (if you squint, crashing out to the supervision tree is more like throwing an exception than it is like terminating.)

> Correctness - All possible function input and output values which do not have full value coverage should have assertions covering them.

Only if you control all of the callers. Library users would prefer an invalid parameters error/exception.

> Safety - When performing operations that can have unwanted, known, or unknown side effects, assertions should be used to prevent those conditions from happening.

Why assertions? If it is safety critical, shouldn't these checks be mandatory?

> Development - Use an assertion to enforce assumptions on values and state. These assertions can optionally be compiled out of code when coupled with proper testing.

This is where preconditions/postconditions/invariants come in. If safety is important you probably want to leave them in place. A runtime contract violation should enter a fail-safe state.

> Documentation - When writing code, use assertions as self documenting guardrails around your logic. Use assertions to enforce values and state which might be unclear from documentation or hard to decipher from reading code.

I do this, but in this case you either need to be 100% sure that the exception won't get hit, 100% sure that the exception won't make it into production builds, or okay with production crashes.

  > var error = system_call(...);
  > assert(!error);
Writing this is equivalent to providing an arbitrary third-party with the ability to crash your application with a user-unfriendly error message. Your program should have code paths to handle all error conditions. One of them can be { print("unexpected result from system call. exiting.") exit(); }
rramadass•3m ago
Not this again ...

Assertions should only be thought of as predicates on state space to ensure program correctness. Everything else is just a corollary.

Some relevant past comments of mine here - https://news.ycombinator.com/item?id=48358691

iTokio•2m ago
I love to combine assertions with « restartability ».

If you’re program has entered an unknown, failed state, just restart it from a known state.

Even better if you can divide a complex system in sub modules that can recover independently without bringing down the entire system.

Something like Erlang supervision tree. Or at least a systemd Restart=always service.

if your program is mostly stateless, and « restartable », it becomes fault tolerant, and you can use assertions liberally and easily avoid unknown/bad states.

Invariants can be enforced, and correctness preserved. But an important question remains when an assertion is triggered, why invariants were violated?

We need to preserve context, and decide to handle or not this case. That is easy to forget in code that is assertions oriented.