frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Packed Data Support in Haskell

https://arthi-chaud.github.io/posts/packed/
77•matt_d•1y ago

Comments

nine_k•1y ago
> Introducing the ‘packed’ data format, a binary format that allows using data as it is, without the need for a deserialisation step. A notable perk of this format is that traversals on packed trees is proven to be faster than on ‘unpacked’ trees: as the fields of data structures are inlines, there are no pointer jumps, thus making the most of the L1 cache.

That is, a "memory dump -> zero-copy memory read" of a subgraph of Haskell objects, allowing to pass such trees / subgraphs directly over a network. Slightly reminiscent of Cap'n Proto.

90s_dev•1y ago
We are always reinventing wheels. If we didn't, they'd all still be made of wood.
Zolomon•1y ago
They mention this in the article.
spockz•1y ago
It reminds me more of flat buffers though. Does protobuf also have zero allocation (beyond initial ingestion) and no pointer jumps?
cstrahan•1y ago
No, one example of why being variable sized integers.

See https://protobuf.dev/programming-guides/encoding/

carterschonwald•1y ago
One thing that sometimes gets tricky in these things is handling Sub term sharing. I wonder how they implemented it.
tlb•1y ago
> the serialised version of the data is usually bigger than its in-memory representation

I don’t think this is common. Perhaps for arrays of floats serialized as JSON or something. But I can’t think of a case where binary serialization is bigger. Data types like maps are necessarily larger in memory to support fast lookup and mutability.

nine_k•1y ago
I suppose all self-describing formats, like protobuf, or thrift or, well, JSON are bigger than the efficient machine representation, because they carry the schema in every message, one way or another.
IsTom•1y ago
If you use a lot of sharing in immutable data it can grow a lot when serializing. A simple pathological example would be a tree that has all left subtrees same as the right ones. It takes O(height) space in memory, but O(2^height) when serialized.
gitroom•1y ago
honestly i wish more stuff worked this way - fewer hops in memory always makes me happy
lordleft•1y ago
This was very well written. Excellent article!
NetOpWibby•1y ago
Is this like MessagePack for Haskell?

USAID Cuts Killed People. That's the Truth

https://www.nytimes.com/2026/07/01/opinion/usaid-elon-musk-doge.html
1•Teever•1m ago•0 comments

Zig: All Package Management Functionality Moved from Compiler to Build System

https://ziglang.org/devlog/2026/#2026-06-30
1•tosh•2m ago•0 comments

A Verdict on (The) Slaughter

https://paulkrugman.substack.com/p/a-verdict-on-the-slaughter
1•rbanffy•2m ago•0 comments

Show HN: Plot Workshop – A story planning tool for writers

https://www.plotworkshop.com
1•calzakk•3m ago•0 comments

Glaze made me an editor for this site

https://devz.cl/posts/trying-out-the-glaze-app/
1•DanielVZ•3m ago•0 comments

Anthropic's Co-Founder and Top Economist on Doing Research at the AI Frontier [video]

https://www.youtube.com/watch?v=aE3gPh2CC9I
1•ronfriedhaber•3m ago•0 comments

The Sportsbook Is Recruiting the Next Founder Before Startups Do

https://runtimewire.com/article/the-sportsbook-is-recruiting-the-next-founder-before-startups-do
1•ryanmerket•4m ago•0 comments

Analog Computing: The Infinity Between 0 and 1 [video]

https://vimeo.com/1202659062
1•rbanffy•4m ago•0 comments

The Vertical Codebase

https://tkdodo.eu/blog/the-vertical-codebase
2•theanonymousone•7m ago•0 comments

Axiom: A social platform where all ideas are logically valid

https://axiomreason.com
1•samcymbaluk•7m ago•0 comments

Confidential computing's core trust mechanism is broken. The fix may not exist

https://www.theregister.com/security/2026/07/04/confidential-computings-core-trust-mechanism-is-b...
1•manwithaplan•8m ago•1 comments

$33B sitting dead on-chain

https://beincryptodaily.substack.com/p/33b-sitting-dead-on-chain
1•wslh•8m ago•0 comments

"if you don't pass an allocator you can't allocate"

https://twitter.com/eatonphil/status/2073435670220099875
1•tosh•9m ago•0 comments

Scaling Laws, Honestly

https://www.completeskeptic.com/p/scaling-laws-honestly
1•CompleteSkeptic•11m ago•0 comments

The night the Earth shook, strangers started to draw

https://sheets.works/data-viz/strangers-draw-maps
1•laurex•13m ago•0 comments

Toxoplasma Gondii

https://en.wikipedia.org/wiki/Toxoplasma_gondii
1•simonebrunozzi•14m ago•0 comments

Anthropic Issued with a Cease and Desist

https://www.thatprivacyguy.com/blog/anthropic-cease-and-desist/
1•robin_reala•14m ago•0 comments

The End of North America

https://paulkrugman.substack.com/p/the-end-of-north-america-157
3•rbanffy•16m ago•0 comments

Curveball

https://mightyburger.net/projects/curveball/
3•toilet•16m ago•0 comments

Happy Independence Day

3•Velocifyer•20m ago•0 comments

Papa Johns Can Predict When Your Fridge Is Empty

https://www.adexchanger.com/tv/papa-johns-can-predict-when-your-fridge-is-empty/
1•ohjeez•20m ago•0 comments

Show HN: Follow London Trains in 3D

https://ride.nexttrain.london/
1•mgranados•21m ago•0 comments

Combined 1D and 2D Barcodes

https://shkspr.mobi/blog/2026/07/combined-1d-and-2d-barcodes/
1•Brajeshwar•21m ago•0 comments

Alexa+, the Next Generation of Alexa

https://www.aboutamazon.com/news/devices/new-alexa-generative-artificial-intelligence
1•doodlesdev•21m ago•1 comments

Are we still writing software?

https://ernestscribbler.xyz/are-we-still-writing-software.html
1•nickstinemates•22m ago•0 comments

ActiveGraph v1.2.0 is live – x30 speedup

https://activegraph.ai/blog/activegraph-v1-2-0
4•gkorland•22m ago•3 comments

The LLVM Compiler Infrastructure

https://cacm.acm.org/federal-funding-of-academic-research/the-llvm-compiler-infrastructure/
1•yarapavan•23m ago•0 comments

Understanding the Dynamics of the AI Ecosystem with Pace Layers

https://www.dbreunig.com/2026/07/03/ai-ecosytem-pace-layers.html
1•dbreunig•24m ago•0 comments

For Tailscale, good feedback is private feedback

https://doesmycode.work/posts/for-tailscale-good-feedback-is-private-feedback/
2•steveiliop56•27m ago•1 comments

Show HN: See a Random American

https://a-random-american.github.io
1•tintjosh•28m ago•0 comments