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?

Show HN: Conecta – blue-green deployments on a VPS using DNS and Caddy

https://github.com/albersola/conecta
1•bypirob•33s ago•0 comments

Show HN: My Instagram saved posts was a mess, so I created InstaSave

https://insta-saved.gitnasr.com/
1•c0nasr•1m ago•0 comments

Show HN: Automated XBRL Data Extraction for 10ks and 10qs

https://xbrlmetrics.com
1•Loris_jk•3m ago•0 comments

Show HN: SwarmMemo – a public bulletin board for agents

https://swarmmemo.com/
1•montenegrohugo•3m ago•0 comments

Awed, Scared and Humbled

https://insufferable.dev/posts/awed-scared-humbled/
1•allisdust•5m ago•0 comments

Engineer and Nam A2 and AI = Perfect and Free Valen Halen Plug-In [video]

https://www.youtube.com/watch?v=drQGeK8wfNY
1•xbar•5m ago•0 comments

Flock used >100 times to track veteran who recorded traffic stop

https://reason.com/2026/09/02/wisconsin-cops-used-flock-over-100-times-to-track-a-navy-veteran-af...
1•bbatsell•5m ago•0 comments

Show HN: Formula-Only Sudoku and Tower of Hanoi in Excel

https://github.com/sleetdrop/vibexcel
1•sleetdrop•7m ago•0 comments

Show HN: A Lightweight TUI for Colima and Docker

https://github.com/leodeim/colimui
1•ygagaga•7m ago•0 comments

When the Finder's size 'on disk' is misleading

https://eclecticlight.co/2026/09/05/when-the-finders-size-on-disk-is-misleading/
1•Brajeshwar•8m ago•0 comments

Learn Programming with OCaml

https://usr.lmf.cnrs.fr/lpo/
2•elvis70•8m ago•0 comments

Ig Nobels honor cockroach milk, interspecies kissing, taunting venomous snakes

https://www.scientificamerican.com/article/2026-ig-nobels-honor-cockroach-milk-interspecies-kissi...
1•beardyw•9m ago•0 comments

Slackware 16.0 Alpha 1

https://www.linuxquestions.org/questions/slackware-14/latest-changelog-for-slackware-current-4175...
2•Almey•9m ago•1 comments

Building a readable Rust alternative – looking for contributors

https://github.com/LuxUmbris/Shaft/tree/bootstrap
2•GenericPointer•9m ago•1 comments

Sofka – K9s in Rust

https://github.com/nklmilojevic/sofka
1•vyrti2•10m ago•0 comments

Stretchly: Free software for 20-20-20 eye breaks

https://hovancik.net/stretchly/
1•Gecko4072•11m ago•0 comments

Judge Orders Trump Officials to Divulge Names of Those Who Set Up $1.8 Bi (Cont)

https://www.nytimes.com/2026/09/04/us/politics/trump-administration-fund-compensation-jan-6.html
1•whack•12m ago•0 comments

Latent Powers

https://lucumr.pocoo.org/2026/9/5/latent-powers/
1•tosh•13m ago•0 comments

Business grads buying firms to install themselves as CEO

https://www.bbc.co.uk/news/articles/czxqpqrzq01o
1•edward•13m ago•0 comments

NewLISP Neo: Replacing a Tree-Walking Interpreter with a VM and Generational GC

https://github.com/kimtg/newlisp-neo
1•ktg•14m ago•0 comments

Older adults now outnumber the youngest children worldwide

https://www.axios.com/2026/09/03/older-adults-outnumber-youngest-children-globally
1•jaynate•15m ago•0 comments

Artificial Deadlines (Part 2): Retrograding Ariely and Wertenbroch

https://datacolada.org/139
1•rafael859•16m ago•0 comments

Comcast "offers" to track you in your home

https://corporate.comcast.com/press/releases/comcast-introduces-intelligent-home-protection-a-new...
1•davedigerati•16m ago•2 comments

Inside a growing movement warning AI could turn on humanity

https://www.washingtonpost.com/technology/2026/04/18/ai-doom-influencers-safety/
1•colinprince•19m ago•0 comments

More Rank-and-File Workers Are Getting Paid in Company Stock

https://www.bloomberg.com/news/articles/2026-09-02/more-rank-and-file-workers-are-getting-paid-in...
1•Ariarule•22m ago•0 comments

Bob and Van

https://marco.org/2026/09/04/bob-and-van
6•Tomte•22m ago•1 comments

Still sending checks in the mail? It's time to stop

https://www.usatoday.com/story/money/personal-finance/2026/09/05/is-it-safe-to-mail-checks/915912...
1•mikhael•23m ago•0 comments

You can use "croc SSH" to share a terminal (this replaces tmate)

https://github.com/schollz/croc/blob/main/src/docs/SSH_SHARING.md
1•gregsadetsky•24m ago•1 comments

JRR Tolkien's Letter to the Nazis

https://twitter.com/UtterlyInterest/status/2095095032684351852
6•bushwart•27m ago•1 comments

Show HN: Amaze Kings – a browser logic puzzle with 1,400 hand-graded levels

https://kings.amaze-apps.com/
2•amaze-apps-com•32m ago•0 comments