frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Jensen Huang resigns

https://apnews.com/article/nvidia-megaspeed-china-singapore-huang-5403f152a601cf82ce939f1d24fffa0f
3258•lldb•16h ago•2997 comments

IceWM

https://ice-wm.org/
35•inatreecrown2•1h ago•12 comments

Rust 1.100

https://blog.rust-lang.org/2026/11/12/Rust-1.100.0/
561•mbStavola•11h ago•225 comments

Switcher (2004)

https://folklore.org/Switcher.html
71•sammatilda•2h ago•14 comments

Gemini 4 Hydrogen and Orchestrator

https://antigravity.google/blog/gemini-4-hydrogen-in-google-antigravity/
370•jonbaer•11h ago•100 comments

Show HN: My $300 embroidery machine needed a subscription, so I built my own app

https://github.com/simpsoka/zigzag
437•simpsoka•13h ago•167 comments

Edge0-145B: Frontier AI Capabilities on Your Own Computer

https://edge0.ai/blog/introducing-edge0-145b-frontier-ai-capabilities-on-your-own-computer
170•sroussey•7h ago•39 comments

Brave Search API now accepts agentic payments via the x402 protocol

https://brave.com/blog/search-api-agentic-payments/
32•sjdh76•2h ago•10 comments

Dwarf planet candidate appears which takes roughly 280 years to orbit our sun

https://www.smithsonianmag.com/smart-news/astronomers-found-a-mysterious-object-orbiting-far-beyo...
256•cybermango•11h ago•110 comments

Foundation Models framework

https://developer.apple.com/foundation-models-framework/
179•kermatt•8h ago•25 comments

Former Nvidia CEO Huang had a relationship with a second employee, sources say

https://www.reuters.com/technology/former-nvidia-ceo-huang-had-relationship-with-second-employee-...
196•jbredeche•10h ago•221 comments

Nvidia employees petition to bring back Jensen Huang

https://www.wired.com/story/nvidia-employees-petition-for-jensen-huangs-return/
335•lavendermon•3h ago•257 comments

Service degradation on Microsoft 365

https://status.cloud.microsoft/
687•dkpk•11h ago•643 comments

I'm making LLMs work on small and old devices

https://github.com/hyperionaidev/smolmaxxing/
322•mrashad74•14h ago•115 comments

Turning a 22-year-old Postgres type-confusion primitive into RCE

https://mehmetince.net/part-3-6-how-i-ended-up-turning-a-22-year-old-postgresql-type-confusion-pr...
164•ozirus•11h ago•30 comments

AI is turning Apple's app review process into a nightmare for synth developers

https://synthanatomy.com/2026/11/ai-is-turning-apples-app-review-process-into-a-nightmare-for-dev...
146•anigbrowl•8h ago•135 comments

Abandoned Quake 4 expansion finished by modders and now playable

https://www.moddb.com/mods/openq4/downloads/openq4-0141-windows-x64
256•klaussilveira•15h ago•91 comments

Show HN: PharmA2A, an open protocol for pharmacy-to-supplier orders on A2A

https://github.com/pharma2a/pharma2a
4•eliefo•1h ago•0 comments

Show HN: RealtimeVAD – trading false positives for 110ms earlier end-of-speech

https://github.com/KoljaB/RealtimeVAD
13•koljab•8h ago•1 comments

Relax: JIT compiler for Rust to reduce build times

https://makepad.github.io/relax/
140•adamnemecek•1d ago•63 comments

Sift: LSP, Lint, Format Lisp, Scheme and Emacs Lisp

https://github.com/jjba23/sift
34•jjba23•1d ago•6 comments

Anthropic IPO

https://ipo.anthropic.com/us/
880•josephljohnston•18h ago•844 comments

Talking Zen 6 with Mike Clark at AMD In-Depth

https://chipsandcheese.com/p/talking-zen-6-with-mike-clark-at
206•dverlaeckt80•15h ago•4 comments

Adapting CPython for Yk

https://tratt.net/laurie/blog/2026/adapting_cpython_for_yk.html
62•frostbyte7•17h ago•2 comments

The average cost for a new vehicle in the U.S. hits a record high: over $51,000

https://www.npr.org/2026/11/10/nx-s1-6026659/average-vehicle-price-record-high
10•blinding-streak•56m ago•1 comments

Gemini 4 Hydrogen

https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-hydr...
501•dvaplima•12h ago•320 comments

Chinese frontier AI models carry the fingerprint of export-controlled GPUs

https://unemploymentlabs.com/checkpoint-forensics
242•firloop•8h ago•64 comments

Announcement: Conductor Is Back

https://twitter.com/charlieholtz/status/2120973052024598620
26•jahala•9h ago•16 comments

Show HN: Kapso – Iterative learning from enterprise data

43•alirezamshi•12h ago•10 comments

Our software engineering interviews are changing a little

https://blog.janestreet.com/software-engineering-interviews-are-changing-a-little/
202•maitland•16h ago•207 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.