frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

NSA advises immediate transition to post-quantum cryptography

https://www.nsa.gov/Press-Room/Press-Releases-Statements/Press-Release-View/Article/4662430/nsa-a...
816•intunderflow•3h ago•525 comments

The end of freelance web development

https://marcarea.com/weblog/2026/11/04/ai-and-me
60•vishnugupta•1h ago•28 comments

Subminute CI

https://engineering.moab.com/posts/subminute-ci/
67•tamentis•1h ago•19 comments

Ask HN: Who is hiring? (December 2026)

75•whoishiring•1d ago•158 comments

Amber Eye: a Slay the Spire engine approaching top-level play

https://8e9f.github.io/amber_eye/
19•gcmeplz•23m ago•0 comments

CellGemma – Model built to help accelerate discovery of new cancer therapies

https://deepmind.google/models/gemma/cellgemma/
513•estebandalelr•10h ago•107 comments

Finding faster quantum algorithms with agents and formal verification

https://deepmind.google/blog/finding-faster-quantum-algorithms-with-agents-and-formal-verification/
52•rbanffy•2h ago•9 comments

Nvidia Partners with SpaceX to Launch Datacenters into Space

https://www.nextplatform.com/compute/2026/12/02/nvidia-partners-with-spacex-to-launch-datacenters...
65•jonbaer•3h ago•171 comments

Kagi Us-East4 Outage

https://status.kagi.com/cmx6g51q90c2t1bp7gdhw9x95
38•natebc•44m ago•2 comments

Don't Trust People Who Talk Like This

https://www.honest-broker.com/p/dont-trust-people-who-talk-like-this
706•baud147258•6h ago•336 comments

Ask HN: Who wants to be hired? (December 2026)

28•whoishiring•1d ago•360 comments

Show HN: Warpspec – TLA+ model checking on a GPU, 4,600× faster than TLC

https://praveenperera.com/blog/tla-model-checking-4600x-faster-on-a-gpu/
41•praveenperera•3h ago•3 comments

Friends don't let friends build search on object stores

https://www.unum.cloud/blog/usearch-v3-for-cpus-gpus-ssds
13•ashvardanian•5h ago•3 comments

Ford Recalls over 700k Cars After Two Deaths from Carbon Monoxide Poisoning

https://www.wsj.com/business/autos/ford-recall-carbon-monoxide-poisoning-6ae4f2b8
66•bookofjoe•1h ago•60 comments

John V. Blankenbaker, the maker of the Kenbak-1 computer, has died

https://www.kenbak.com/johnblankenbaker
10•linker3000•1d ago•0 comments

Fortnite is now available on Linux through Proton

https://twitter.com/FortniteStatus/status/2128130519758234032
41•tosh•1h ago•10 comments

AI 'prepping' for the medium term

https://anil.recoil.org/notes/ai-prepping
111•nerdypepper•2h ago•133 comments

Gemini 4 Live and Gemini 4 Live Translate

https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-4-live-gemini-4-li...
61•meetpateltech•1h ago•6 comments

Lawmakers describe 'willful blindness' by Nvidia's Huang about national security

https://www.npr.org/2026/12/01/nx-s1-6059384/congress-nvidia-jensen-huang-hearings
73•blinding-streak•2h ago•41 comments

Autostep (YC P26) Is Hiring – AI/Software Engineering Contractor

https://jobs.dover.com/autostep/6464a6d6-7483-4496-83c3-4e373e7b9244
1•adawg4•7h ago

Show HN: Pryzmera – Fast PDF viewer, over 1200x faster rendering than Acrobat

https://pryzmera.com/
9•RedMindZ•3h ago•0 comments

Laravel Go

https://github.com/laravel/go
65•adrianthedev•45m ago•59 comments

Code-driven AI illustrations are more useful than images from image models

https://simonwillison.net/2026/Nov/28/code-driven-ai-illustrations/
428•gmays•17h ago•194 comments

Advent of Code 2026

https://adventofcode.com/
691•saisundar•2d ago•652 comments

GameMaker adopts Godot's AI policy, hoping to establish consistency

https://gamemaker.io/en/blog/gamemaker-ai-contributions
167•ivorius•4h ago•154 comments

TinyGo 0.45.0

https://github.com/tinygo-org/tinygo/releases/tag/v0.45.0
287•iaaan•15h ago•44 comments

SubQSavant: 4M Context Window LLM

https://subq.ai/
14•sunbum•2h ago•2 comments

The Bitter Lesson Ate Your AI Factory

https://zmievsa.org/posts/the-bitter-lesson-ate-your-ai-factory/
307•adtovkat•7h ago•247 comments

OpenMono: The open-source mono font

https://openmono.com/
341•hn-aarvin•16h ago•106 comments

Bacteria linked to inflammatory bowel disease identified with help from gamers

https://today.ucsd.edu/story/bacteria-linked-to-inflammatory-bowel-disease-identified-with-help-f...
371•gmays•22h ago•125 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.