frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Memory layout in Zig with formulas

https://raymondtana.github.io/math/programming/2026/01/23/zig-alignment-and-sizing.html
34•raymondtana•5h ago

Comments

raymondtana•5h ago
I've been learning Zig, and needed a refresher on memory layout (@sizeOf and @alignOf).

Wrote this blog post to summarize what I think are the right ways to understand alignment and size for various data types in Zig, just through experimentation.

Let me know any and all feedback!

dnautics•1h ago
i could be wrong but i believe the zig compiler reserves the right to lay things out differently depending on compilation mode? especially debug. unless it's extern or packed, in which case the layout will be defined.
rvrb•50m ago
`extern` and `packed` container types have well defined layouts. a regular `struct` is an "auto" layout - and the compiler can and will rearrange whenever it wants.

if you need a well defined layout, use `extern`. if your struct makes sense to represent as an integer, use `packed`. I think it is often ill advisable to use `packed` otherwise.

you can explore this yourself on the Type info returned from @TypeInfo(T):

https://ziglang.org/documentation/master/std/#std.builtin.Ty...

https://ziglang.org/documentation/master/std/#std.builtin.Ty...

https://ziglang.org/documentation/master/std/#std.builtin.Ty...

LexiMax•35m ago
To wit: https://ziglang.org/documentation/master/#extern-struct

> An extern struct has in-memory layout matching the C ABI for the target.

Zig is really good at speaking the C ABI of the target, but the upshot seems to be that it appears there is no stable Zig-native ABI.

If I'm correct, I wonder if there are plans to settle on a stable ABI at some point in the future. I do know that in other languages the lack of a stable ABI is brought up as a downside, and although I've been burned by C++ ABI stability too many times to agree, I can understand why people would want one.

bk496•30m ago
useful!

BirdyChat becomes first European chat app that is interoperable with WhatsApp

https://www.birdy.chat/blog/first-to-interoperate-with-whatsapp
202•joooscha•2h ago•115 comments

I added a Bluesky comment section to my blog

https://micahcantor.com/blog/bluesky-comment-section.html
46•hydroxideOH-•46m ago•3 comments

Bye Bye Gmail

https://m24tom.com/bye-bye-gmail/show
50•tklenke•1h ago•27 comments

Postmortem: Our first VLEO satellite mission (with imagery and flight data)

https://albedo.com/post/clarity-1-what-worked-and-where-we-go-next
35•topherhaddad•1h ago•5 comments

Raspberry Pi Drag Race: Pi 1 to Pi 5 – Performance Comparison

https://the-diy-life.com/raspberry-pi-drag-race-pi-1-to-pi-5-performance-comparison/
75•verginer•3h ago•29 comments

Memory layout in Zig with formulas

https://raymondtana.github.io/math/programming/2026/01/23/zig-alignment-and-sizing.html
35•raymondtana•5h ago•5 comments

First Design Engineer Hire – Build Games at Gym Class (YC W22)

https://www.ycombinator.com/companies/gym-class-by-irl-studios/jobs/ywXHGBv-design-engineer-senio...
1•hackerews•18m ago

JSON-render: LLM-based JSON-to-UI tool

https://json-render.dev/
22•rickcarlino•2h ago•3 comments

Claude Code's new hidden feature: Swarms

https://twitter.com/NicerInPerson/status/2014989679796347375
190•AffableSpatula•6h ago•134 comments

Doing gigabit Ethernet over my British phone wires

https://thehftguy.com/2026/01/22/doing-gigabit-ethernet-over-my-british-phone-wires/
369•user5994461•11h ago•207 comments

Shared Claude: A website controlled by the public

https://sharedclaude.com/
17•reasonableklout•13h ago•7 comments

Microservices for the Benefits, Not the Hustle

https://wolfoliver.medium.com/the-purposes-of-microservices-4e5f373f4ea3
10•WolfOliver•3d ago•3 comments

How I estimate work

https://www.seangoedecke.com/how-i-estimate-work/
336•mattjhall•10h ago•189 comments

Small Kafka: Tansu and SQLite on a free t3.micro

https://blog.tansu.io/articles/broker-aws-free-tier
27•rmoff•4d ago•1 comments

Agent orchestration for the timid

https://substack.com/inbox/post/185649875
21•markferree•1h ago•0 comments

Maze Algorithms (2017)

http://www.jamisbuck.org/mazes/
68•surprisetalk•1d ago•21 comments

Understanding Rust Closures

https://antoine.vandecreme.net/blog/rust-closures/
10•avandecreme•2h ago•0 comments

The Kept and the Killed (2022)

https://publicdomainreview.org/essay/the-kept-and-the-killed/
12•nomagicbullet•5h ago•1 comments

I built a tiny daemon that reminds me what matters

4•amitdawar•5d ago•0 comments

The Concatative Language XY

http://www.nsl.com/k/xy/xy.txt
15•ofalkaed•2h ago•4 comments

Show HN: JSciPy – SciPy-inspired signal processing library for Java and Android

https://github.com/hissain/jscipy
3•hissain•48m ago•0 comments

Ask HN: Gmail spam filtering suddenly marking everything as spam?

78•goopthink•5h ago•64 comments

Language may rely less on complex grammar than previously thought: study

https://scitechdaily.com/have-we-been-wrong-about-language-for-70-years-new-study-challenges-long...
10•mikhael•18h ago•2 comments

Tao Te Ching – Translated by Ursula K. Le Guin

https://github.com/nrrb/tao-te-ching/blob/master/Ursula%20K%20Le%20Guin.md
128•andsoitis•4h ago•52 comments

Show HN: StormWatch – Weather emergency dashboard with prep checklists

https://jeisey.github.io/stormwatch/
7•lotusxblack•1h ago•0 comments

MS confirms it will give the FBI your Windows PC data encryption key if asked

https://www.windowscentral.com/microsoft/windows-11/microsoft-bitlocker-encryption-keys-give-fbi-...
349•blacktulip•8h ago•233 comments

Hung by a thread

https://campedersen.com/rayon-mutex-deadlock
6•ecto•2h ago•9 comments

December in Servo: multiple windows, proxy support, better caching, and more

https://servo.org/blog/2026/01/23/december-in-servo/
103•t-3•4h ago•8 comments

Why Does Destroying Resources via TF Suck?

https://newsletter.masterpoint.io/p/why-does-destroying-resources-via-tf-suck
14•mooreds•1h ago•18 comments

When employees feel slighted, they work less

https://penntoday.upenn.edu/news/penn-wharton-when-employees-feel-slighted-they-work-less
256•consumer451•4d ago•216 comments