frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Antirender: remove the glossy shine on architectural renderings

https://antirender.com/
159•iambateman•46m ago•45 comments

Bluesky 2025 Transparency Report

https://bsky.social/about/blog/01-29-2026-transparency-report-2025
23•emschwartz•21h ago•1 comments

Peerweb: Decentralized website hosting via WebTorrent

https://peerweb.lol/
8•dtj1123•11m ago•10 comments

Best Gas Masks

https://www.theverge.com/policy/868571/best-gas-masks
21•cdrnsf•1d ago•2 comments

Kimi K2.5 Technical Report [pdf]

https://github.com/MoonshotAI/Kimi-K2.5/blob/master/tech_report.pdf
93•vinhnx•4h ago•38 comments

The National Herbarium of Ireland digital collection of Irish plants

https://dri.ie/news/new-collection-in-dri-the-national-herbarium-of-ireland-digital-collection-of...
67•gnabgib•3d ago•7 comments

Disrupting the largest residential proxy network

https://cloud.google.com/blog/topics/threat-intelligence/disrupting-largest-residential-proxy-net...
9•cdrnsf•1d ago•1 comments

Moltbook

https://www.moltbook.com/
1085•teej•16h ago•527 comments

Software Survival 3.0

https://steve-yegge.medium.com/software-survival-3-0-97a2a6255f7b
13•jaybrueder•1d ago•6 comments

Building docs like a product

https://emschwartz.me/building-docs-like-a-product/
10•emschwartz•23h ago•0 comments

OpenClaw – Moltbot Renamed Again

https://openclaw.ai/blog/introducing-openclaw
550•ed•15h ago•284 comments

The engineer who invented the Mars rover suspension in his garage [video]

https://www.youtube.com/watch?v=QKSPk_0N4Jc
208•UltraSane•3d ago•31 comments

Email experiments: filtering out external images

https://www.terracrypt.net/posts/email-experiments-image-filtering.html
7•todsacerdoti•8h ago•1 comments

A judge gave the FBI permission to attempt to bypass biometrics

https://theintercept.com/2026/01/30/washington-post-hannah-natanson-fbi-biometrics-unlock-phone/
62•qingcharles•1h ago•47 comments

Self Driving Car Insurance

https://www.lemonade.com/car/explained/self-driving-car-insurance/
36•KellyCriterion•5h ago•91 comments

HTTP Cats

https://http.cat/
74•surprisetalk•6h ago•16 comments

Mamdani to kill the NYC AI chatbot caught telling businesses to break the law

https://themarkup.org/artificial-intelligence/2026/01/30/mamdani-to-kill-the-nyc-ai-chatbot-we-ca...
94•jyunwai•2h ago•16 comments

Quack-Cluster: A Serverless Distributed SQL Query Engine with DuckDB and Ray

https://github.com/kristianaryanto/Quack-Cluster
50•tanelpoder•3d ago•10 comments

Implementing a tiny CPU rasterizer (2024)

https://lisyarus.github.io/blog/posts/implementing-a-tiny-cpu-rasterizer-part-1.html
84•PaulHoule•4d ago•15 comments

The Home Computer Hybrids

https://technicshistory.com/2026/01/25/the-home-computer-hybrids/
19•cfmcdonald•5d ago•8 comments

Buttered Crumpet, a custom typeface for Wallace and Gromit

https://jamieclarketype.com/case-study/wallace-and-gromit-font/
195•tobr•5h ago•40 comments

Code is cheap. Show me the talk

https://nadh.in/blog/code-is-cheap/
114•ghostfoxgod•8h ago•102 comments

Pangolin (YC S25) is hiring software engineers (open-source, Go, networking)

https://docs.pangolin.net/careers/join-us
1•miloschwartz•8h ago

Show HN: Amla Sandbox – WASM bash shell sandbox for AI agents

https://github.com/amlalabs/amla-sandbox
94•souvik1997•6h ago•63 comments

Emoji Design Convergence Review: 2018-2026

https://blog.emojipedia.org/emoji-design-convergence-review-2018-2026/
38•surprisetalk•3d ago•26 comments

How AI assistance impacts the formation of coding skills

https://www.anthropic.com/research/AI-assistance-coding-skills
347•vismit2000•15h ago•278 comments

Painless Software Schedules (2000)

https://www.joelonsoftware.com/2000/03/29/painless-software-schedules/
41•MonkeyClub•4d ago•28 comments

Ode to the AA Battery

https://www.jeffgeerling.com/blog/2026/ode-to-the-aa-battery/
121•Brajeshwar•6h ago•115 comments

Vcad: Free BRep CAD in the Browser

https://vcad.io
36•ecto•4h ago•13 comments

Wisconsin communities signed secrecy deals for billion-dollar data centers

https://www.wpr.org/news/4-wisconsin-communities-signed-secrecy-deals-billion-dollar-data-centers
292•sseagull•7h ago•322 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•8mo ago

Comments

wahern•8mo 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•8mo 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•8mo ago
What language is that? Is it available everywhere (everywhere) C is?
mitthrowaway2•8mo 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•8mo 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•8mo 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•8mo ago
Learning such a language doesn’t mean I can use it.
o11c•8mo 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•8mo 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•8mo 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•8mo ago
This reminds me of the days when Boost was a thing. It was full of tricks like this.
usrnm•8mo ago
It still is a thing, though.
cperciva•8mo 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•8mo 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.