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?

Xonotic: Free and Fast Arena Shooter under copyleft GPLv3 license

https://xonotic.org/
1•Gecko4072•2m ago•0 comments

Ryanair B738 cabin window shattered, passenger partly sucked out

https://avherald.com/h?article=53ba2a01&opt=0
2•thm•2m ago•0 comments

Meta to build C$13B Alberta data center, its first in Canada

https://www.reuters.com/world/americas/meta-build-c13-billion-alberta-data-center-its-first-canad...
2•adithyaharish•5m ago•0 comments

Stop being the code review bottleneck

https://newsletter.posthog.com/p/code-review-tips
1•cribwi•5m ago•0 comments

CorvinOS – self-hosted OS for AI agents, compliance built into the runtime

https://corvin-labs.com/
1•shumway•7m ago•0 comments

Loop Engineering

https://addyosmani.com/blog/loop-engineering/
1•frozenseven•7m ago•0 comments

2,100 castles across 133 countries, one map

https://thecastlemap.com/
1•Flightmussy•8m ago•0 comments

Best Health Supplements Reviews and Ratings 2026

https://justpaste.it/ccvbk
1•rafisalq•15m ago•0 comments

Stop Looking for the Next Jony Ive

https://maurya.bearblog.dev/stop-looking-for-the-next-jony-ive/
1•theaniketmaurya•18m ago•0 comments

Show HN: OpenVole 4.5 Is Out

https://github.com/openvole/openvole
2•flabberghasted•19m ago•0 comments

Show HN: Drag boxes around and watch a layout engine infer the Flexbox (no AI)

https://wpconverters.com/playground/
1•drzivil•23m ago•0 comments

The Ambulatory Intelligence Gap

https://www.databricks.com/blog/ambulatory-intelligence-gap
1•ilreb•24m ago•0 comments

Best Offline Sudoku App?

https://sudokui.app/
1•edullero•26m ago•1 comments

The SBC hobby is dying (Geerling, 3 months ago) [video]

https://www.youtube.com/watch?v=HeX22LnKdFY
2•tetris11•28m ago•0 comments

Motel – A 1989 Documentary [video]

https://www.youtube.com/watch?v=XT0VUPi4vus
1•snapetom•29m ago•0 comments

Show HN: Vuci – make the spoken word searchable

https://vuci.ai/feed/
1•lawnmaster18•30m ago•0 comments

The House Passed the KIDS Act–The Senate Should Reject It

https://www.eff.org/deeplinks/2026/07/house-passed-kids-act-senate-should-reject-it
2•nobody9999•30m ago•0 comments

Segfault on Rust 1.97.0

https://github.com/rust-lang/rust/issues/159035
2•solecist•32m ago•0 comments

Pro-Palantir data has litany of errors, English hospitals admit

https://www.ft.com/content/977aeda7-c055-44b7-8fb7-df1570849035
4•sega_sai•38m ago•0 comments

LiboPrime ReviEwS (2026): We Tried It My Honest Review

https://gamma.app/embed/LiboPrime-ReviEwS-2026-We-Tried-It-My-Honest-Review-gy3dc0lt3icpx3p
1•gasurads•38m ago•0 comments

Using Go for Mobile Apps: A retrospective on a year of development with Gomobile

https://www.davidsobsessions.com/p/one-year-of-gomobile/
1•darccio•40m ago•0 comments

The Cost of the American Revolution

https://www.econlib.org/econlog/the-cost-of-the-american-revolution/
1•NewCzech•42m ago•0 comments

Managed Claude, but for Any Harness

https://asteroidbelt.ai/
1•yshuolu•42m ago•0 comments

Pin Bar Formation and Detection in Crypto Markets

https://dolphindb.com/blogs/47
1•CrazyTomato•42m ago•0 comments

China becomes second country to recover orbital booster with Long March 10B

https://spacenews.com/china-becomes-second-country-to-recover-orbital-booster-with-long-march-10b/
4•pantalaimon•44m ago•1 comments

Test the Email Verification Protocol with an origin trial

https://developer.chrome.com/blog/email-verification-protocol-origin-trial
1•pvsukale3•45m ago•0 comments

Fzy: A simple, fast fuzzy finder for the terminal

https://github.com/jhawthorn/fzy
1•thunderbong•47m ago•0 comments

I built an app that solves math problems from a photo

https://apps.apple.com/us/app/mathnut-ai-math-solver/id6757105372
2•rafaelrpadovani•50m ago•0 comments

Quantum computing: one universe is more than enough

https://muircheartblog.wpcomstaging.com/2026/05/26/quantum-computing-one-universe-is-more-than-en...
2•vismit2000•51m ago•0 comments

Show HN: Tennis Rallies Poster Generator

https://matchpoint.jeremygautrais.fr/
1•tunafighter•52m ago•0 comments