Recent submissions

Comment · 3 days ago

  for(size_t i = count-1; i < count; --i)
'i < count' always works for unsigned, it's why I prefer unsigned for indices, only one invariant to maintain.
Comment · 7 days ago
Can we get interesting UIs in general back? I hate all modern games with UIs (especially the fonts) that look like a generic corporate website. Yes yes, I know, accessibility, bla bla, make two versions then, should be easy enough now with AI.
Comment · 1 month ago
Umbrella vs Skynet timeline race, yay!
Comment · 1 month ago
>where hundreds or thousands of parallel threads continuously create and destroy short-lived small and medium objects.

Should one even want a global, general purpose heap allocator for that? Seems like a crazy idea to even consider.

Comment · 1 month ago
I was thinking something along the lines of making a mistake when inputing the initial statement, like you wanted to prove that '2 is even' but what you actually stated was that '3 is odd'.

Of course in this simple example it's obvious, but my assumption was that these machine generated lean proofs are millions of lines of code and who knows what they actually say..

Comment · 1 month ago
Maybe a naive question, but how does one know that a particular lean proof is actually a proof of what one thinks? Like, ok the logic checks out and it proves something, but there's still the problem of does this logical result actually prove the initial question that was asked?
Comment · 4 months ago
Most people in the world wants some form of ethnic cleansing - that's why you get 'ethnic quarters' in most large cities, people generally like to be around their own 'kind'.
Comment · 4 months ago
Current LLMs don't pass the turing test.

Remember, the interrogator is allowed to be hostile, so they would obviously employ all known prompt injections and typical LLM 'gotchas' to figure out who the AI is.

Comment · 5 months ago
>There's no namespacing feature provided so you're left with the convention of picking a few letters as a prefix and hoping it doesn't overlap and yet is succinct enough to not be annoying.

I've been using C on a daily basis for 30+ years and name collisions has just never been a problem.

Granted, it might be due to lack of a package manager so micro dependencies ala import is_even is not a thing here, but still, in practice, no name collions occurs.

Comment · 5 months ago
Chinese film having 100% chinese cast = good.

American film having a single white male lead = not good.

Comment · 5 months ago
Never quite understood why people are so obsessed with meta programming capabilities in a language, be it templates, comptime, macros, whatever.

I program mostly in C, if I need 'meta' programming I just write another C program that processes C source code (I've written a simple C parser), then in my build script I build in two stages, build meta program, run it, build rest of program.

Simple, effective, debuggable (the meta program is just normal C), infinite capabilities - can nest this to arbitritary depths, need meta-meta programming? Make a program that generates a meta program.

Comment · 5 months ago
>One need to write it manually each time in each function where some cleanup is needed.

You can structure your code to not need cleanup in every function.

The biggest problem with destructors is, how do you handle errors? close() can fail you know?

Comment · 5 months ago
One reason is that c++ still hasn't gotten 'trivial relocatability' right - i.e being able to memcpy/memmove and not have to call constructors/destructors when growing your vector class.
Comment · 6 months ago
Yeah I dont think a single current LLM would fool me in a turing test - I would obiously use all kinds of prompt injection techniques, ask about 'dangerous' or controversial topics, ask about random niche facts in varied fields, etc.
Comment · 6 months ago
std span is not bounds checked.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton