frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Jurassic Park computers in excruciating detail

https://fabiensanglard.net/jurrasic_park_computers/index.html
164•vinhnx•2h ago•39 comments

Vancouver PD website features Quick Escape button that wipes itself from history

https://vpd.ca/
202•LookAtThatBacon•5h ago•73 comments

TS-2026-009: Insecure argument handling in Tailscale SSH permitted root access

https://tailscale.com/security-bulletins
90•jervant•4h ago•38 comments

Bonsai 27B: A 27B-Class model that runs on a phone

https://prismml.com/news/bonsai-27b
514•xenova•11h ago•186 comments

Dependabot version updates introduce default package cooldown

https://github.blog/changelog/2026-07-14-dependabot-version-updates-introduce-default-package-coo...
145•woodruffw•8h ago•83 comments

The Tower Keeps Rising

https://lucumr.pocoo.org/2026/7/13/the-tower-keeps-rising/
408•cdrnsf•12h ago•181 comments

Financing the AI boom: from cash flows to debt [pdf]

https://www.bis.org/publ/bisbull120.pdf
128•1vuio0pswjnm7•7h ago•75 comments

Cursor 0day: When Full Disclosure Becomes the Only Protection Left

https://mindgard.ai/blog/cursor-0day-when-full-disclosure-becomes-the-only-protection-left
307•Synthetic7346•11h ago•146 comments

Solving 20 Erdős Problems with 20 Codex Accounts Running in Parallel

https://www.starfleetmath.com/
97•colin7snyder•5h ago•38 comments

Andon (manufacturing)

https://en.wikipedia.org/wiki/Andon_(manufacturing)
12•tony•3d ago•1 comments

How I use HTMX with Go

https://www.alexedwards.net/blog/how-i-use-htmx-with-go
167•gnabgib•9h ago•39 comments

How to stop Claude from saying load-bearing

https://jola.dev/posts/how-to-stop-claude-from-saying-load-bearing
477•shintoist•17h ago•524 comments

LeMario: Training a JEPA World Model on Super Mario Bros

https://www.benjamin-bai.com/projects/lemario
72•kevinjosethomas•7h ago•10 comments

Microsoft Patches a Record 570 Security Flaws

https://krebsonsecurity.com/2026/07/microsoft-patches-a-record-570-security-flaws/
80•robin_reala•8h ago•36 comments

The bread paradox: why convenience always wins, and why SaaS isn't doomed

https://www.joanwestenberg.com/p/the-bread-paradox-why-convenience
32•srijan4•1d ago•10 comments

Data centers have hiked electricity prices on the public by $23B

https://fortune.com/2026/07/14/data-centers-23-billion-electricity-bills/
147•measurablefunc•5h ago•85 comments

I'm a USB-C Maximalist

https://shkspr.mobi/blog/2026/07/im-a-usb-c-maximalist/
223•speckx•14h ago•320 comments

Mathematical texts from a Maya site in Guatemala identify an ancient astronomer

https://www.nature.com/articles/d41586-026-02170-8
64•homarp•17h ago•16 comments

The largest available Minecraft world, totalling 15 TB

https://2b2t.place/1million
187•_____k•3d ago•61 comments

The Trade in Looted Antiquities Endures for One Reason: Demand

https://news.artnet.com/art-world/matt-campbell-cambodia-looted-antiquities-2779870
11•derbOac•2d ago•3 comments

The kids with phones are alright

https://heatherburns.tech/2026/07/08/the-kids-with-phones-are-alright/
170•JumpCrisscross•3d ago•120 comments

An unusual way for your DHCP server to run out of dynamic IPs

https://utcc.utoronto.ca/~cks/space/blog/sysadmin/DHCPServerAndScreamingHost
45•speckx•4d ago•10 comments

The zero-cost fallacy: open-source software in the agentic era

https://www.thoughtworks.com/insights/blog/open-source/zero-cost-fallacy-open-source-agentic-era
132•backlit4034•4d ago•100 comments

Probably check on your smart appliances

https://xeiaso.net/notes/2026/check-your-smart-tv/
50•xena•7h ago•18 comments

The Estranged Worlds of J. G. Ballard

https://lareviewofbooks.org/article/jg-ballard-illuminated-man-christopher-priest-nina-allan/
46•Caiero•1d ago•9 comments

Show HN: Juggler – an open-source GUI coding agent, by the creator of JUCE

https://github.com/juggler-ai/juggler
211•julesrms•2d ago•86 comments

Are we offloading too much of our thinking to AI?

https://www.artfish.ai/p/offloading-thinking-to-ai
417•yenniejun111•14h ago•407 comments

Guardian Angels: LLM Personalization for Productivity and Security

https://gwern.net/guardian-angel
78•andsoitis•16h ago•13 comments

Kontigo (YC S24) Is Hiring (Head of Security)

https://www.ycombinator.com/companies/kontigo/jobs/uNttrlv-head-of-security
1•jecastillof•12h ago

Ambient Website Background Clouds

https://github.com/paradise-runner/background-clouds
16•dividedcomet•5d ago•4 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.