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?

Git Internals – Plumbing and Porcelain

https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain
1•bschne•27s ago•0 comments

Why Your Emacs Terminal Is Slow and How to Fix It

https://www.jamescherti.com/emacs-terminal-performance-vterm-eat-ansi-term-ghostel/
1•signa11•5m ago•0 comments

Ada & Zangemann book about free software translated in Persian / Farsi

https://ada.fsfp.ir/
1•bsh90•5m ago•0 comments

The Life of Death and the Enshittificator [video]

https://www.youtube.com/watch?v=d6SPV4GZp-U
1•cern•6m ago•0 comments

Unbiased is our platform. Pareto is our own blended AI model

https://unbiased.ai/
1•Bluestein•7m ago•1 comments

Anthropic says its model Claude is helping to build the next version of itself

https://apnews.com/article/anthropic-claude-ai-model-self-improvement-4d3a7430f57cbc7c39e1c5f2b7d...
1•geox•7m ago•0 comments

Show HN: Attar – Compile React apps to native machine code

https://attar.dev/
2•ifdotpy•9m ago•0 comments

AI software should be treated like any other software [video]

https://www.youtube.com/watch?v=9tr7Mby62bo
1•drywater2•9m ago•0 comments

The early days of Unix in the UK

https://www.coulouris.net/cs_history/em_story/
2•fanf2•14m ago•0 comments

World Money: A Financial Super App for Humans

https://world.org/blog/announcements/world-money
1•thm•15m ago•0 comments

War may be coming. Are we psychologically ready?

https://www.bbc.com/news/articles/cmn0jke547r5o
4•vinni2•17m ago•1 comments

The LLM Comments Are Not for You

https://danilafe.com/blog/comments_not_for_you/
1•kqr•17m ago•1 comments

iCloud+ Now Includes Apple TV and Apple Arcade

https://www.icloud.com/en-sg/info/icloud-plus-tv-arcade
1•JustSkyfall•18m ago•0 comments

Relax for the Same Result

https://sive.rs/relax
1•piqufoh•19m ago•0 comments

Phone coverage across the London tube sent me hurtling down a tunnel of despair

https://www.theguardian.com/commentisfree/2026/sep/14/phone-coverage-tube-london-underground-tube
3•edward•21m ago•0 comments

Using steal time to moderate CPU demands

https://lwn.net/Articles/1090381/
1•signa11•25m ago•0 comments

A Pause for the Python JIT

https://lwn.net/Articles/1090385/
4•signa11•26m ago•0 comments

Show HN: A web page that counts its own visitors and cannot lie

https://ava-wall.surge.sh
1•ava-14•35m ago•0 comments

Jev is trained on 100% synthetic data

https://twitter.com/CompleteSkeptic/status/2100617775823966680
1•rinesh•38m ago•0 comments

Show HN: Fouine – local full-text and semantic search for scanned PDFs on macOS

https://github.com/basedpolymer/fouine
1•basedpolymer•41m ago•0 comments

What to Expect When You're Expecting (A World of Multi-Agent Systems)

https://asteriskmag.com/issues/15/what-to-expect-when-you-re-expecting-a-world-of-multi-agent-sys...
1•ronfriedhaber•41m ago•0 comments

Dxui – A declarative desktop GUI framework for Go, without cgo

https://github.com/dxui-org/dxui
1•truda•44m ago•0 comments

Hugging Face attack: "This might be the clearest warning shot we ever get" [video]

https://www.youtube.com/watch?v=X50zezLFWWI
1•looofooo0•45m ago•0 comments

Eight language models and the 2026 Berlin state election

https://wahl.ksmn.dev/en/
2•hemartin•45m ago•0 comments

Cassette-shaped MP3 player meant to be played on tape decks [video]

https://www.youtube.com/watch?v=otXrFBq0HWQ
1•eps•46m ago•0 comments

FeatureMap – map your product's features

https://github.com/yonathan06/featuremap
1•yonatan06•46m ago•0 comments

Why dynamic balance matters at 1200M/min

1•AmyraZhao•47m ago•0 comments

Gyazo screen capture tool confirms data breach

https://updates.gyazo.com/notice-and-apology-regarding-a-data-breach-resulting-from-unauthorized-...
2•2sf5•49m ago•0 comments

What to Read to Stay Grounded Amidst AI Doomerism

https://buttondown.com/maiht3k/archive/what-to-read-to-stay-grounded-amidst-ai-doomerism/
1•james_mir•53m ago•0 comments

The Entity Service Antipattern

https://www.michaelnygard.com/blog/2017/12/the-entity-service-antipattern/
1•simianwords•57m ago•0 comments