frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Synadia and TigerBeetle Commit $512k USD to the Zig Software Foundation

https://www.synadia.com/blog/synadia-tigerbeetle-zig-foundation-pledge
151•derekcollison•1h ago•23 comments

Making a micro Linux distro (2023)

https://popovicu.com/posts/making-a-micro-linux-distro/
48•turrini•2h ago•12 comments

React vs. Backbone in 2025

https://backbonenotbad.hyperclay.com/
158•mjsu•5h ago•114 comments

DNA reveals the real killers that brought down Napoleon's army

https://www.gavi.org/vaccineswork/dna-reveals-real-killers-brought-down-napoleons-army
20•janandonly•1h ago•23 comments

The future of Python web services looks GIL-free

https://blog.baro.dev/p/the-future-of-python-web-services-looks-gil-free
59•gi0baro-dev•6d ago•13 comments

Unlocking free WiFi on British Airways

https://www.saxrag.com/tech/reversing/2025/06/01/BAWiFi.html
430•vinhnx•1d ago•99 comments

The Swift SDK for Android

https://www.swift.org/blog/nightly-swift-sdk-for-android/
595•gok•19h ago•239 comments

People with blindness can read again after retinal implant and special glasses

https://www.nbcnews.com/health/health-news/tiny-eye-implant-special-glasses-legally-blind-patient...
201•8bitsrule•4d ago•58 comments

Valetudo: Cloud replacement for vacuum robots enabling local-only operation

https://valetudo.cloud/
336•freetonik•5d ago•138 comments

First shape found that can't pass through itself

https://www.quantamagazine.org/first-shape-found-that-cant-pass-through-itself-20251024/
469•fleahunter•1d ago•130 comments

Key IOCs for Pegasus and Predator Spyware Removed with iOS 26 Update

https://iverify.io/blog/key-iocs-for-pegasus-and-predator-spyware-cleaned-with-ios-26-update
131•transpute•12h ago•78 comments

The State of Machine Learning Frameworks in 2019

https://thegradient.pub/state-of-ml-frameworks-2019-pytorch-dominates-research-tensorflow-dominat...
6•jxmorris12•3d ago•3 comments

Study: MRI contrast agent causes harmful metal buildup in some patients

https://www.ormanager.com/briefs/study-mri-contrast-agent-causes-harmful-metal-buildup-in-some-pa...
188•nikolay•18h ago•159 comments

Context engineering is sleeping on the humble hyperlink

https://mbleigh.dev/posts/context-engineering-with-links/
128•mbleigh•2d ago•52 comments

Harnessing America's heat pump moment

https://www.heatpumped.org/p/harnessing-america-s-heat-pump-moment
186•ssuds•19h ago•383 comments

What is intelligence? (2024)

https://whatisintelligence.antikythera.org/
118•sva_•13h ago•75 comments

I invited strangers to message me through a receipt printer

https://aschmelyun.com/blog/i-invited-strangers-to-message-me-through-a-receipt-printer/
247•chrisdemarco•6d ago•95 comments

Public Montessori programs strengthen learning outcomes at lower costs: study

https://phys.org/news/2025-10-national-montessori-early-outcomes-sharply.html
327•strict9•2d ago•192 comments

The persistence of tradition: the curious case of Henry Symeonis (2023)

https://blogs.bodleian.ox.ac.uk/archivesandmanuscripts/2023/12/13/the-persistence-of-tradition-th...
19•georgecmu•2d ago•0 comments

Normalize.css

https://csstools.github.io/normalize.css/
54•Leftium•4d ago•35 comments

Code like a surgeon

https://www.geoffreylitt.com/2025/10/24/code-like-a-surgeon
191•simonw•23h ago•108 comments

The geometry of mathematical methods

https://books.physics.oregonstate.edu/GMM/book.html
45•kalind•5d ago•3 comments

Meet the real screen addicts: the elderly

https://www.economist.com/international/2025/10/23/meet-the-real-screen-addicts-the-elderly
203•johntfella•11h ago•201 comments

Twake Drive – An open-source alternative to Google Drive

https://github.com/linagora/twake-drive
338•javatuts•1d ago•199 comments

Diamond Thermal Conductivity: A New Era in Chip Cooling

