frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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 Anatomy of a Learning Stall

https://tagide.com/blog/llm/the-anatomy-of-a-learning-stall/
1•denotational•30s ago•0 comments

A Proposal for an Open Credential Lifecycle Standard

https://gist.github.com/abrambailey/086c1cc4f6417a1f504ef7360962dbfc
1•funkdified•46s ago•0 comments

Ask HN: Who here still codes without AI, and why?

1•jakemanger•3m ago•0 comments

Reverse Engineered Razer Keyboard Control

https://www.rizldizl.com/
1•scienceisneato•8m ago•1 comments

The best/only way to get VCs to pay for a new systems programming language

https://ziggit.dev/t/allocators-in-zig-and-what-can-be-better-in-another-language/11755
1•burglins•9m ago•0 comments

There Is No Sound of the 2020s. Yet

https://ra.co/features/4505
1•volfenstein•10m ago•0 comments

A Modern Proxmox Docker Architecture with Disposable VMs, VirtIO-FS, and ZFS

https://du.nkel.dev/blog/2026-05-16_rootless_docker_virtiofs_proxmox/
1•Helmut10001•13m ago•0 comments

From the Legendary Lft: Microcontroller Magic ("Sum Ergo Demonstro") [video]

https://www.youtube.com/watch?v=0_9YS2tsdYc
1•ttsiodras•15m ago•0 comments

Static Web Server

https://static-web-server.net/
2•igoose1•15m ago•0 comments

I'm a Philosophy Professor. Here's Why I'm Training AI to Replace Me

https://www.chronicle.com/article/im-a-philosophy-professor-heres-why-im-training-ai-to-replace-me
1•KnuthIsGod•21m ago•0 comments

The world of Japanese train melodies [video]

https://www.youtube.com/watch?v=-KxQIEhsFQk
1•vinhnx•22m ago•0 comments

The Vientiane Mystery: When a Taxi Apps Randomly Stops Working

https://gist.github.com/Usernameisalreadytaken5/a0bc0e204008b9ed1b404437db5f59cd
1•jondoe•23m ago•0 comments

Show HN: Bgbgone – local Mac background remover CLI – MIT

https://github.com/Arthur-Ficial/bgbgone
1•franze•24m ago•0 comments

C++: The Programming Language Cover Raises Unanswered Questions

https://devblogs.microsoft.com/oldnewthing/20260401-00/?p=112180
1•birdculture•24m ago•0 comments

The "Cat-Cam": Using Go and an Old Nokia Android to Catch a Midnight Intruder

https://medium.com/@premkumarbhaskal/the-cat-cam-using-go-and-an-old-nokia-android-to-catch-a-mid...
2•Pbhaskal•24m ago•1 comments

Using the Screen Capture API to record a browser window

https://alexwlchan.net/2026/record-browser-video/
1•Tomte•28m ago•0 comments

Ask HN: What are some agent-coded masterpieces?

1•xyzal•28m ago•1 comments

A Little Explanation of Little's Law

https://rugu.dev/en/blog/littles-law/
3•signa11•29m ago•1 comments

The US Needs Mechanics and Electricians.Big Business Is Spending to Create Some

https://www.wsj.com/business/autos/the-u-s-needs-mechanics-and-electricians-big-business-is-spend...
1•KnuthIsGod•29m ago•0 comments

The Grad Student Who Broke Microplastics Research

https://drstanfield.com/en-eu/blogs/articles/the-grad-student-who-broke-microplastics-research
2•mpweiher•46m ago•0 comments

Memory Caching: RNNs with Growing Memory

https://arxiv.org/abs/2602.24281
1•dmichulke•47m ago•0 comments

Writing your own print function in C without Libc

https://linux-is-best.pckt.blog/writing-your-own-print-function-16xt8wv
1•ghodawalaaman•53m ago•0 comments

Spotify no OAuth,no premium web API fetching

1•nntlol•53m ago•0 comments

Nike can't just do it any more

https://economist.com/1843/2026/06/05/nike-cant-just-do-it-any-more
2•andsoitis•56m ago•0 comments

Project the aircraft passing overhead onto your ceiling, in real time

https://github.com/cpaczek/skylight
2•phantomathkg•1h ago•1 comments

Show HN: Kyushu – A self-hostable WASM sandbox for JavaScript workers

https://kyushu.dev/
1•le_chuck•1h ago•0 comments

Show HN: WinkTerm – AI that shares the same PTY as you in the terminal

https://github.com/Cznorth/winkterm
1•Cznorth•1h ago•0 comments

Help Nearby – humanitarian map with UN data integration

https://help-nearby.org
1•Hyrezyxx•1h ago•0 comments

Retrospective

https://neverworkintheory.org/2024/03/21/retrospective.html
1•jruohonen•1h ago•0 comments

Dimitri Bertsekas

https://en.wikipedia.org/wiki/Dimitri_Bertsekas
1•tosh•1h ago•0 comments