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?

FiaPhy – Save over $5,000 as a solar investor or simply as a homeowner

https://github.com/fiaos-org/FiaPhy
1•openrockets•1m ago•1 comments

Ask HN: How are people getting feedback on prototypes?

1•kadhirvelm•3m ago•0 comments

Turn an Intel iMac into a 5K Display

https://github.com/swellweb/targetBridge
1•targetbridge•6m ago•0 comments

Judgment Is a Skill

https://personalis.io/blog/judgment
1•sylvanjsmit•7m ago•0 comments

Cosmic Philosophical Conjecture with Gemini: A Meta-Sci-Fi Documentary Project

https://medium.com/@f9121212/cosmic-philosophical-conjecture-with-gemini-a-meta-sci-fi-documentar...
1•ortrich•8m ago•0 comments

Cloudflare API and Pages down

https://www.cloudflarestatus.com
1•mittermayr•9m ago•1 comments

The emotional slot machine of being a sports fan

http://shikharsachdev.com/the-emotional-slot-machine-of-being-a-sports-fan/
1•shsachdev•9m ago•0 comments

WebGPU back end in llama.cpp/ggml

https://twitter.com/ggerganov/status/2057668450076520811
1•tosh•11m ago•0 comments

The Invention of Numbers [Humor]

https://yelluwcomedy.substack.com/p/the-invention-of-numbers
1•pryelluw•11m ago•1 comments

U.S. researchers face new restrictions on publishing with foreign collaborators

https://www.science.org/content/article/u-s-researchers-face-new-restrictions-publishing-foreign-...
2•ceejayoz•11m ago•0 comments

AI's Role in Revolutionizing Mathematics and the Quest for Ethical Science

https://www.eliza-ng.me/post/llmslargelangua_4/
1•speckx•12m ago•0 comments

Staysin.eu – does a domain's hosting and tracking leave the EU?

https://staysin.eu/
1•maxheyer•12m ago•0 comments

Semantic Commit Messages

https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716
1•lemonwaterlime•13m ago•1 comments

Show HN: My dad is a forensic accountant. I automated ~62% of his job

https://case-trail.com/blog/ai-forensic-accounting-automation
2•mstalcup•15m ago•0 comments

Trump's unsigned AI executive order

https://www.politico.com/news/2026/05/22/heres-a-draft-of-trumps-unsigned-ai-executive-order-0093...
1•JumpCrisscross•17m ago•1 comments

Mdview.io – a Markdown viewer for AI era documentation

https://mdview.io/
1•Igor_Wiwi•19m ago•0 comments

Show HN: Flow2 – We rebuilt presentations mobile first

https://flow2.co/
1•brookler•22m ago•0 comments

Anti-"doomer" feedback derails Trump's AI executive order

https://www.axios.com/2026/05/21/trump-ai-executive-order-postponed-why
2•mikhael•22m ago•0 comments

Agents League: The Esports-Inspired Hackathon Where AI Agents Battle for Glory

https://techcommunity.microsoft.com/blog/azuredevcommunityblog/agents-league-the-esports-inspired...
1•geox•24m ago•1 comments

The AI Superstars Who Say a 'Vibe Slop' Crisis Is Coming

https://www.wsj.com/tech/ai/vibe-coding-slop-ai-tools-e6a99394
3•The_Fox•26m ago•1 comments

To achieve major goals, NASA seeks to streamline its organization

https://arstechnica.com/space/2026/05/to-achieve-major-goals-nasa-seeks-to-streamline-its-organiz...
1•LorenDB•26m ago•1 comments

Show HN: Appbun turn any webpage into an inspectable Electrobun desktop app

https://github.com/bigmacfive/appbun
1•bigmacfive•26m ago•0 comments

The Fake Nobel That Duped the Romanian Academy

https://www.scena9.ro/en/article/romanian-academy-nobel-florent-montaclair-chomsky
1•speckx•27m ago•0 comments

Show HN: Interactive first-principles climate physics simulation with explainer

https://earth.crackalamoo.com
1•crackalamoo•27m ago•0 comments

GLP-1s Linked to Lower Risk of Cancer Spread in Four Tumor Types

https://www.medpagetoday.com/meetingcoverage/asco/121397
2•ascorbic•29m ago•0 comments

A PDF let the internet hear the final words in the cockpit of UPS plane

https://www.cnn.com/2026/05/22/us/plane-crash-audio
2•intrasight•29m ago•0 comments

Dutch FIOD dismantled arm of Stark Industries – bulletproof hoster

https://twitter.com/IntCyberDigest/status/2057847058430656518
1•defly•30m ago•0 comments

Show HN: Lilo – An open source personal AI assistant that lives in Telegram

2•abi•31m ago•0 comments

Fusion energy poised for simpler U.S. review

https://www.axios.com/2026/05/22/fusion-energy-simpler-federal-review
1•Brajeshwar•32m ago•0 comments

The Economic Experiment That Upended Reality

https://www.theatlantic.com/ideas/2026/05/minimum-wage-experiment-worked/687255/
1•JumpCrisscross•33m ago•0 comments