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?

Show HN: ShevtoneAudio Orchestrator – Turning MIDI into Full Orchestration

https://orchestra.shevtoneaudio.com
1•MusicAlexandrov•50s ago•0 comments

Kima: Self-Hosted Spotify-Like Streaming for Your Own Music Library

https://digitalescapetools.com/tools/tool.html?id=kima-hub
1•xabd•1m ago•0 comments

Secret ratio property of cubic functions

https://www.youtube.com/watch?v=mqdCKLipDiI
1•vismit2000•1m ago•0 comments

Show HN: My startup-idea scanner scored 500 ideas; the best got 6.3/10

https://1mil.app/
1•fayerman•2m ago•0 comments

Uruky reached 300 monthly active accounts!

https://uruky.com/whats-new?il=en
1•BrunoBernardino•3m ago•0 comments

Physically Immutable Optical Archive Libraries

https://savartus.com/solutions/enterprise-laser-storage/
2•thunderbong•10m ago•0 comments

One Nix flake to rule them all

https://fzakaria.com/2026/08/28/one-flake-to-rule-them-all
2•ingve•15m ago•0 comments

British Public Oppose Secret Surveillance Powers and Want Strong Protections

https://cdt.org/press/british-public-oppose-secret-surveillance-powers-and-want-strong-protection...
2•DeepLogin•16m ago•0 comments

When it comes to China, America has a plan

https://mondediplo.com/2026/06/11us
1•Anon84•23m ago•0 comments

Show HN: 1endpoint – Cheaper access to AI models

https://1endpoint.dev
1•DustinPham12•24m ago•1 comments

How Culture Shapes the Stories We Tell About Our Emotions (2024)

https://behavioralscientist.org/culture-shapes-stories-of-emotion/
1•the-mitr•25m ago•0 comments

Some Scientists Have 'Magic Hands' in the Lab. This A.I. Is Learning Why.

https://www.nytimes.com/2026/08/27/science/scientists-experiments-replication-ai.html
1•mitchbob•26m ago•1 comments

What It Took to Dismantle the Most Powerful Company in the World

https://www.nytimes.com/2026/08/28/opinion/ai-power-lobbying-military-britain-east-india-company....
1•Anon84•29m ago•0 comments

Atlantropa

https://en.wikipedia.org/wiki/Atlantropa
1•yitchelle•31m ago•0 comments

Iceland votes 'No' to reopening EU accession talks

https://www.euronews.com/my-europe/2026/08/30/iceland-votes-no-to-further-eu-accession-talks-in-t...
2•sehw•32m ago•0 comments

Rehearse a specific English work conversation before you have it

https://www.unfreezy.com
1•czaar1•32m ago•0 comments

Groom of the Stool

https://en.wikipedia.org/wiki/Groom_of_the_Stool
2•soupspaces•33m ago•0 comments

IguanaTex

https://github.com/Jonathan-LeRoux/IguanaTex
1•Eridanus2•34m ago•0 comments

Innovation Doesn't Happen on Schedule

https://www.thesignalist.io/s/innovation-doesnt-happen-on-schedule/
1•kodesko•35m ago•0 comments

The largest electric plane takes flight today

https://www.popsci.com/technology/worlds-largest-electric-plane/
1•thinkingemote•35m ago•0 comments

Scientists Create the Littlest Big Bang to Study the Universe's Origins

https://www.wired.com/story/scientists-create-littlest-big-bang-to-study-universe-origins/
1•joozio•36m ago•0 comments

When Led Zeppelin bombed in front of 1.9B people [video]

https://www.youtube.com/watch?v=PPJJdQfVxyg
1•jurf•36m ago•0 comments

Show HN: The Thousand – 1k founders, 1 question, one book

https://thethousand.co
1•jabed•36m ago•2 comments

Google Maps – Lake America

https://www.google.com/maps/place/Lake+America/@43.7036865,-79.2490163,8z/data=!3m1!4b1!4m6!3m5!1...
1•pseudolus•37m ago•0 comments

Columbia House Is Shutting Down

https://pitchfork.com/story/columbia-house-is-shutting-down/
1•pseudolus•45m ago•0 comments

He Did Not Conquer: Franklin's Failure to Annex Canada

https://reviewcanada.ca/magazine/2025/12/how-vain-an-attempt-review-he-did-not-conquer/
2•Bluestein•46m ago•0 comments

Show HN: Get your free AI search visibility scan

https://www.visiscan.app
1•not_wowinter14•47m ago•0 comments

Tortoise and the Birds – an African folktale recreated with Lego animation [video]

https://www.youtube.com/watch?v=EVHlqLa7-u0
1•CodePapi_•50m ago•1 comments

Show HN: Nuzzle – adorable live wallpapers of your pets

https://usenuzzle.com
1•13001r•50m ago•0 comments

Against Dumb Vibe Coding, Not Vibe Coding

https://funnygeek.com/essays/vibe-coding-speech/
1•ifoo•52m ago•1 comments