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?

OpsCart – Read-only Kubernetes triage with incident history

https://github.com/opscart/opscart-k8s-watcher
1•opscart•1m ago•0 comments

Turn messy AliExpress dropshipping listings into clean products with AI

https://importer.omniicore.com/
1•omniicore•15m ago•1 comments

A Comprehensive Guide to InnoDB Locking

https://jahfer.com/posts/innodb-locks/
1•shay_ker•19m ago•0 comments

ChatGPT starts blocking direct requests to copy an author's style

https://arstechnica.com/ai/2026/07/chatgpt-stops-cloning-famous-writers-voices-but-may-capture-a-...
3•Eloissssss•24m ago•0 comments

Six Little Lines of Fail [video]

https://www.youtube.com/watch?v=VvUdvte1V3s
1•ruckfool•24m ago•0 comments

Waits: Arthur Samuel's Checkers

https://timereshared.com/waits-samuel-checkers/
1•abrax3141•26m ago•0 comments

Interview with Amit Patel (Red Blob Games) on Making Things

https://digitalseams.com/blog/amit-patel-on-making-things
1•bobbiechen•28m ago•0 comments

The phone book that led us to Assad's spy chief in hiding

https://www.bbc.com/news/articles/c4gyrzn8p94o
2•cwwc•30m ago•0 comments

Model Genome: Fingerprinting Whether an LLM Was Trained from Scratch or Derived

https://huggingface.co/blog/mayafree/model-dna
1•prof_ai_cn•31m ago•0 comments

Opus 4.6 Was the Last Coding Model That Changed How I Work

https://awaitinginput.substack.com/p/opus-46-was-the-last-coding-model
1•bsovran•33m ago•0 comments

A weapon that could help red squirrels in their Battle of Britain

https://www.economist.com/britain/2026/01/10/a-weapon-that-could-help-red-squirrels-in-their-batt...
2•geneticdrifts•35m ago•0 comments

"Coding is solved" misses the point

https://blog.mastykarz.nl/coding-is-solved-misses-the-point/
2•listless•36m ago•0 comments

Incentives Are for Losers

https://www.experimental-history.com/p/incentives-are-for-losers
3•bkudria•36m ago•0 comments

Ask HN: What is your database size

1•kureikain•40m ago•0 comments

The State of Google

1•3dedb728-3f77•40m ago•1 comments

I built a video editor in Rust with extensive AI-powered features

https://github.com/heng30/wayshot
1•heng30•42m ago•0 comments

Aftermath of Catastrophic Fires in Spokane

https://www.kuow.org/climate/2026-08-07/its-apocalyptic-a-look-at-the-aftermath-of-catastrophic-f...
2•andsoitis•43m ago•0 comments

Archive of Animal Photography Reveals 18,000 Species and Counting

https://www.smithsonianmag.com/science-nature/this-amazing-archive-of-animal-photography-reveals-...
2•pseudolus•44m ago•0 comments

A viral mosquito-killing laser device could be coming to the U.S.

https://www.npr.org/2026/06/07/nx-s1-5839969/a-viral-mosquito-killing-laser-device-could-be-comin...
2•toomuchtodo•50m ago•1 comments

The AI Apocalypse Is Here

https://www.compactmag.com/article/the-ai-apocalypse-is-already-here/
17•reasonableklout•57m ago•8 comments

Show HN: Aidress – LangChain integration for cross-agent discovery and trust

https://docs.langchain.com/oss/python/integrations/tools
1•mehulv24•59m ago•0 comments

Flesh-eating screwworms feast on humans in Mexico; human cases top 500

https://arstechnica.com/health/2026/08/flesh-eating-screwworms-feast-on-humans-in-mexico-human-ca...
4•Eloissssss•1h ago•0 comments

TheoremDB · A public workspace for machine mathematics

https://theoremdb.org/
2•frozenseven•1h ago•0 comments

Amphorae Found at 2,100-Year-Old Roman Shipwreck Off Sicily

https://ancientist.com/hundreds-of-dressel-1a-amphorae-found-at-2100-year-old-roman-shipwreck-off...
1•inatreecrown2•1h ago•0 comments

What it was like working on LLMs and security at Meta (2022-2026)

https://joshuasaxe181906.substack.com/p/what-it-was-like-working-on-llms
2•botanicalfriend•1h ago•0 comments

SSI says that they are going to come out with their model in August

https://twitter.com/zephyr_z9/status/2084637598581207117
2•nsoonhui•1h ago•0 comments

What makes companies dodge taxes?

https://news.mccombs.utexas.edu/research/what-makes-companies-dodge-taxes/
2•hhs•1h ago•0 comments

Ready set march: Researchers use math to explain sudden activity bursts in ants

https://engineering.nyu.edu/news/ready-set-march-researchers-use-math-explain-sudden-activity-bur...
2•hhs•1h ago•0 comments

Melatonin impairs morning cognition in healthy young adults

https://academic.oup.com/sleep/article/46/Supplement_1/A34/7181621
4•bohaska•1h ago•0 comments

Every mosquito has a type – and you may not be it

https://news.fiu.edu/2026/every-mosquito-has-a-type-and-you-may-not-be-it
3•hhs•1h ago•0 comments