frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Packed Data Support in Haskell

https://arthi-chaud.github.io/posts/packed/
77•matt_d•11mo ago

Comments

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

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

carterschonwald•11mo ago
One thing that sometimes gets tricky in these things is handling Sub term sharing. I wonder how they implemented it.
tlb•11mo 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•11mo 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•11mo 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•11mo ago
honestly i wish more stuff worked this way - fewer hops in memory always makes me happy
lordleft•11mo ago
This was very well written. Excellent article!
NetOpWibby•11mo ago
Is this like MessagePack for Haskell?

Reddit vs. SerpApi et al.

https://www.documentcloud.org/documents/26193527-reddit-v-serpapi-et-al/
1•doener•59s ago•0 comments

The Age-Old Urge to Destroy Technology

https://www.newyorker.com/culture/infinite-scroll/the-age-old-urge-to-destroy-technology
1•chrisaycock•4m ago•0 comments

Richard Feldman: language runtime overhead (2022) [video]

https://vimeo.com/653510682
1•tosh•6m ago•0 comments

Show HN: I built an open protocol for Agent-to-agent commercial negotiation

https://a2cn.io/
1•cmagorr1•6m ago•0 comments

Rare China visit, Taiwan's opposition leader calls for reconciliation

https://www.aljazeera.com/news/2026/4/8/on-rare-china-visit-taiwans-opposition-leader-calls-for-r...
1•_tk_•10m ago•0 comments

Did WordPress VIP leak my phone number?

https://shkspr.mobi/blog/2026/04/did-wordpress-vip-leak-my-phone-number/
1•ColinWright•11m ago•0 comments

OpenAI Codex reaches 3M weekly active users, up from 2M in under a month

https://twitter.com/thsottiaux/status/2041655710346572085
2•alecco•12m ago•0 comments

What Is a 'Cyberdeck': Meet Gen Z's New DIY Obsession

https://www.newsweek.com/what-is-a-cyberdeck-gen-zs-new-custom-computing-obsession-11787017
1•breve•13m ago•0 comments

Roc: Fast

https://www.roc-lang.org/fast
1•tosh•22m ago•0 comments

What does Lockdown Mode do to keep you safe from spyware? [video]

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

An AI Agent. In COBOL. Yes

https://github.com/xawt/cobold-cli
2•Brosper•31m ago•0 comments

Ask HN: Is there some sort of stigma around Qubes OS on HN?

2•vntok•32m ago•2 comments

Effects of Stablecoin Yield Prohibition on Bank Lending

https://www.whitehouse.gov/research/2026/04/effects-of-stablecoin-yield-prohibition-on-bank-lending/
2•salkahfi•33m ago•0 comments

The Signature Method in Machine Learning (an interactive reading note)

https://ngrislain.github.io/blog/2026-4-6-reading-note-the-signature-method-in-machine-learning/
1•ngrislain•37m ago•0 comments

The Martians

https://en.wikipedia.org/wiki/The_Martians_(scientists)
1•tosh•38m ago•0 comments

We Got the Lithium-ion Battery (2024)

https://www.construction-physics.com/p/how-we-got-the-lithium-ion-battery
1•doener•38m ago•0 comments

Completely Private AI

https://molebieai.com/
1•Jimmy6929•41m ago•0 comments

FormTo – Open-source, self-hosted form back end

https://github.com/lumizone/formto
1•luka5184•42m ago•0 comments

Show HN: I built a Zoom alternative with 1 command

https://sfu.mirotalk.com
1•mp85•42m ago•1 comments

Starving Genies

https://tidyfirst.substack.com/p/starving-genies
1•danebalia•45m ago•0 comments

Roc

https://www.roc-lang.org/
1•tosh•47m ago•0 comments

Struggle Against the Gods

https://firstthings.com/struggle-against-the-gods/
3•marcofloriano•48m ago•0 comments

Google adopts new stance on device fingerprinting (2025)

https://www.lewissilkin.com/insights/2025/01/16/google-adopts-new-stance-on-device-fingerprinting...
1•bellwhistle•49m ago•0 comments

All of the String Types

https://lambdalemon.gay/posts/string-types
1•g0xA52A2A•50m ago•0 comments

Škoda DuoBell – The Bike Bell Designed to Penetrate Noise-Cancelling Headphones [video]

https://www.youtube.com/watch?v=zDaVPfpQvPI
1•SockThief•50m ago•1 comments

Russia Hacked Routers to Steal Microsoft Office Tokens

https://krebsonsecurity.com/2026/04/russia-hacked-routers-to-steal-microsoft-office-tokens/
3•KnuthIsGod•51m ago•0 comments

The Building Block Economy

https://twitter.com/mitchellh/status/2041566958681014418
1•doppp•55m ago•0 comments

HappyHorse 1.0 – Turn Any Idea into AI Videos Instantly

https://happyhorse.video
1•sarkory•55m ago•0 comments

C's Biggest Mistake

https://digitalmars.com/articles/C-biggest-mistake.html
2•mhh__•58m ago•1 comments

What "Open" Means: Abliterating Gemma 4 in 24 Minutes

https://thenewguard.ai/features/abliterating-gemma-4/
2•mattezell•1h ago•0 comments