https://spectrum.ieee.org/diamond-thermal-conductivity
38•rbanffy•4d ago•16 comments

Euro cops take down cybercrime network with 49M fake accounts

https://www.itnews.com.au/news/euro-cops-take-down-cybercrime-network-with-49-million-fake-accoun...
112•ubutler•8h ago•51 comments

Luau's performance

https://luau.org/performance
46•todsacerdoti•2d ago•8 comments

How to make a Smith chart

https://www.johndcook.com/blog/2025/10/23/smith-chart/
146•tzury•21h ago•26 comments

Why formalize mathematics – more than catching errors

https://rkirov.github.io/posts/why_lean/
202•birdculture•6d ago•68 comments

Fast TypeScript (Code Complexity) Analyzer

https://ftaproject.dev/
37•hannofcart•9h ago•13 comments
Open in hackernews

The fix wasn't easy, or C precedence bites

https://boston.conman.org/2025/10/20.1
24•ingve•3d ago

Comments

loeg•10h ago
There's another bug, where you don't update psrc in those error return cases. The parser will be stuck at the malformed % forever. Or maybe that is desired; it's hard to tell.

The precedence stuff here is pretty basic. When in doubt, using parentheses to make order explicit is never wrong. Or consult https://en.cppreference.com/w/c/language/operator_precedence... .

augustk•2h ago
Better stick to a single point of exit.

https://news.ycombinator.com/item?id=20311080

bsder•9h ago
Even as someone who doesn't mind writing in C, I would absolutely flag that function as way, way, way, way too terse for no good reason.

The code gets ridiculously easier to read if you write src[0] and src[1] instead of (*src) and (*(src+1)). And, as a bonus, the precedence problem disappears.

I really don't understand people why write C code like the original code. It's just asking for a bug.

shash•9h ago
In general avoid frivolous use of pointer arithmetic. foo[k] and *(foo+k) will usually generate identical asm, and the former is just easier to read…
danhau•1h ago
Usually? I‘m willing to bet it will always. I wouldn‘t be surprised if the standard even specifies these two to be identical.
cozzyd•49m ago
And if you want to go for eclectic, you can do [k]foo
spyrja•8h ago
And for the love of God, please don't do 0[src].
stevage•7h ago
To be fair, OP rewrote it as `src[1]`. It sounds like this was old code, maybe they weren't a good coder when they started.
commandersaki•6h ago
I know the precedence because I memorise the terse implementation of strcpy, but (also) write *src++ as *(src++) and even though it remains a bit of a mouthful the parenthesis ensures there is no doubt how to evaluate the expression.
hyghjiyhu•45m ago
For me it would be natural to use src[1] for an array but *(src+1) for an iterator pointer.
procaryote•7h ago
The code style on this makes my eyes bleed. It was a long time since I saw anyone do "if () single statement; else { block of statements }"

Making the first thing a block doesn't add any lines and makes it less brittle, and makes future diffs better

And they do some weird alignment of assignments, and for some reason carry on adding extra spaces for some assignments even when they're alone in a block?

And they go out of their way to do pointer arithmetic rather than array operations that are more readable

And the code is essentially sscanf(str, "%%%2x", &value) plus some checks, so why not write that instead?

Also what kind of psycho uses CppStyleFunctionNames() in C?

stevage•7h ago
Tbh it's been a while since I've seen anyone manually format code. Automatically formatted code definitely does help avoid certain kinds of bugs.

Does C not have the equivalent of Prettier?

I am curious what their editing process was that changed:

> assert(isxdigit((src+1)));

to

> if (!isxdigit(

src+1)) return '\0';

commandersaki•6h ago
Does C not have the equivalent of Prettier?

There is clang-format, but it is not always easy to use on a code base because you don't want to have it run on imported/3rd party source which may mix in with your regular source tree. I've been meaning to use it on a project but only have run on an explicit list of files.

ciupicri•3h ago
There's the good old GNU indent https://www.gnu.org/software/indent/

> But even if you fail in getting emacs to do sane formatting, not everything is lost: use indent.

> Now, again, GNU indent has the same brain-dead settings that GNU emacs has, which is why you need to give it a few command line options. However, that’s not too bad, because even the makers of GNU indent recognize the authority of K&R (the GNU people aren’t evil, they are just severely misguided in this matter), so you just give indent the options -kr -i8 (stands for K&R, 8 character indents), or use scripts/Lindent, which indents in the latest style.

