frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Deterministic Fully-Static Whole-Binary Translation Without Heuristics

https://arxiv.org/abs/2605.08419
204•matt_d•6h ago•49 comments

Restore full BambuNetwork support for Bambu Lab printers

https://github.com/FULU-Foundation/OrcaSlicer-bambulab
462•Murfalo•13h ago•201 comments

New stainless steel can survive conditions for hydrogen production in seawater

https://www.sciencedaily.com/releases/2026/05/260510030950.htm
70•HardwareLust•2d ago•25 comments

Googlebook

https://googlebook.google/
800•tambourine_man•17h ago•1311 comments

Show HN: Needle: We Distilled Gemini Tool Calling into a 26M Model

https://github.com/cactus-compute/needle
486•HenryNdubuaku•17h ago•154 comments

The Boring Part of Bell Labs (2025)

https://acesounderglass.com/2025/11/15/the-boring-part-of-bell-labs/
18•surprisetalk•4d ago•2 comments

SecurityBaseline.eu

https://internetcleanup.foundation/2026/05/european-governments-3000-tracking-sites-1000-phpmyadm...
168•aequitas•3h ago•78 comments

The vi family

https://lpar.ATH0.com/posts/2026/05/the-vi-family/
185•hggh•1w ago•112 comments

How to make your text look futuristic (2016)

https://typesetinthefuture.com/2016/02/18/futuristic/
369•_vaporwave_•14h ago•48 comments

Why senior developers fail to communicate their expertise

https://www.nair.sh/guides-and-opinions/communicating-your-expertise/why-senior-developers-fail-t...
604•nilirl•20h ago•265 comments

CERT is releasing six CVEs for serious security vulnerabilities in dnsmasq

https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2026q2/018471.html
324•chizhik-pyzhik•16h ago•162 comments

Kraftwerk's radical 1976 track

https://www.bbc.com/culture/article/20260511-kraftwerks-radical-1976-track-radioactivity-became-a...
168•tcp_handshaker•11h ago•117 comments

Traceway: MIT-licensed observability stack you can self-host in ~90s

https://github.com/tracewayapp/traceway
120•sebakubisz•2d ago•13 comments

Preserving Fisher-Price Pixter

https://dmitry.gr/?r=05.Projects&proj=37.%20Pixter
7•dmitrygr•2d ago•0 comments

Scrcpy v4.0

https://github.com/Genymobile/scrcpy/releases/tag/v4.0
216•xnx•14h ago•28 comments

When “idle” isn't idle: how a Linux kernel optimization became a QUIC bug

https://blog.cloudflare.com/quic-death-spiral-fix/
100•sbulaev•11h ago•12 comments

Rendering the Sky, Sunsets, and Planets

https://blog.maximeheckel.com/posts/on-rendering-the-sky-sunsets-and-planets/
483•ibobev•21h ago•39 comments

Quack: The DuckDB Client-Server Protocol

https://duckdb.org/2026/05/12/quack-remote-protocol
295•aduffy•17h ago•61 comments

My graduation cap runs Rust

https://ericswpark.com/blog/2026/2026-05-12-my-graduation-cap-runs-rust/
158•ericswpark•11h ago•59 comments

Up in Smoke

https://thebaffler.com/odds-and-ends/the-profession-that-does-not-exist-symposium
28•NaOH•2d ago•9 comments

The Future of Obsidian Plugins

https://obsidian.md/blog/future-of-plugins/
384•xz18r•19h ago•146 comments

Reimagining the mouse pointer for the AI era

https://deepmind.google/blog/ai-pointer/
210•devhouse•17h ago•178 comments

What if there was no BASIC in EndBASIC?

https://blogsystem5.substack.com/p/no-basic-in-endbasic
24•rbanffy•3d ago•5 comments

As researchers age, they produce less disruptive work

https://nautil.us/is-this-why-science-advances-one-funeral-at-a-time-1280650
81•Brajeshwar•17h ago•83 comments

Fc, a lossless compressor for floating-point streams

https://github.com/xtellect/fc
73•enduku•3d ago•20 comments

Tell NYT, Atlantic, USA Today to keep Wayback Machine

https://www.savethearchive.com/newsleaders/
341•doener•11h ago•94 comments

Starship V3

https://www.spacex.com/updates#starship-v3
243•fprog•9h ago•378 comments

I made Rust’s cargo copy but for CPP

https://github.com/user-with-username/crow
14•anybodyy•2d ago•7 comments

