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•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?

Dutch government objects to proposed US law restricting ASML's China exports

https://www.reuters.com/world/asia-pacific/dutch-government-objects-proposed-us-law-restricting-a...
2•jonbaer•6m ago•0 comments

Classic – Hacker News

https://news.ycombinator.com/classic
3•rvnx•12m ago•0 comments

Twilight of the Velocipede: Typesetting Races Before the Age of Linotype

https://publicdomainreview.org/essay/twilight-of-the-velocipede/
1•benbreen•12m ago•0 comments

Google AI Overview – "Tersely"

https://www.google.com/search?q=tersely&oq=tersely
1•flawn•16m ago•0 comments

Liquid Breathing

https://en.wikipedia.org/wiki/Liquid_breathing
1•Markoff•16m ago•0 comments

asp-classic-emulator: Run ASP Classic on macOS, Linux and BSD

https://github.com/MarceloDelgadoDev/asp-classic-emulator
1•866-RON-0-FEZ•21m ago•0 comments

Show HN: Artist Kit – One-Page Website Builder for DJs and Music Artists

https://www.artistkit.co/
3•truetaurus•23m ago•1 comments

I used AI to help market my bagel shop. Then the one-star reviews came in

https://www.businessinsider.com/bagel-shop-owner-removes-ai-social-media-marketing-2026-5
2•michaelsbradley•26m ago•1 comments

Scenario with Low Demand for AI

2•tesdinger•26m ago•0 comments

How does your team capture decisions and action items after meetings?

2•Skm-12•29m ago•0 comments

AI Is Technology, Not a Product

https://daringfireball.net/2026/05/ai_is_technology_not_a_product
1•mattas•31m ago•0 comments

Show HN: Firehooks – Get app users from TikTok without paid ads

https://ads.firehooks.io/
1•Tanvir3•31m ago•0 comments

Do Job Postings Show Early Labor‑Market Effects of AI?

https://libertystreeteconomics.newyorkfed.org/2026/05/do-job-postings-show-early-labor-market-eff...
3•wslh•40m ago•0 comments

BYD weighs Formula 1 role as 2026 rules shift toward electric power, VP confirms

https://carnewschina.com/2026/04/28/byd-weighs-formula-1-role-as-2026-rules-shift-toward-electric...
1•Markoff•40m ago•0 comments

Executives are blaming layoffs on AI, but it is not the main driver

https://finance.yahoo.com/economy/article/executives-are-blaming-layoffs-on-ai-but-research-shows...
1•wslh•41m ago•0 comments

Claude Agent View Changes How You Run Your Engineering Day

https://medium.com/@alirezarezvani/claude-agent-view-changes-how-you-run-your-engineering-day-ec7...
2•jungard•42m ago•0 comments

DIY Triboluminescence Media

1•sargstuff•43m ago•0 comments

The physics of scotch tape (2011)

https://www.symmetrymagazine.org/breaking/2011/01/18/the-physics-of-scotch-tape?language_content_...
1•sargstuff•43m ago•0 comments

X-ray and electron emission from peeling adhesive tape

https://pubs.aip.org/aip/apl/article/128/19/191101/3389324/X-ray-and-electron-emission-from-peeli...
2•ledoge•44m ago•0 comments

Is Trader Joe's the "Quince" of Food?

https://lesleysykes.substack.com/p/is-trader-joes-the-quince-of-food
1•mooreds•46m ago•0 comments

Show HN: nbpipe – A lightweight workflow runner for Jupyter notebooks

https://github.com/ngafar/nbpipe
1•nawazgafar•47m ago•0 comments

Analysis of changes in the Bun codebase after the rewrite from Zig to Rust

https://kant2002.github.io/en/llm/2026/05/16/bun-pr-analysis-en.html
3•kant2002•48m ago•1 comments

Vulnerability Cve-2026-7412

https://db.gcve.eu/vuln/cve-2026-7412
1•anonyoum•49m ago•0 comments

Vulnerability Cve-2026-7411

https://db.gcve.eu/vuln/cve-2026-7411
1•anonyoum•50m ago•0 comments

Colleges got more rural students to apply, challenge is getting them to attend

1•1659447091•50m ago•0 comments

Claude Session Manager – tile-based desktop manager for Claude Code

https://github.com/irfan-gowani/claude-session-manager
1•gnosis_hn•50m ago•0 comments

Too Much Is Happening Too Fast

https://www.theatlantic.com/technology/2026/05/too-much-happening-too-fast/687177/
2•malshe•51m ago•1 comments

Exploring Chemistry in Four Dimensions

https://blog.4denthusiast.net/
1•onestay42•52m ago•0 comments

Outcry: A four-layer activist AI that runs on a four-year-old phone

https://www.outcryai.com/research/how-to-create-activist-ai
1•micahwhite•52m ago•0 comments

Local, reviewable repo memory for coding agents

https://github.com/aictx/memory
3•Yannetto•53m ago•0 comments