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?

How many paper folds would get you to the moon?

https://www.scientificamerican.com/article/how-many-paper-folds-would-get-you-to-the-moon/
1•beardyw•1m ago•0 comments

2026 Worst City for Bed Bugs Is Chicago, IL

https://www.orkin.com/press-room/chicago-worst-city-for-bed-bugs-again
1•speckx•1m ago•0 comments

From Handmade to AI-Made Websites: 20 Years in Website Development

https://www.xfive.co/blog/20-years-website-development
1•lubos76•3m ago•0 comments

I Built Remembr

https://apps.apple.com/us/app/remembr-shared-reminders/id6791300772
1•samltschenk•3m ago•2 comments

99.1% Totality

https://twitter.com/garrytan/status/2062760454649487491
1•gmays•4m ago•0 comments

As Reddit stock falls, CEO questions value of Google's AI Overviews

https://arstechnica.com/ai/2026/08/reddit-ceo-on-ai-overviews-were-still-looking-for-that-win-win/
2•mooreds•5m ago•0 comments

Official Dwarf Fortress Guide for Beginners (2026) [video]

https://www.youtube.com/watch?v=aRTwK8XR6kE
1•skibz•5m ago•0 comments

Bb Agent IDE

https://github.com/get-bb/bb
1•dfaiv•5m ago•1 comments

Mining Bitcoin with 2013 USB sticks, a Jalapeño and my phone (pure Python)

https://github.com/03012009BTC/miners-bitcoin-lottery
1•03012009BTC•6m ago•0 comments

Halcyon Video – a 3D video store for your media server

https://github.com/halcyon-video/halcyon-video
1•Gander5739•6m ago•0 comments

A Vision for Cargo

https://epage.github.io/blog/2026/08/cargo-vision/
1•birdculture•6m ago•0 comments

Do Personal AI Conversations Reduce Loneliness? [pdf]

https://www.ifo.de/DocDL/cesifo1_wp12882.pdf
1•mooreds•8m ago•0 comments

AI and the Enshittification Era with Cory Doctorow [video]

https://www.youtube.com/watch?v=-dAIJRjb-Bw
2•mooreds•8m ago•0 comments

AMD Instinct Coder Puts 8 MI325X GPUs Behind Local AI Coding

https://www.storagereview.com/news/amd-instinct-coder-puts-8-mi325x-gpus-behind-local-ai-coding-c...
1•galaxyLogic•9m ago•0 comments

Forcing TypeScript to Be Exhaustive

https://www.carlos-menezes.com/posts/exhaustive-checking-typescript
1•carlos-menezes•9m ago•0 comments

AI and the University – Carson Gross [video]

https://www.youtube.com/watch?v=ZUk2TKZIo7s
2•isaacvando•10m ago•0 comments

Show HN: Chess. Start with a king. Earn coins. Build an army

https://chesspoly.com
1•skyfantom•11m ago•0 comments

Hack Club Greeble

https://greeble.hackclub.com/
1•breynard•12m ago•0 comments

Show HN: S-Bahn Seat Picker

https://welidev.github.io/sbahn-picker/
1•weli•13m ago•1 comments

Browsers have standards, the App Store has judgment

https://blog.terrygodier.com/2026/08/07/browsers-have-standards-the-app.html
2•OberstKrueger•13m ago•0 comments

Trump orders new 15% tariff on key material for solar panels and microchips

https://www.theguardian.com/us-news/2026/aug/07/trump-orders-tariff-solar-panels-microchips-manuf...
1•speckx•13m ago•0 comments

'I feel like I dug my own grave': The workers caught in the AI transition

https://www.bbc.co.uk/news/articles/cgr7nxve05go
1•edward•13m ago•0 comments

How to Make Hand-Drawn Animation [video]

https://www.youtube.com/watch?v=9ytf-Ujpr9g
1•vinhnx•14m ago•0 comments

How Amazon Built a Data Center in a California Town Without Anyone Noticing

https://www.wsj.com/us-news/how-amazon-built-a-data-center-in-a-california-town-without-anyone-no...
1•Brajeshwar•15m ago•0 comments

Music Generation by a Composer, for Musicians

https://monictheory.com
1•song_synth•15m ago•0 comments

Show HN: Real-time cursor detection in screen recordings in the browser

https://github.com/ldenoue/cursor-motion-detector
1•ldenoue•15m ago•0 comments

Show HN: Microfeed – RSS+10GB media files on your own domain with O hosting fees

https://docs.microfeed.org/
1•wenbin•16m ago•0 comments

US unexpectedly lost 23,000 jobs in July as slump in growth continues

https://www.theguardian.com/business/2026/aug/07/july-jobs-report-middle-east-conflict
1•hheikinh•16m ago•0 comments

Digital Peacebuilding? The Socio-Technicality of Transforming Armed Conflict

https://academic.oup.com/book/63025?login=true
1•rbanffy•17m ago•0 comments

US economy loses 23,000 jobs in July as labor market weakens

https://www.usatoday.com/story/money/economy/2026/08/07/us-jobs-report-release-july-2026/91194187...
1•hheikinh•18m ago•0 comments