frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Whistle: Speech to Text in 16.9 MB

https://cactuscompute.com/blog/whistle
570•gmays•9h ago•127 comments

Theranos.world

https://www.theranos.world/
300•kbyatnal•8h ago•118 comments

Why isn't the industry freaking out about DeepSeek 4.1 Flash?

https://www.dgt.is/blog/2026-10-07-deepseek-freek-out/
447•jonotime•1d ago•378 comments

Man discovers his parents' coffee machine used 1TB of data in 10 days

https://www.dexerto.com/entertainment/man-discovers-his-parents-coffee-machine-used-1tb-of-data-i...
440•ck2•1d ago•276 comments

I hired an illustrator to draw my house. Now it's my Home Assistant dashboard

https://antonfrolov.substack.com/p/i-hired-an-illustrator-to-draw-my
419•soheilpro•2d ago•69 comments

The value of not getting to the point (2015)

https://ken.arneson.name/2015/11/the-value-of-not-getting-to-the-point/
128•NaOH•7h ago•40 comments

Yes, and

https://htmx.org/essays/yes-and/
205•Michelangelo11•16h ago•74 comments

Bevy 0.20

https://bevy.org/news/bevy-0-20/
36•Philpax•3h ago•3 comments

AI-ready biological data: $1.8B global commitment

https://biohub.org/news/virtual-biology-initiative-expansion/
77•ray__•5h ago•10 comments

Show HN: SVG Spark – 10 client-side SVG design and dev tools

https://svg-spark.vercel.app/
28•Zeus808•2h ago•4 comments

Reducing undefined behavior in the C language

https://lwn.net/Articles/1095811/
6•signa11•28m ago•0 comments

ETH-68: Ethernet Audio Interface for Linux

https://naturalsystems.io/eth68
96•chabad360•1d ago•61 comments

A Terminal Protocol for Program Status (OSC 7501)

https://mitchellh.com/writing/program-status-osc7501
111•mfiguiere•2d ago•33 comments

Step 5 Preview, a 1M-context MoE from StepFun, shows up on OpenRouter

https://openrouter.ai/stepfun/step-5-preview
104•AnneWodell•10h ago•25 comments

Beauty in DVD Menus

https://vale.rocks/posts/dvd-menus
266•speckx•13h ago•149 comments

Show HN: Edi Life OS – self-hosted life dashboard with an MCP server for AI

https://github.com/edrisranjbar/lifeos
21•edris0077•2h ago•3 comments

A 5.3M-year-old deep-sea whale necropolis in the Diamantina Zone

https://www.nature.com/articles/s41586-026-10546-z
95•bryanrasmussen•1d ago•6 comments

ADHD as a circadian rhythm disorder: evidence and implications for chronotherapy (2025)

https://www.frontiersin.org/journals/psychiatry/articles/10.3389/fpsyt.2025.1697900/full
179•bookofjoe•5h ago•129 comments

Ask HN: What do you run on a $5 VPS that's worth keeping online 24/7?

125•mariocesar•2d ago•180 comments

DuckDB Ducklake

https://github.com/duckdb/ducklake
124•saikatsg•1d ago•16 comments

Show HN: Making a flexible "neon" t-shirt with LED filaments

http://scottbezek.blogspot.com/2026/10/making-flexible-neon-t-shirt-with-leds.html
118•scottbez1•9h ago•20 comments

Show HN: Jevman – AI decision models play Pac-Man

https://opper.ai/jevman-benchmark/
36•felix089•9h ago•5 comments

Scaling and benchmarking a critical message bus using a new indexing strategy

https://blog.janestreet.com/scaling-and-benchmarking-a-critical-message-bus/
16•eatonphil•8h ago•0 comments

Archaeologists Are Reconstructing the 'Invisible' Technologies of the Stone Age

https://www.smithsonianmag.com/science-nature/archaeologists-are-reconstructing-the-invisible-tec...
109•Hooke•1d ago•50 comments

US man given prison sentence for bot-farming music streams

https://thequietus.com/news/us-man-given-prison-sentence-for-bot-farming-music-streams/
119•cdrnsf•1d ago•195 comments

Show HN: Pocketty – iPhone SSH terminal that pings you when an agent is blocked

https://pocketty.app/
25•lukeed•8h ago•10 comments

Show HN: Rgpu – a PyTorch device whose tensors live on a remote GPU

https://github.com/ymcrcat/rgpu
41•boxstream•1d ago•3 comments

Orkut.com

https://orkut.com/
151•andreynering•12h ago•105 comments

I gave Opus 5.5 one prompt and six hours to visualize Invisible Cities

https://quesma.com/blog/invisible-cities-one-shot/
364•stared•14h ago•186 comments

The Slow Formation of Durable Software

https://newsletter.dancohen.org/archive/the-slow-formation-of-durable-software/
262•benbreen•2d ago•110 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.