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?

Tokensave: An MCP Server That Saved Me Tokens While Coding

https://www.tobiasreithmeier.de/en/blog/tokensave-mcp-server-tutorial-review
1•freediver•2m ago•0 comments

Show HN: Synapse – local codebase indexer and MCP server for Claude Code

https://github.com/nrkoka786/synapse
1•nrkoka1•11m ago•0 comments

Overload and insight look identical from the outside

https://pilgrima.ge/p/what-the-wire-knows
1•momentmaker•13m ago•0 comments

Show HN: Free car spec db to defeat the paywalls

https://openlaborproject.com/
1•chackleman•17m ago•1 comments

Madison Square Garden Sues Wired Magazine over L.G.B.T.Q. Tracking Report

https://www.nytimes.com/2026/07/18/business/media/msg-entertainment-sues-wired-magazine.html
1•ChrisArchitect•18m ago•1 comments

How Word Count Is Important for Social Media Posts

https://medium.com/@thesuperrepemail/how-word-count-is-important-for-social-media-posts-87372645377c
2•rajsuper123•30m ago•0 comments

William Gaddis and William H. Gass: A Literary Conversation and Reading (1995)

https://www.92ny.org/archives/william-gaddis-and-william-h-gass-a-literary-conversation-and-reading
1•ofalkaed•35m ago•0 comments

Trump Media pitched $100K monthly fee for fastest feed of US president's posts

https://www.reuters.com/business/media-telecom/trump-media-pitched-100000-monthly-fee-fast-feed-u...
3•geox•36m ago•1 comments

Disney Has Started Feeding Your Kids AI Slop

https://kotaku.com/disney-has-started-feeding-your-kids-ai-slop-2000717222
4•wslh•43m ago•0 comments

Lawyers risk being sued for failing to use AI

https://www.legalcheek.com/2026/07/lawyers-risk-being-sued-for-failing-to-use-ai/
3•Tomte•44m ago•0 comments

LLM-Integrated Multivariable Calculus Course

https://calculus.academa.ai/
4•sinaatalay•50m ago•1 comments

Topographical Collection of King George III

https://www.flickr.com/photos/britishlibrary/collections/72157719509637544/
1•Eridanus2•51m ago•0 comments

XRPLink – Cryptographically Verified XRP Payment Receipts, Powered by Flare FDC

https://github.com/joverman/xrplink
1•joverman•1h ago•0 comments

FDA approves new kind of cholesterol pill

https://www.fda.gov/news-events/press-announcements/fda-approves-first-oral-pcsk9-inhibitor-lower...
3•mgh2•1h ago•0 comments

Useless Use of Cat Award

https://porkmail.org/era/unix/award
1•gregsadetsky•1h ago•1 comments

Novo Space builds modular computers for satellite constellations

https://runtimewire.com/article/startup-spotlight-novo-space-builds-modular-computers-for-satelli...
1•ryanmerket•1h ago•0 comments

Gaming Sickness and Its Impact on Players' Experiences with Games

https://dl.acm.org/doi/10.1145/3670653.3677494
2•BiraIgnacio•1h ago•0 comments

I built a browser-based P2P file transfer tool using WebRTC

https://airdows.com/
2•SamOkampo•1h ago•1 comments

Jordan Ellenberg explains how geometry helps us understand the world

https://www.cbc.ca/lite/story/1.6448326
1•colinprince•1h ago•0 comments

Retry is not a loop, its a data structure

https://siddhantkhare.com/writing/retry-is-not-a-loop
2•meetpateltech•1h ago•0 comments

Association Between Low/No-Calorie Artificial Sweeteners and Cognitive Decline

https://www.neurology.org/doi/10.1212/WNL.0000000000214023
2•corvad•1h ago•0 comments

PersonalDrive: Personal Cloud Storage

https://personaldrive.xyz/
2•thunderbong•1h ago•1 comments

Implementation of "Writing a C compiler" in Zig

https://github.com/igor84/wcc
2•rguiscard•1h ago•0 comments

Toyota pump tech could be key to hydrogen-combustion practicality

https://www.autocar.co.uk/car-news/technology/toyota-pump-tech-could-be-key-hydrogen-combustion-p...
1•breve•1h ago•0 comments

Track you Claude Code usage in dollars

https://www.claudeusage.com/leaderboard
2•bazarkua•1h ago•1 comments

Seamless iPad (or any device that can run a web browser) drawing into org-mode

https://github.com/larrasket/org-pad.el
1•lr0•1h ago•0 comments

China cracks down on AI companions, forcing millions to break up

https://www.abc.net.au/news/2026-07-19/china-cracks-down-on-artificial-intelligence-companions/10...
3•defrost•1h ago•1 comments

Archaeologists found Homer's Iliad inside a 1,600-year-old Egyptian mummy

https://www.sciencedaily.com/releases/2026/07/260713084918.htm
4•NordStreamYacht•2h ago•0 comments

IceCream – Never use print() to debug again

https://github.com/gruns/icecream
1•gregsadetsky•2h ago•0 comments

Claude Is Painful

5•kderbyma•2h ago•3 comments