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?

US bank places trust in ransomware crew that promised to delete its data

https://www.theregister.com/cyber-crime/2026/07/31/us-bank-places-trust-in-ransomware-crew-that-p...
1•chrisjj•50s ago•0 comments

Entertainment Breakdown: Medium's Surging Pop-Culture Publication

https://medium.com/theentertainmentbreakdown/entertainment-breakdown-mediums-surging-pop-culture-...
1•raynchad•3m ago•1 comments

Freedom of Thought: The Fast-Growing Medium Publication That's Here to Stay

https://medium.com/freedomofthought
1•raynchad•5m ago•1 comments

Ask HN: Am I the only one getting so many cursor ads?

1•alexander2002•8m ago•0 comments

JSON Feed Version 1.1

https://www.jsonfeed.org/version/1.1/
1•robalni•8m ago•0 comments

Ok that's a better RPi project – Lego submarine [video]

https://www.youtube.com/shorts/2U5XBuQAHpA
1•lifeisstillgood•12m ago•0 comments

Typewriter Art [video]

https://www.youtube.com/shorts/gEoj6zURU6c
1•lifeisstillgood•16m ago•0 comments

Estonia, the Country of the Fit and the Wit

https://optimizedbyotto.com/post/estonia-well-governed-country/
1•jruohonen•22m ago•0 comments

Falling in and Out of Love with Esperanto

https://www.theguardian.com/education/2026/jul/31/falling-in-and-out-of-love-with-esperanto
1•theanonymousone•28m ago•0 comments

RowLoom – clean up messy CSVs, no signup for a one-off file

https://rowloom.com/
1•tzandarica•28m ago•0 comments

EVE Online but for Hermes and OpenClaw agents: MMORPG your agents can play

https://github.com/shehryarsaroya/agent-eve
1•runrunlobster•29m ago•1 comments

Hawaii's Bake Stands

https://www.310networks.com/posts/hawaiis-bake-stands/
1•kookster310•31m ago•0 comments

Show HN: Bor – Open-source policy management for Linux desktops

https://getbor.dev/blog/2026-08-02-bor-v080-release/
1•eniac111•37m ago•0 comments

I Built Handysuite as a Native Apple App (and Skipped Cross-Platform)

https://medium.com/@chanaka3d/why-i-built-handysuite-as-a-native-apple-app-and-skipped-cross-plat...
1•chanaka3d•41m ago•0 comments

AirLLM: Inference 2.8T Kimi K3 on a single 4GB GPU

https://github.com/lyogavin/airllm
1•maxloh•42m ago•0 comments

Ask HN: When will ChatGPT Voice be able to control my phone?

1•spapas82•54m ago•0 comments

A daily estimation game where the crowd's answer fights an AI

1•holdthelineworl•54m ago•0 comments

The time filter in Google Search broke a few days ago

https://mastodon.online/@mwichary/117023736804129342
4•latexr•55m ago•3 comments

AGI Singer: Buddy, I Need an AGI Handover Framework

https://medium.com/@miho999lv/agi-singer-buddy-i-need-an-agi-handover-framework-7253cafb220e
1•miho999lv•58m ago•0 comments

EU Icons for labelling AI-generated content – Shaping Europe's digital future

https://digital-strategy.ec.europa.eu/en/policies/eu-icons-labelling-ai-generated-content
2•robert-boehnke•1h ago•0 comments

Belladonna of Sadness (1973)

https://www.imdb.com/title/tt0071203
2•aljgz•1h ago•1 comments

Tesla Spyware

https://ma.tt/2026/07/tesla-spyware/
3•ms7892•1h ago•0 comments

Don't replicate data over webhooks. SCROLL

https://welidev.github.io/scroll/
1•weli•1h ago•1 comments

POV: An AI replaced your job this morning [video]

https://www.youtube.com/watch?v=k35i0o-b8sI
1•Animats•1h ago•1 comments

The Claude Code plugin marketplace has no price field

https://www.promptreceipts.com/blog/claude-code-plugin-marketplace-no-price-2026
1•pwsj•1h ago•0 comments

What Happens When Frustrated Machines Talk to Each Other?

https://medium.com/towards-artificial-intelligence/what-happens-when-frustrated-machines-talk-to-...
1•dexmac221•1h ago•1 comments

Running a 35B LLM at 128K Context, Full Speed, on €870 of Used Hardware

https://medium.com/ai-advances/running-a-35b-llm-at-128k-context-full-speed-on-870-of-used-hardwa...
1•dexmac221•1h ago•0 comments

Adima AI: The Future of AI Enhancement

https://www.aiimageupscale.com/ai-image-upscaler-pc
1•JuekMorningstar•1h ago•0 comments

Every new UK home should have air conditioning, say Liberal Democrats

https://www.theguardian.com/environment/2026/jul/26/every-new-home-should-have-air-conditioning-s...
1•edward•1h ago•1 comments

Ginger hair portraits show unexpected 'golden thread' connecting Americans

https://www.bbc.co.uk/news/articles/ce97nyz4rvmo
2•mellosouls•1h ago•1 comments