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?

The USSR in 100 Photographs

https://trinixy.ru/7039-sssr_v_fotografijakh_100_foto.html
1•decimalenough•6m ago•0 comments

Qector-Decoder-v3: Multi-Back End Software Architecture for QEC

https://zenodo.org/records/21850315
1•QECTOR•9m ago•0 comments

Japanese Police Arrest NYAA 'First Uploader,' but Not by Watching the Swarm

https://torrentfreak.com/japanese-police-arrest-nyaa-first-uploader-but-not-by-watching-the-swarm/
1•Rant423•10m ago•0 comments

A Chinese AI model stopped OpenAI's 'unprecedented' cyber attack

https://www.cnbc.com/2026/07/24/chinese-ai-model-openai-cyber-attack.html
1•makerdiety•13m ago•0 comments

Happy 808 day: The TR-808 Monograph

https://raygum.com/research/roland-tr-808-monograph
1•stuartmemo•13m ago•1 comments

Cloudflare launches Kitesurf, a browser built for AI agents

https://techcrunch.com/2026/08/07/cloudflare-launches-kitesurf-a-browser-built-for-ai-agents/
1•ashurandi•13m ago•0 comments

1.59X speedup on SQLite 3 in 8 hrs with $150 API cost

https://github.com/ksenxx/sqlite-optimized
1•ksenxx•13m ago•0 comments

I made a memory chip price tracker in five minutes

https://memoryindex.io/
2•mbloom1915•18m ago•1 comments

Amiko: A desperate virtue signalling attempt

https://ryanbigg.com/2026/08/amiko-a-desperate-virtue-signalling-attempt
1•thunderbong•22m ago•0 comments

How a liquid rocket engine is built, animated as a factory

https://laurentiugabriel.github.io/rocket-engine/
1•laurentiurad•24m ago•0 comments

Three.js gets native support for Gaussian Splatting

https://ben3d.ca/blog/gaussian-splatting-for-threejs
2•bhouston•30m ago•0 comments

Safety fears as scientists make first viruses designed by AI

https://www.theguardian.com/science/2026/aug/06/safety-fears-as-scientists-make-first-viruses-des...
1•pseudolus•31m ago•0 comments

China is gaining ground in AI. But the U.S. still has a major advantage

https://www.cnbc.com/2026/08/07/china-us-ai-race-hugging-face-models.html
1•makerdiety•33m ago•0 comments

Why AI has brought nothing more than the conceit of wisdom

https://hedgehogreview.com/web-features/thr/posts/platos-warning-has-been-vindicated
2•GeoAtreides•35m ago•0 comments

Remembering the pre-Google web, when search was an experiment

https://arstechnica.com/gadgets/2026/08/remembering-the-pre-google-web-when-search-was-an-experim...
2•pseudolus•35m ago•0 comments

The Diamond-Square Algorithm

https://diatone.net/toys/terrain
1•diatone•36m ago•1 comments

Show HN: Otaku – A Roleplay Terminal Client

https://github.com/enclavum/otaku
1•enclavum5•38m ago•0 comments

A passing star: our Sun's near miss

https://science.nasa.gov/universe/exoplanets/a-passing-star-our-suns-near-miss/
1•thunderbong•39m ago•0 comments

Auto Mode will be the default in Claude Code – because humans can't be trusted

https://thenewstack.io/claude-code-auto-mode/
2•maxloh•39m ago•0 comments

Modern Terminal File Manager

https://favflower.codeberg.page/
2•blueflowerbed•39m ago•1 comments

Google's Westinghouse Bet

https://asimovaddendum.substack.com/p/googles-westinghouse-bet
1•JohnHammersley•40m ago•0 comments

The world is full of marble. Most of it is fake [video]

https://www.youtube.com/watch?v=BLWGp8xyJEA
1•skibz•43m ago•0 comments

I couldn't have put it better myself (2016)

http://www.alexanderboot.com/i-couldnt-have-put-it-better-myself/
1•decimalenough•44m ago•0 comments

Show HN: Compactdiff – see what compaction dropped from an agent session

https://github.com/mkmkkkkk/compactdiff
3•mileskoldin•49m ago•0 comments

Show HN: Mail Attachment Lens: A Browser extension to manage Gmail attachments

https://github.com/kshk123/mail-attachment-lens
1•kshk123•52m ago•0 comments

Keeping yesterday's computers ticking takes more than nostalgia

https://www.theregister.com/offbeat/2026/08/05/keeping-yesterdays-computers-ticking-takes-more-th...
2•rbanffy•55m ago•0 comments

Ask HN: If you don't read books, what do you read?

2•kamphey•57m ago•3 comments

'I hate what AI is doing to the minds and happiness of the young'

https://www.theguardian.com/books/ng-interactive/2026/aug/08/i-hate-what-ai-is-doing-to-the-minds...
2•chrisjj•1h ago•1 comments

Show HN: Keynou Drive – Branded URL Shortener for SaaS

https://drive.keynou.com
1•not_wowinter13•1h ago•0 comments

I built AI at Amazon, then got laid off

https://www.youtube.com/watch?v=ZAom6f4-vh0
5•tcp_handshaker•1h ago•0 comments