frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

AI Models Can Provably Hide Arbitrary Capabilities

https://arxiv.org/abs/2610.13928
122•sbulaev•4h ago•65 comments

The baffling intelligence of a single cell (2024)

https://jsomers.net/e-coli-chemotaxis/
195•jsomers•1d ago•27 comments

GLM-Legal

https://z.ai/blog/glm-legal
513•ilreb•14h ago•298 comments

A Modern Web App in C

https://prophitt.me/writing/a-modern-web-app-in-c
502•prophittcorey•14h ago•209 comments

Intel D270 GPU AI Accelerator–Up to 480 GB LPDDR5X

https://www.intel.com/content/www/us/en/products/details/discrete-gpus/data-center-gpu/d-series.html
159•hurricanepootis•9h ago•72 comments

Hackers activate automatic defrosting in supermarket fridges across Europe

https://www.tomshardware.com/tech-industry/cyber-security/unprecedented-cyberattack-cripples-supe...
590•Zeekaas•18h ago•752 comments

Threat of AI share crash puts world financial stability at risk, says IMF

https://www.theguardian.com/business/2026/oct/13/ai-share-crash-risk-global-imf-debt-corrowing-cy...
25•novaRom•41m ago•6 comments

Who is vfmaddrnd231pd?

https://purplesyringa.moe/blog/who-is-vfmaddrnd231pd/
170•pngmangi•9h ago•16 comments

Janas: Run LLMs larger than RAM by streaming experts from SSD

https://github.com/prabanta-dev/janas
97•khalidkhair•8h ago•31 comments

The Dock on Mac, from OS 10 to macOS 27

https://blog.jim-nielsen.com/2026/macos-dock-icons-over-time/
54•soheilpro•4h ago•33 comments

Making big downloads resumable in Firefox

https://lunarwatcher.codeberg.page/til/firefox/resumable-big-downloads.html
159•speckx•11h ago•61 comments

Auto Research: Integer multiplication below n log n

https://app.getsupers.com/auto-research
43•swesnow•1d ago•19 comments

Turn a WiFi 7 Router into a 320Msps Software Defined Radio Receiver

https://github.com/h0m3us3r/w1700k-sdr
315•djfergus•17h ago•89 comments

AI is a tool and using it well takes skill

https://yyhh.org/blog/2026/10/ai-is-a-tool/
338•layer8•8h ago•276 comments

Launch HN: Agent37 (YC F26) – Low-cost agent sandboxes for running agents

127•vishnukool•13h ago•86 comments

Citroen revives the 2CV for an electric age

https://www.bbc.com/news/articles/c620r33plgppo
308•scrlk•18h ago•343 comments

Phreak.ing – Internet Phone Switch

https://phreak.ing/
112•rickcarlino•8h ago•30 comments

Writing a Demoscene Intro for the ZX Spectrum

https://www.markround.com/blog/2026/zx-spectrum-intro
106•zdw•10h ago•17 comments

Show HN: SolidCraft – Open-Source Parametric CAD in Rust (With MCP Support)

https://github.com/bherbruck/solidcraft
31•bherbruck•6h ago•2 comments

Solar panels that plug into your wall

https://www.nationalgeographic.com/environment/article/balcony-plug-in-solar-panels-renewable-energy
165•speckx•16h ago•154 comments

Secret of Orange Cats Revealed After 60-Year Search

https://www.sciencealert.com/secret-of-orange-cats-finally-revealed-after-60-year-search
258•bookofjoe•2d ago•180 comments

Show HN: An experimental pattern-first DAW that supports MCP

https://github.com/andrewfader/blokkily
42•androsynth89•7h ago•21 comments

Kevin Kelly's 2016 AI Predictions, 10 Years Later

https://taylor.town/kk-ai-2026
173•surprisetalk•15h ago•64 comments

Codex CLI installs a persistent, self-updating background daemon by default

https://github.com/openai/codex/issues/48195
528•whimblepop•12h ago•270 comments

The Making Of Super Mario 64 – full Giles Goddard interview (2001)

https://pixelatron.com/blog/the-making-of-super-mario-64-full-giles-goddard-interview-ngc/
238•gregsadetsky•2d ago•92 comments

Show HN: Brickbrag – A multiplayer brick-building world in the browser

https://brickbrag.com/
50•neuling•9h ago•28 comments

A look at OpenAI’s math that’s claimed computes faster Fourier transforms

https://www.argmin.net/p/faster-fourier-transforms
92•mochomocha•3h ago•62 comments

Muse Wonder

https://research.meta.ai/blog/muse-wonder
604•meetpateltech•13h ago•326 comments

Blood cells from 80-year-old donor become stem cells with molecular age under 20

https://doi.org/10.1111/acel.70751
141•arunc•7h ago•94 comments

Show HN: Atticus – Hold-to-talk voice assistant for macOS that runs on Claude -p

https://github.com/SaarthurR/atticus-mac
94•SaarthRanka•1d ago•19 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.