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?

Why the Cookbook Endures

https://tastecooking.com/why-the-cookbook-endures/
1•Tomte•1m ago•0 comments

Electric air taxis are stuck in the courtroom

https://www.theverge.com/column/950975/electric-air-taxis-lawsuits
1•Brajeshwar•2m ago•0 comments

Backporting bug fixes is dead, Project Valkey now sends in the bots

https://thenewstack.io/valkey-ai-backporting-agents/
1•Brajeshwar•2m ago•0 comments

Linux '95

https://www.linuxjournal.com/article/2682
1•theanonymousone•2m ago•0 comments

Vulgar Materialism

https://borretti.me/article/on-vulgar-materialism
1•Tomte•3m ago•0 comments

Show HN: Teach your kids absolute (perfect) pitch

https://github.com/paytonjjones/bsharp
1•paytonjjones•3m ago•0 comments

Printing Gaussian Splats

https://www.patreon.com/DanyBittel/posts/printing-splats-161333338
1•ilnmtlbnm•4m ago•0 comments

Show HN: TermType – a terminal typing game where words fall like Space Invaders

https://github.com/GiovanniCst/termtype
3•J_cst•4m ago•0 comments

Anthropic to Require ID Verification for Certain Capabilities Starting July 8

https://old.reddit.com/r/ClaudeAI/comments/1ubm53n/official_anthropic_to_require_identity/
4•bathory•9m ago•1 comments

Why Mizoram has shops without shopkeepers (2024)

https://timesofindia.indiatimes.com/etimes/trending/why-mizoram-has-shops-without-shopkeepers/art...
1•susam•10m ago•0 comments

Show HN: A GitHub app that suggests code fixes for conversion failures

https://rejourney.co/demo/leaks
2•mrr7337•10m ago•0 comments

Smashing the NIMBYs created modern capitalism

https://worksinprogress.co/issue/how-abolishing-the-stakeholder-state-caused-the-industrial-revol...
1•momentmaker•10m ago•0 comments

Safe SIMD in Rust, Even on the Inside – By Sergey "Shnatsel" Davidoff

https://shnatsel.medium.com/safe-simd-in-rust-even-on-the-inside-c6f1ff381828
1•rbanffy•12m ago•0 comments

Why do sports stadiums have different names for the World Cup? Here's the reason

https://www.thv11.com/article/sports/soccer/world-cup/fifa-world-cup-stadiums-different-names/507...
1•RickJWagner•14m ago•0 comments

Neosolve – SolveSpace fork with OpenCASCADE CAD kernel

https://github.com/0xSeren/neosolve
1•nakedneuron•17m ago•1 comments

Creativity in the form of archived web pages from the dawn of the internet

https://www.cameronsworld.net
2•momentmaker•18m ago•0 comments

How the social media ban could reshape how all of us use the internet

https://www.bbc.co.uk/news/articles/c1jy512r19ro
2•mmarian•19m ago•0 comments

Where the sun stood at the 2026 summer solstice

https://pilgrimapp.org/sunpath/2026-summer-solstice/
1•momentmaker•19m ago•0 comments

Solvespace Web Version

http://orthogonal.cc/solvespace/solvespace.html
1•nakedneuron•19m ago•0 comments

Developer ends Fornjot (CAD kernel) development

https://www.fornjot.app/blog/shutting-down-fornjot/
1•nakedneuron•20m ago•0 comments

Ask HN: Future of Programming?

1•anujmehta•22m ago•0 comments

Pakistan: The solar revolution nobody planned

https://janrosenow.substack.com/p/pakistan-the-solar-revolution-nobody
1•leonidasrup•22m ago•0 comments

Rent Is So High, New Yorkers Are Living with Nuns

https://www.wsj.com/lifestyle/rent-is-so-high-new-yorkers-are-living-with-nuns-00dac324
1•jawns•23m ago•0 comments

Huffman tree compressor and decompressor written in Clojure

https://github.com/netb258/huffman-tree/
1•netb258•25m ago•0 comments

Masochistic YouTuber Punishes Himself by Writing a First Person Shooter in COBOL

https://gizmodo.com/masochistic-youtuber-punishes-himself-by-writing-a-first-person-shooter-entir...
2•rbanffy•26m ago•0 comments

AI Made Me Braver

https://neilkakkar.com/ai-made-me-braver.html
1•neilkakkar•26m ago•0 comments

Local Inference

https://av.codes/blog/on-local-inference/
2•everlier•26m ago•0 comments

Tokoscope – Automatic LLM token compression and cost monitoring in 2 lines

https://tokoscope.com
1•emekuns•28m ago•0 comments

A viral doomsday scenario aims to shake Europe out of its AI complacency

https://www.theguardian.com/technology/2026/jun/20/europe-sleepwalking-ai-disaster-us-china
3•thm•30m ago•0 comments

Counterfactual Quantum Computation

https://en.wikipedia.org/wiki/Counterfactual_quantum_computation
2•dtj1123•35m ago•0 comments