frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

A generic dynamic array in C that stores no capacity and needs no struct

https://gist.github.com/alurm/2ca14be134d719fe7431217a6b18d91e
7•alurm•3h ago

Comments

t-3•1h ago
No structs, just an array that accomplishes the same thing, without field names or other niceties. Enjoy the pleasure of not using a struct when you inevitably add/reduce/reorder fields later.
hibberl7•40m ago
Yeah this is nuts. It's like someone just discovered casting so they can be really clever and use the first pointer in an array for something non-pointy.

I can't make any sense of the aversion to a struct. Use a struct. You don't have to give its type a name, if that's the motivation here.

gritzko•1h ago
https://github.com/gritzko/libabc/blob/main/Sx.h

https://github.com/gritzko/libabc/blob/main/S.md

ABC uses s[2] for slices, g[3] for gauges, b[4] for (ring) buffers. Also containers on top of those (heaps, hash sets, etc etc)

userbinator•33m ago
capacity isn't stored at all. Instead, it's computed on demand when the length of the vec is either zero or a power of two.

Brilliant insight. This is the first time I've seen this observation in over 3 decades of working with C.

Akronymus•27m ago
That's pretty clever code. Too clever for my tastes.
senderista•21m ago
This is just silly. You can't even reserve capacity because you only store size and capacity is implicitly the next power of 2 >= size.
dooglius•4m ago
Strictly speaking, the capacity is still stored internally to the allocation (it needs to be, in order to implement realloc)

There is a shadow hanging over this Fable thing

https://12gramsofcarbon.com/p/tech-things-there-is-a-massive-shadow
74•theahura•1h ago•22 comments

Statement on US government directive to suspend access to Fable 5 and Mythos 5

https://www.anthropic.com/news/fable-mythos-access
1834•Dylan1312•5h ago•1389 comments

Electric motors with no rare earths

https://www.renaultgroup.com/en/magazine/energy-and-powertrains/all-about-electric-motors-with-no...
369•bestouff•8h ago•93 comments

Shepherd's Dog: A Game by the Most Dangerous AI Model

https://koenvangilst.nl/lab/claude-fable-shepherds-dog
12•vnglst•53m ago•4 comments

CRISPR tech selectively shreds cancer cells, including "undruggable" cancers

https://innovativegenomics.org/news/crispr-technique-selectively-shreds-cancer-cells/
780•gmays•15h ago•188 comments

On CPU Physics and CPU Cycles

https://6it.dev/blog/on-cpu-physics-and-cpu-cycles-80730
21•signa11•2h ago•4 comments

Open source AI must win

https://opensourceaimustwin.com/?share=v2
675•vednig•4h ago•213 comments

The Future of wasi-gfx and wasi:webgpu

https://wasi-gfx.dev/blog/posts/future-of-wasi-gfx/
18•mendyberger•3d ago•1 comments

Show HN: Putt.day a daily mini golf game

https://putt.day/
139•ellg•7h ago•67 comments

Twenty One Zero-Days in FFmpeg

https://depthfirst.com/research/21-zero-days-in-ffmpeg
172•redbell•8h ago•101 comments

The computer science degree isn’t dead

https://spectrum.ieee.org/computer-science-degree-isnt-dead
53•jnord•3d ago•44 comments

How to setup a local coding agent on macOS

https://ikyle.me/blog/2026/how-to-setup-a-local-coding-agent-on-macos
337•kkm•13h ago•81 comments

Show HN: Lightweight Task queue on Erlang/OTP, SQLite-backed, no overengineering

https://github.com/entGriff/ezra
15•ent1c3d•2d ago•4 comments

Launch HN: BitBoard (YC P25) – Analytics Workspace for Agents

https://bitboard.work/
40•arcb•13h ago•21 comments

Swift at Apple: Migrating the TrueType hinting interpreter

https://www.swift.org/blog/migrating-truetype-hinting-to-swift/
186•DASD•10h ago•75 comments

Malware developers added nuclear and biological weapons text to to their spyware

https://twitter.com/jsrailton/status/2064661778978533571
366•marc__1•1d ago•205 comments

H.R. 6028 would fundamentally change the U.S. Copyright Office

https://www.eff.org/deeplinks/2026/06/congress-just-rushed-through-disastrous-copyright-office-ov...
196•Cider9986•2d ago•62 comments

Pirates, a naval warfare game inspired by Sid Meier's Pirates

https://piwodlaiwo.github.io/pirates/
237•iweczek•13h ago•76 comments

Tectonic: A modernized, complete, self-contained TeX/LaTeX engine

https://tectonic-typesetting.github.io/en-US/
37•maxloh•3d ago•7 comments

Automating Myself Out of Development

https://www.thoughtfultechnologist.com/p/automating-myself-out-of-development
6•nisabek•3d ago•0 comments

Slightly reducing the sloppiness of AI generated front end

https://envs.net/~volpe/blog/posts/reduce-slop.html
184•FergusArgyll•15h ago•116 comments

TycoonLE: A Jax reinforcement learning environment for long-horizon planning

https://github.com/vrtnis/tycoon-learning-environment
10•vrtnis•4h ago•1 comments

A key remapping daemon for Linux

https://github.com/rvaiya/keyd
34•joooscha•2d ago•12 comments

Palantir loses legal challenge against Swiss investigative magazine

https://www.ft.com/content/7ffcace7-9dc0-4e7e-9912-895ac073f979
279•sschueller•9h ago•54 comments

A generic dynamic array in C that stores no capacity and needs no struct

https://gist.github.com/alurm/2ca14be134d719fe7431217a6b18d91e
7•alurm•3h ago•7 comments

SkillSpector

https://github.com/NVIDIA/SkillSpector
35•taubek•8h ago•4 comments

If you are asking for human attention, demonstrate human effort

https://tombedor.dev/human-attention-and-human-effort/
1556•jjfoooo4•1d ago•469 comments

Introduction to UEFI HTTP(s) Boot with QEMU/OVMF

https://blog.yadutaf.fr/2026/06/12/introduction-to-uefi-https-boot-qemu-ovmf/
91•jtlebigot•15h ago•30 comments

Adaptive PDFs

https://sgaud.com/texts/pdf
139•SarthakGaud•14h ago•67 comments

"Don't You Just Upload It to ChatGPT?"

https://correresmidestino.com/dont-you-just-upload-it-to-chatgpt/
387•speckx•12h ago•307 comments