Better HN
topnewbestaskshowjobs
Log inSign up

reillyrider

15 karma · joined Nov 19, 2026 (1w ago) · 9 submissions

Submissions

comment 3d ago · link · parent

Take a look at raddebugger, it's written in C.

It compiles instantly (a full debug rebuild), starts instantly, have really nice GUI and are insanely fast and responsive. The codebase is very understandable and easy to hack on, and has as set of great abstractions that make all the supposedly annoying things in C (strings, memory allocation, multi threading) quite nice to use.

If you insist on using the C standard library and malloc()ing all over the place, using null terminated strings, complicated lifetime hierarchies and infinitely "generic code" (where you end up using max 1 or 2 different implementations/types in the end), then yes, you will have a bad time in C, but how about just not doing that?

comment 4d ago · link · parent

The failure for unsigned is usually much easier to catch because it typically leads to instant crash (ptr[index] with index being close to 2^64 is pretty much always a seg fault) whereas index being signed and -1 usually "works" to read and write to, but has subtle problems.

comment 4d ago · link · parent

But why do you need a new language feature for that?

If statements can do guaranteed enforcement of bounds och null checks.

comment 4d ago · link · parent

If someone can afford a PC powerful enough to play GTA6, surely they can afford $100 for the game as well.

comment 5d ago · link · parent

Format strings in C are generally assumed to be valid, so it's a precondition to use the function.

comment 1w ago · link · parent

Why would anyone prefer signed for indexing and sizes?

With unsigned you only need one check: 'i < bound', it works always, regardless how i is computed, and it doesn't matter if the calculation overflowed or wrapped around, still works.

With signed you need: 'i >= 0 && i < bound', and you need to be very careful how you calculate i because overflow is undefined behavior.

comment 1w ago · link · parent

I'm not really sure about AI CAD. The things I CAD are very specific, I can't just go "give me a generic box", it needs to be these exact dimensions, it needs to have cutouts at this position with this size, it needs holes at this spot, manufactured with these materials and tolerances, then I need this all nicely parametric and easy to change. If I need to put that many specific details in my prompt (and then double check the work afterwards) I might as well just do it myself.

And how would iteration look like? It's a million times faster and easier to just navigate around a 3d model, click on the feature to edit, start editing. Describing which feature for the AI to change seems like a nightmare.

comment 1w ago · link · parent

I mourn the loss of private dedicated servers for multiplayer games. I guess the mainstream player likes matchmaking or "invite a friend", but I just hate it. There was something special about becoming a regular on some server, get to know other regulars, the admins, chit chat on the forums, teaching new players the ropes, etc.

comment 1w ago · link · parent

It's because of shitty cowboy C.

Writing *p++ = c;

to append to a buffer is just insanity, I don't know why so many people like to write "clever" code like this.

I have a buf_putc(struct buf *b, int c); which does bounds checking (and potentially growing the memory), and I've used this kind of abstraction for decades.

Same with "use after free" bugs, WHY are people malloc()ing and free()ing all over the place, and storing away pointers to things all over the place (people just looove their "objects" and stuffing pointers to things into structs and classes so now you have these insane lifetime couplings).

Ban pointer arithmetic, ban null terminated strings, ban malloc() and free() (and similar general purpose allocators), ban passing arrays without a length (and preferable have a struct ptrlen {} and pass it by value) and you eliminate 99.9999% of these bugs.

Multi threading in C is genuinely difficult because you get zero help from the compiler, but these low hanging bounds and lifetime problems can easily be eliminated with simple abstractions.