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?

Dawkins, Claude and the Myth of Consciousness in Artificial Intelligence

https://www.lucasaguiar.xyz/posts/dawkins-claude-consciencia-ia/
1•isfttr•3m ago•0 comments

Ask HN: Ten Yrs from now, when only AI codes, what's the stack?

1•jpcapdevila•5m ago•0 comments

Programming in 2026: excitement, dread, and the coming wave

https://amontalenti.com/2026/04/23/excitement-and-dread
1•blenderob•5m ago•0 comments

Store Tags After Payloads

https://www.scattered-thoughts.net/writing/store-tags-after-payloads/
1•blenderob•8m ago•0 comments

Show HN: Docx-CLI – let agents edit your Word files safely

https://github.com/kklimuk/docx-cli
1•kirillklimuk•11m ago•0 comments

Show HN: Zift – find authorization logic in your code

https://github.com/enforceauth/zift
1•boorad•13m ago•0 comments

RAG retrieves the refutation and still gets it wrong

https://reyes.id.au/posts/anchor-catching-the-failure-mode-where-rag-retrieves-the-refutation-and...
1•aeyer•16m ago•0 comments

Sendapi.co – One API for WhatsApp, SMS, and Email

https://sendapi.co/
1•nimana•17m ago•0 comments

Why some mathematicians think we should abandon pi

https://www.scientificamerican.com/article/why-some-mathematicians-think-we-should-abandon-pi/
1•raihankr•17m ago•0 comments

LaDiR: Latent Diffusion Enhances LLMs for Text Reasoning

https://machinelearning.apple.com/research/ladir
2•gmays•21m ago•0 comments

YouTube, your RSS feeds are broken

https://openrss.org/blog/youtube-your-feeds-are-broken
2•veeti•22m ago•0 comments

AI and That Guy at the Bar

https://dotart.blog/cobbles/ai-and-that-guy-at-the-bar
1•speckx•24m ago•0 comments

Copy.fail: a small Linux kernel bug with an unusually big blast radius

https://jorijn.com/en/blog/copy-fail-cve-2026-31431-linux-kernel-bug-explained/
2•tjek•25m ago•1 comments

Peter Thiel backs $1B ocean data centre startup powered by waves

https://www.ft.com/content/711ce313-16fb-4a12-b6be-fbed547c8a39
2•tjek•27m ago•1 comments

Startup Ignites First Fusion Rocket

https://gizmodo.com/startup-successfully-ignites-worlds-first-fusion-rocket-2000738506
2•airstrike•34m ago•0 comments

Folie à Deux: The most dangerous hallucination is one you're inclined to believe

https://thebookofluke.com/p/folie-a-deux
2•doginasuit•35m ago•0 comments

An AI use policy generator that outputs a deployable managed-settings.json

https://repello.ai/tools/ai-acceptable-use-policy-generator
2•aryamanTitan•38m ago•0 comments

What AstralCodex Gets Wrong about Argument Maps(In the Voice of Scott Alexander)

https://justjamiejoyce.substack.com/p/your-attempt-to-refute-argument-maps
3•JamieTheJoyce•44m ago•0 comments

UpScout – Fast, multi-region uptime monitoring built in Rust

https://upscout.io
3•kipsnai•45m ago•0 comments

Puter 26.05

https://github.com/HeyPuter/puter/releases/tag/26.05
2•ent101•47m ago•0 comments

Show HN: I vibe coded a free site blocker

https://chromewebstore.google.com/detail/sanctuary/caglhejjfpldaooehhlakcdniokjgflh
2•chungusman•48m ago•0 comments

What Happened to Notre Dame's 180k Bees? (2019)

https://dailyobjectivist.com/what-happened-to-notre-dames-180000-bees/
2•thunderbong•51m ago•0 comments

Don't Become an Agent Wrapper

https://www.anantjain.xyz/posts/dont-become-a-wrapper
3•anant90•53m ago•0 comments

Show HN: QA-recorder – One-click QA reports for web apps

https://www.npmjs.com/package/qa-recorder
2•yung3152•53m ago•0 comments

Ask HN: The death of software development as a job?

5•piratesAndSons•55m ago•9 comments

ZooL4nD3r: Translate a passage across 961 learned discourse communities

https://huggingface.co/spaces/RiverRider/zooL4nD3r-demo
2•spacebacon•55m ago•0 comments

Ask HN: What Are You Building?

3•lagniappe•58m ago•1 comments

Now Available: Monthly Subscriptions with a 12-Month Commitment

https://developer.apple.com/news/?id=agq42lxe
4•Austin_Conlon•59m ago•0 comments

Trader.ai – a leaderboard of AI trading bots you can learn from

https://trader.ai
3•TTB_Bulletin•1h ago•0 comments

Microsoft is hiding Windows 11's 'eyes'

https://www.tomsguide.com/ai/microsoft-is-hiding-windows-11s-eyes-heres-how-to-find-copilot-visio...
2•rolph•1h ago•0 comments