frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Nashville uses eminent domain to block data center near zoo

https://www.costar.com/article/970809918/nashville-council-approves-eminent-domain-action-to-halt...
136•mapping365•2h ago•129 comments

Discovery Loop

https://www.discoveryloop.com/
660•xtreak29•12h ago•414 comments

Changes at Google DeepMind: Demis Hassabis from CEO to Chair, Jeff Dean departs

https://blog.google/company-news/inside-google/message-ceo/next-chapter-ai-momentum/
555•colesantiago•12h ago•629 comments

Zed DeltaDB

https://zed.dev/deltadb
347•ahamez•10h ago•184 comments

The title cards in Blade Runner are amazing

https://randsinrepose.com/archives/blade-runner-title-cards/
197•ExMachina73•7h ago•88 comments

Do birds enjoy flying? Analysis of affect after flight in galah (E roseicapilla)

https://brill.com/view/journals/beh/aop/article-10.1163-1568539X-bja10370/article-10.1163-1568539...
22•bookofjoe•2d ago•9 comments

Muse Code and Muse Spark 1.2

https://research.meta.ai/blog/introducing-muse-code-and-muse-spark-1-2
214•paulkrush•9h ago•125 comments

Branchless Rust: Making a Filter 4x Faster by Removing an If

https://www.greyblake.com/blog/branchless-rust/
73•greyblake•2d ago•15 comments

Beating GPT-5.6 Sol on retrieval with 100x cheaper open models

https://neon.com/blog/how-castform-neon-beats-frontier-models-on-price-and-efficiency
260•moonikakiss•10h ago•64 comments

Born Against, or why hobby programming communities are against LLM usage

https://blog.fogus.me/llm/born-against.html
180•lladnar•10h ago•169 comments

Prime Agent: A self-improving RLM agent

https://www.primeintellect.ai/blog/prime-agent
138•Xeophon•7h ago•23 comments

Cloudflare OS: an open platform for agents, apps, and work

https://blog.cloudflare.com/cloudflare-os/
510•speckx•15h ago•253 comments

Quantego: A Family of Lego Models of IBM Quantum Computers

https://quantego.org/
4•rbanffy•6d ago•0 comments

NVIDIA’s Vera Whitepaper Has a Thread Loose

https://chipsandcheese.com/p/nvidias-vera-whitepaper-has-a-thread
108•pella•7h ago•15 comments

Atlassian Rovo Exfiltrates Data, Bypassing Controls

https://www.promptarmor.com/resources/atlassian-rovo-exfiltrates-data
200•hackerBanana•11h ago•79 comments

Celld: Self-hosted, distributed Durable Objects

https://github.com/denoland/celld
177•calvinfo•12h ago•30 comments

GNU Hurd News 2026-Q2

https://www.gnu.org/software/hurd/news/2026-q2.html
151•plaguna•3d ago•101 comments

I'll be stepping back from leading product for X

https://twitter.com/nikitabier/status/2085105586966827343/
97•DearAll•7h ago•150 comments

I'm switching my phone from Android to Linux

https://runarcn.no/android-to-linux/
250•speckx•9h ago•207 comments

Position: LLMs Can't Jump

https://openreview.net/challenge?redirect=%2Fforum%3Fid%3DklU4737opt
258•theanonymousone•18h ago•174 comments

Sycophantic AI Decreases Prosocial Intentions and Promotes Dependence (2025)

https://arxiv.org/abs/2510.01395
92•robin_reala•10h ago•60 comments

Exact, parallel 2D Delaunay triangulation for int32 coordinates

https://github.com/morishuz/delaunay32
42•oryx1729•5d ago•5 comments

Goodhart's Law Comes for Every Benchmark You Trust

https://cacm.acm.org/blogcacm/goodharts-law-comes-for-every-benchmark-you-trust/
74•pseudolus•5d ago•32 comments

The Origins of Vintage Comics Part 1

https://www.truegrittexturesupply.com/blogs/news/origins-of-the-vintage-comics-aesthetic-part-1
21•Michelangelo11•6d ago•1 comments

Discovery of a multicomponent alloy forged by the Hiroshima atomic blast

https://www.science.org/doi/10.1126/sciadv.aeg8299
119•_____k•6d ago•54 comments

Pushing the limits of RISC-V emulation

https://shuklaayu.sh/blog/riscv-recompiler
35•shuklaayush•1w ago•16 comments

The Entropy of a Markov Chain

https://chillphysicsenjoyer.substack.com/p/the-entropy-of-a-markov-chain
116•surprisetalk•15h ago•9 comments

LLMs won't break symmetric crypto

https://www.bfswa.blog/p/llms-wont-break-symmetric-crypto
59•rowbin•3h ago•66 comments

Online Friends Are Real Friends

https://toska.bearblog.dev/re-online-friends-are-real-friends/
90•Tomte•5d ago•54 comments

Launch HN: HyperProbe (YC S26) – Agents that do read-only debugging in prod

https://www.hyperprobe.co
48•shailendraht•12h ago•39 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.