frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

The end of Microsoft Research's AI Frontiers group

https://hunch.net/?p=13764006
386•srean•7h ago•224 comments

GitHub New pull request overview page in public preview

https://github.blog/changelog/2026-11-05-new-pull-request-overview-page-in-public-preview/
58•xiaoyu2006•2h ago•37 comments

What I run on my $10 USD OpenStick homelab

https://blog.bosscher.ch/posts/openstick/
337•LaurensBER•7h ago•83 comments

Apple’s grey list: Words and phrases your iPhone won’t help you spell

https://www.theguardian.com/technology/2026/nov/06/struggling-to-spell-male-chauvinist-pig-apple-...
358•user_7832•8h ago•240 comments

Making any integer with four 2s (2025)

https://eli.thegreenplace.net/2025/making-any-integer-with-four-2s/
56•germanrabbit•3h ago•12 comments

Claude Code's "Don't Ask Again" exposes passwords in 1,122 public GitHub files

https://apiiro.com/blog/coding-agents-leaking-secrets-github-dont-ask-again
180•shmulc•5h ago•125 comments

Uranium cubes reveal why the German nuclear project failed

https://arstechnica.com/science/2026/11/uranium-cubes-reveal-why-the-german-nuclear-project-failed/
66•rbanffy•2d ago•22 comments

Show HN: Coldframe, a honeypot that poses as a supermarket fridge controller

https://github.com/hedgerow-dev/coldframe
193•hedgerow-dev•8h ago•40 comments

MaxxBench – "Nice DeepSWE score. But is it true?"

https://maxxbench.unlap.ai/research/why-maxxbench/
204•antiuniverse•8h ago•60 comments

Need for Speed Underground 2 online in the browser

https://nfsu2.xyz/
821•fluxusars•16h ago•226 comments

Commodore PET – The Worlds First Personal Computer

https://www.commodore.ca/commodore-products/commodore-pet-the-worlds-first-personal-computer/
18•andsoitis•2h ago•1 comments

Every Mac comes with an (undocumented) family member classifier

https://8rank.ai/game/apple-intelligence-personal-knowledge-graph
604•infwhispers•16h ago•346 comments

Turning Every Radio into a Radar

https://tiaminetworks.com/turning-every-radio-into-a-radar/
31•hasley•4d ago•6 comments

Study solved a 150-year-old mystery into the identity of the extinct giant crane

https://www.bournemouth.ac.uk/news/2026-10-28/study-has-solved-150-year-old-mystery-identity-exti...
12•gmays•3d ago•0 comments

Five memorable books about programming (2008)

https://prog21.dadgum.com/19.html
83•andsoitis•8h ago•54 comments

Every Windows 11 app should kill Electron, and Discord just showed why

https://www.windowslatest.com/2026/11/06/every-windows-11-app-should-kill-electron-and-discord-ju...
218•thunderbong•14h ago•211 comments

Retro Song Bird: Plug in any Game Boy cartridge to hear the soundtrack

https://www.retrosongbird.com/
38•hentrep•10h ago•10 comments

Show HN: Where Were We

https://wherewerewe.app/
23•zkiihne•4h ago•9 comments

Show HN: An offline desktop companion to help maintain a healthy blink rhythm

https://eyesrhythm.com/
25•prnysoni•4h ago•11 comments

The $8 Linux Computer (2022)

http://thelittleengineerthatcould.blogspot.com/2022/12/the-8-linux-computer.html
196•zenincognito•11h ago•84 comments

IRA Velinsky – Commodore's Industrial Designer

https://www.commodore.ca/commodore-history/ira-velinsky-commodores-amazing-industrial-designer/
10•erickhill•3h ago•0 comments

GeoWorks, Microsoft Windows' Upstart '90s Competitor (2016)

https://www.atlasobscura.com/articles/the-history-of-geoworks-microsoft-windows-upstart-90s-compe...
43•andsoitis•7h ago•17 comments

Text.js: Build full-stack React apps that render inside console.log

https://textjs.org/
82•nateb2022•3d ago•47 comments

Every processor die anyone has photographed and given away

https://sheets.works/data-viz/cpu-dies
77•user_7832•9h ago•16 comments

Terry Pratchett's Study

https://www.sussi.dk/terry-pratchetts-study
102•ColinWright•9h ago•27 comments

Running a law firm on Free software

https://decoded.legal/blog/2026/11/running-a-law-firm-on-free-software-2026-edition/
236•DeepLogin•16h ago•116 comments

Asahi Linux Progress Linux 7.3

https://asahilinux.org/2026/11/progress-report-7-3/
323•ackyshake•20h ago•261 comments

Shadow of the Sun (2021)

https://mattlakeman.org/2021/07/27/shadow-of-the-sun/
20•andsoitis•4h ago•4 comments

How Long Can Life Wait?

https://mceglowski.substack.com/p/how-long-can-life-wait
128•Ariarule•9h ago•77 comments

Shipping 103,802 Dots in 82 KB

https://layers.engineering/shipping-103-802-dots-in-82-kb-b4f7d3a89779
7•speckx•4d ago•0 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.