> indent has a lot of options, and especially when it comes to comment re-formatting you may want to take a look at the man page. But remember: indent is not a fix for bad programming.

(Linux kernel coding style, https://www.kernel.org/doc/html/latest/process/coding-style....)

9029•2h ago
> I am curious what their editing process was

They said:

> I typed in the new code as that's faster than modifying the existing code

stevage•2h ago
Ah. I bet there's a lot of vim users violently disagreeing...
lastdong•6h ago
I was thinking the same thing; also being more explicit would have prevented the bug described in the first place
zabzonk•5h ago
> Also what kind of psycho uses CppStyleFunctionNames() in C?

People influenced by the Win32 C API. I prefer it that way myself.

pjmlp•3h ago
That style predates Windows.
GabrielTFS•2h ago
I would guess a significant portion of people using the style (if not most), did so inspired by Windows, though
pjmlp•1h ago
It was common across all not UNIX operating systems.

You will find it on MS-DOS, Amiga, OS/2, Mac OS.

It was based on what was common in ALGOL derived languages.

On UNIX you will find it on X Windows, and Motif.

uxp100•17m ago
Macintosh toolbox was Pascal first right? Or at least there was an era where it was. And I think this naming convention is kinda a pascal thing.
pjmlp•12m ago
Yes, Apple is the actual creator of Object Pascal variant, and there was a Pascal based OS using P-Code for Apple II GS.
foofoo12•7h ago
It's really easy to add a remote code execution feature to your project, especially if you code like this. You might even add that feature subconsciously at 3am, while hacking on a different feature.
johnfn•6h ago
Is this really a difficult precedence issue? It seems quite obvious to me that *foo + 1 parses as (*foo) + 1.

One that has gotten me more than once in Python (I really don’t code Python that much) is “1 + 2 if True else 3”. I keep thinking the parenthesis are “1 + (2 if True else 3)”, but it’s actually (1 + 2). Or am I lying to you and it’s the other way around?! I don’t know, why don’t you go check the Python interpreter :)

afiori•6h ago
I have often felt this doubt but the only two cases where my intuition was actually wrong was with `new` operators and php's ternary operator
ErroneousBosh•6h ago
Yes but as I said yesterday on another post, "Yngwie Malmsteen Code".

You could write it clearly by saying foo[1] instead of *(foo+1) which is what they ended up doing, but hey, pointer arithmetic looks complicated and clever, so let's show off with a WEEDLYWEEDLYWEEDLY guitar solo bit of code.

jolmg•2h ago
Conditional expressions/operators, including e.g. the `?:` ternary operator in C-like languages, typically have about the lowest precedence, higher only than the assignment operators (and the comma operator in C-like languages). It's not just a Python thing; you'll find `+` having higher precedence basically everywhere.

Think of

  x = 1 + 2 if True else 3
like a shorthand for:

  if True:
    x = 1 + 2
  else:
    x = 3
which can be a common pattern in languages that don't really have conditional expressions, like bash.
II2II•2h ago
> Is this really a difficult precedence issue? It seems quite obvious to me that foo + 1 parses as (foo) + 1.

Keep in mind that precedence rules are arbitrary constructs, typically based upon what the rule maker perceived as more convenient. Perceptions will vary from person to person, so there is no objective obvious about them. Heck, there isn't even anything obvious about infix notation (see Forth or Lisp). Or, in the case of unary operators, it isn't obvious that the operator should come before or after the object it is operating on (consider how we negate as a prefix, while factorial is a suffix).

magicalhippo•2h ago
I really dislike relying on precedence when it's more complicated than a few terms of basic arithmetic.

Parentheses are free and makes it absolutely clear what the intention is.

Surac•4h ago
I have a little cheat sheet sticking on the side of my monitor that I update everything I have to look up some syntax. There I have a table on operator precedence and a reminder when to use & and &&. I never need the sheet but I always have ist in clear eyesight
abanana•3h ago
> I never need the sheet

Often, just the act of making a cheat sheet somehow helps to fix the principles in the brain, so you rarely if ever need to refer to it afterwards. Something I've personally found multiple times anyway.