Show HN: Agentic interface for mainframes and COBOL

https://www.hypercubic.ai/hopper
81•sai18•17h ago•42 comments

Bambu Lab is abusing the open source social contract

https://www.jeffgeerling.com/blog/2026/bambu-lab-abusing-open-source-social-contract/
1286•rubenbe•20h ago•400 comments
Open in hackernews

Detecting if an expression is constant in C

https://nrk.neocities.org/articles/c-constexpr-macro#detecting-if-an-expression-is-constant-in-c
49•signa11•1y ago

Comments

wahern•12mo ago
> This works. But both gcc and clang warn about the enum being anonymous... even though that's exactly what I wanted to do. And this cannot be silenced with #pragma since it's a macro, so the warning occurs at the location where the macro is invoked.

You can use _Pragma instead of #pragma. E.g.

  #define C(x) ( \
    _Pragma("clang diagnostic push") \
    _Pragma("clang diagnostic ignored \"-Wvisibility\"") \
    (x) + 0*sizeof(void (*)(enum { tmp = (int)(x) })) \
    _Pragma("clang diagnostic pop") \
  )
EDIT: Alas, GCC is a little pickier about where _Pragma is allowed so you may need to use a statement expression. Also, it seems GCC 14 doesn't have a -W switch that will disable the anonymous enum warning.
pjc50•12mo ago
It's remarkable that people will say that doing this kind of thing is better than learning a language which actually lets you enforce this with the type system.

(or even just insist that users use the version of the language which supports "constexpr"!)

oguz-ismail•12mo ago
What language is that? Is it available everywhere (everywhere) C is?
mitthrowaway2•12mo ago
Indeed, usually if I'm using C these days it's because I only have access to a c compiler for my target platform, or because I'm modifying an existing C codebase.
uecker•12mo ago
I do not think anybody said this. The point is that these macros work for early versions of C. If you need to support early versions of C, learning another language is not a solution. If you don't have to, you can use C23's constexpr.
trealira•12mo ago
C used to seem like a beautiful and simple language to me, but as I used it and learned more about it, it seemed more complex under the surface, and kind of janky as well. It's just utilitarian.
wat10000•12mo ago
Learning such a language doesn’t mean I can use it.
o11c•12mo ago
The problem is that no such language exists.

There are many languages that provide one particular feature that C doesn't provide, but they do this at the cost of excluding numerous other features that C widely relies on.

kjs3•12mo ago
"I have no idea what problem you're trying to solve, what the constraints are, what the use cases might be, what tools are available on the platform, what the job or regulations require, what the skillsets of the people involved are, what the timeline is...but I'm absolutely, unshakably certain that I have a magic bullet that will make all your problems go away."

FTFY.

sleirsgoevy•12mo ago
The Linux kernel has even a way to determine whether the expression is compile-time, WITHOUT aborting compilation in either case.

The trick is this (copied vebratim from Linux):

#define __is_constexpr(x) (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))

Explanation: if x is a constant expression, then multiplying it by zero yields a constant 0, and casting a constant 0 to void* makes a null pointer constant. And the ternary expression, if one of its sides is a null pointer constant, collapses to the type of the other side (thus the type of the returned pointer will be int*, and the sizeof will match). And if x was not constant, then the lefthand side would not be considered a null pointer constant by type inference, the type of the ternary expression will be void*, and the sizeof check will not match.

With a few more clever tricks, it's even possible to implement a compile-time "type ternary expression", like this: TYPE_IF(2 * 2 == 4, int, long). This is left as an exercise for the reader.

amelius•12mo ago
This reminds me of the days when Boost was a thing. It was full of tricks like this.
usrnm•12mo ago
It still is a thing, though.
cperciva•12mo ago
With a few more clever tricks...

I did this with my PARSENUM macro (https://github.com/Tarsnap/libcperciva/blob/master/util/pars...) to parse strings into floating-point, unsigned integer, or signed integer types (and check bounds) using a single interface.

bobbyi•12mo ago
I thought this would work:

#define C(x) (sizeof(char[x]), x)

sizeof is a compile-time operation so x need to be known at compile time.

It didn't work as expected. It turns out there is an exception and the standard says that sizeof is actually calculated at runtime specifically for variable length arrays:

> The sizeof operator yields the size (in bytes) of its operand, which may be an expression or the parenthesized name of a type. The size is determined from the type of the operand. The result is an integer. If the type of the operand is a variable length array type, the operand is evaluated; otherwise, the operand is not evaluated and the result is an integer constant.