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?

Groups and Diffie-Hellman

https://derangedmathematician.substack.com/p/groups-and-diffie-hellman
1•signa11•55s ago•0 comments

Old New York Stories – Jacques Barzun Interview

https://www.google.com/url?q=https://oldnewyorkstories.com/post/11666981759/jacques-barzun
1•Michelangelo11•2m ago•0 comments

SlimTide Official Site – Advanced Gut and Metabolic Support

https://finance.yahoo.com/sectors/healthcare/articles/slimtide-capsules-exploding-2026-slim-19370...
1•zasuhaly•2m ago•0 comments

The blood cancer that became solvable

https://worksinprogress.co/issue/the-blood-cancer-that-became-solvable/
1•hunglee2•2m ago•0 comments

Code Is Cheap(er)

https://htmx.org/essays/code-is-cheap/
2•shikaan•2m ago•0 comments

The Infinite Policeman – Chapter 1.99999999-> Whatever Happened to Dimension ℵ0

https://medium.com/luminasticity/the-infinite-policeman-chapter-1-99999999-e7ad853d9456
1•bryanrasmussen•3m ago•0 comments

Devs Deserve PII Protection

1•attogram•3m ago•0 comments

How the Internet Invented Bread Clip Science

https://www.youtube.com/watch?v=TNwHnHL2Pgs
2•mghackerlady•10m ago•0 comments

SpaceX IPO video sells Musk's space, AI, asteroid dreams to mom-n-pop investors

https://www.latimes.com/business/story/2026-06-04/spacex-ipo-video-sells-elon-musks-space-ai-aste...
2•1vuio0pswjnm7•11m ago•0 comments

Sapient HRM-Text – a 1B PoC text gen model based on the HRM architecture

https://sapient.inc/hrm-text/
1•senorqa•13m ago•0 comments

Meteor Burst Radio is long range radio which bounces of ionised meteor trails

https://meteorcommunications.co.uk/our-history-3/
1•anjel•14m ago•1 comments

How to Easily Create Your Own Blender Theme

https://blog.cg-wire.com/blender-theme-customization-guide/
1•basilesamel•14m ago•0 comments

Show HN: Altersend – File sharing without cloud

https://github.com/denislupookov/altersend
3•denisdev1•15m ago•0 comments

24. Gulaschprogrammiernacht started, Streams of Talks are available

https://streaming.media.ccc.de/gpn24
2•modeopfer•21m ago•0 comments

Show HN: Encoding Audio Inside PNG Images [video]

https://www.youtube.com/watch?v=XityrCGbHm4
2•Regina0727•21m ago•0 comments

Americans lead AI data centre backlash, global poll finds

https://www.ft.com/content/ed07dc6c-aabe-4e4d-a508-4d2b4f24a852
3•1vuio0pswjnm7•21m ago•0 comments

Satya Nadella 'Not Sure' Who Said Microsoft Wanted to Make Addictive AI

https://www.404media.co/satya-nadella-not-sure-who-said-microsoft-wanted-to-make-addictive-ai-is-...
4•dr_hooo•23m ago•0 comments

Birds masturbate, and that's perfectly normal

https://theconversation.com/birds-masturbate-and-thats-perfectly-normal-284232
2•XzetaU8•23m ago•0 comments

I Didn't Become a Developer to Review AI Slop

https://www.builder.io/blog/developers-drowning-in-ai-prs
3•ankitg12•25m ago•0 comments

Laptop makers are sacrificing ports and repairability for designs

2•anantayush•26m ago•0 comments

How much value is AI creating?

https://www.ft.com/content/8e9ae7a4-7209-4e2c-aa36-f3af77d6ce1f
2•1vuio0pswjnm7•27m ago•0 comments

Anthropic tops AI Arena rankings as it files for IPO

https://liveclip.substack.com/p/anthropic-files-for-ipo-state-of-ai
2•firasd•27m ago•0 comments

Anatomy of a Claude Code Session

https://codewithmukesh.com/blog/anatomy-claude-code-session/
2•ankitg12•29m ago•0 comments

Magit-difftastic: render diffs with difftastic inside magit's buffers

https://github.com/rschmukler/magit-difftastic
2•signa11•38m ago•0 comments

Hagezi DNS-blocklist is returning 404

https://github.com/hagezi/dns-blocklists
2•aayala•40m ago•1 comments

The Pipeline Game: Reading Buying Pressure Before Leads Exist

https://basinleon.github.io/pipeline-game/
2•lbasin23•41m ago•0 comments

Fine-tuning an LLM to write docs like it's 1995

https://passo.uno/fine-tuning-docs-llm/
4•taubek•42m ago•0 comments

Ask HN: What are the biggest problems you find in OpenClaw/Hermes?

1•muoco-01•44m ago•1 comments

No-Chat-Reports

https://github.com/Aizistral-Studios/No-Chat-Reports
1•Cider9986•45m ago•0 comments

The teenagers enlisted as agents of mayhem by Russia and Iran

https://www.ft.com/content/58dabb01-41f6-4440-8a5f-69947d8afe06
1•imichael•52m ago•0 comments