frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

AMD acquires Taalas to boost inference performance by etching models in silicon

https://www.theregister.com/systems/2026/08/06/amd-acquires-ai-chip-startup-taalas-to-boost-infer...
493•itvision•8h ago•379 comments

Mario Meets Pareto

https://www.mayerowitz.io/blog/mario-meets-pareto
949•theanonymousone•17h ago•151 comments

Scientists discover Kelvin-Helmholtz Instability on the surface of the Sun

https://nso.edu/press-release/nsf-inouye-solar-telescope-enables-major-discovery-of-a-hidden-sola...
185•neversaydie•1d ago•38 comments

Hackers Stalked Me by Hijacking a Smartwatch for Kids

https://www.wired.com/story/hackers-stalked-me-by-hijacking-a-smartwatch-for-kids/
46•worik•5h ago•18 comments

Taste Is All That's Left

https://notashelf.dev/posts/taste-is-all-thats-left
296•tsak•12h ago•226 comments

Bioengineered chewing gum may offer a way to fight HPV and other microbes

https://www.sciencedaily.com/releases/2026/08/260803080917.htm
83•Audiophilip•7h ago•14 comments

Welcoming the Nepalese Government to Have I Been Pwned

https://www.troyhunt.com/welcoming-the-nepalese-government-to-have-i-been-pwned/
115•gnabgib•7h ago•19 comments

Improving GPT‑5.6 Sol in ChatGPT, expanding GPT‑5.6 Luna access for free users

https://openai.com/index/improving-gpt-5-6-sol-in-chatgpt/
191•tedsanders•12h ago•142 comments

GitHub Actions and Pages are experiencing degraded availability

https://www.githubstatus.com/incidents/qcvjkzcs7j74
361•Footkerchief•13h ago•293 comments

Almost no skill required to cook a steak

https://blog.sydorets.com/en/posts/almost-no-skill-required-to-cook-a-steak/
310•yusyd•13h ago•350 comments

Herdr is joining Y Combinator. The runtime stays open

https://herdr.dev/blog/herdr-is-joining-y-combinator/
175•collinmanderson•10h ago•117 comments

Launch HN: ProvenMetal (YC S26) delivers circuit boards in days instead of weeks

https://provenmetal.com
190•willcarkner•13h ago•138 comments

Atomic Clocks

https://www.nist.gov/atomic-clocks/how-do-atomic-clocks-work
5•teleforce•6d ago•0 comments

I stopped trusting USB-C cable labels and started testing them

https://www.makeuseof.com/i-stopped-trusting-usb-c-cable-labels-started-testing-with-meter-instead/
121•baranul•3d ago•97 comments

Retired man plants trees on forgotten land, now it's Sao Paulo's largest park

https://timesofindia.indiatimes.com/world/rest-of-world/in-2003-a-retired-man-planted-trees-on-fo...
62•rmason•5d ago•18 comments

Why Estonians invite strangers into their back gardens each summer

https://www.bbc.com/travel/article/20260731-why-estonians-invite-strangers-into-their-backyards-e...
36•koolhead17•3d ago•6 comments

Meta Ordered to Pay $942M to Address Harm to Kids from Social Media

https://www.wsj.com/tech/meta-ordered-to-pay-942-million-to-address-harm-to-kids-from-social-medi...
136•boplicity•5h ago•78 comments

Humans missed 1 in 3 threats approving AI agent commands across 40k game runs

https://scalex.dev/blog/ai-agent-permissions-stats/
274•Wirbelwind•17h ago•197 comments

STV: A full-motion video codec for the Atari ST

https://medium.com/@jonas.eschenburg/stv-a-video-codec-for-the-atari-st-6e46355c50e4
33•indyjo•1w ago•2 comments

My phone detects going on a run as “someone snatching my phone and running off”

https://mastodon.gamedev.place/@rygorous/117047697255584965
106•luu•10h ago•198 comments

Learn how chips are made with this Rollercoaster Tycoon-inspired animation

https://laurentiugabriel.github.io/ChipTycoon/
123•laurentiurad•6d ago•24 comments

Quake – 30th Anniversary Update

https://slayersclub.bethesda.net/en-US/news/quake-30th-anniversary-update
248•dsubburam•8h ago•121 comments

Show HN: The Channels SDK – Bring Any Agent to Any Channel (Slack, MS Teams)

https://github.com/CopilotKit/channels-sdk
96•davidmckayv•13h ago•20 comments

Can you reverse engineer an ASIC?

https://blog.janestreet.com/can-you-reverse-engineer-an-asic/
76•bschne•10h ago•48 comments

The Sylvester–Gallai Theorem

https://www.futilitycloset.com/2026/07/26/the-sylvester-gallai-theorem/
26•surprisetalk•6d ago•20 comments

Inside vLLM: Anatomy of a High-Throughput LLM Inference System (2025)

https://www.aleksagordic.com/blog/vllm
81•sebg•7h ago•4 comments

The simple elegance of the integrated timing belt loopback fastener

https://danielmangum.com/posts/integrated-timing-belt-loopback-fastener/
108•hasheddan•4d ago•22 comments

Pareto Front

https://en.wikipedia.org/wiki/Pareto_front
231•binyu•1w ago•96 comments

Learning to fly FPV drones with AI flight coach

https://blog.divyendusingh.com/p/learning-to-fly-fpv-drones-with-ai
7•divyenduz•3d ago•5 comments

Building Progressively Enhanced Forms Using htmx

https://www.rafa.ee/articles/progressive-enhanced-forms-htmx/
74•mpweiher•1w ago•11 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•1y 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•1y 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•1y ago
What language is that? Is it available everywhere (everywhere) C is?
mitthrowaway2•1y 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•1y 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•1y 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•1y ago
Learning such a language doesn’t mean I can use it.
o11c•1y 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•1y 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•1y 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•1y ago
This reminds me of the days when Boost was a thing. It was full of tricks like this.
usrnm•1y ago
It still is a thing, though.
cperciva•1y 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•1y 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.