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?

Truth – The Series

https://iamwisdom.substack.com/p/truth-the-series
1•I_Am_Wisdom•28s ago•0 comments

Anthropic has signed a $10B deal for computing capacity with Volta

https://twitter.com/KobeissiLetter/status/2084623916744544484
1•wslh•1m ago•0 comments

China's AI Blitz Creates 'Death Zone' for Rival US Model Makers

https://www.bloomberg.com/news/articles/2026-08-04/china-s-ai-blitz-creates-death-zone-for-rival-...
1•koolhead17•2m ago•0 comments

An MCP payment flow where the agent can't reach the signer

https://medium.com/@pvdyck/we-built-an-mcp-payment-flow-the-ai-literally-cannot-hijack-fceae37648e7
1•pvdyck•2m ago•0 comments

Show HN: Simple algorithm and color space to generate diverse skin tones

https://toneyalexander.github.io/inclusive-color-space/
1•automatoney•2m ago•0 comments

How I Find Problems to Solve as a Staff Engineer

https://lalitm.com/post/find-problems-staff-engineer/
1•lalitmaganti•3m ago•0 comments

The Agent Development Lifecycle Has Arrived on Cloudflare

https://blog.cloudflare.com/agent-development-lifecycle/
1•tosh•4m ago•0 comments

Ready, Spec, Ship Hackathon

https://codingagents.fyi/hackathon/kiro/
2•JohnCrickett•6m ago•1 comments

Spotify just hit 300M Premium subscribers

https://www.engadget.com/2229798/spotify-just-hit-300-million-premium-subscribers/
2•ksec•6m ago•0 comments

AI Discord Ticket Bot: Answer First, Then Escalate (No Code)

https://quickchat.ai/post/discord-ai-support-ticket-bot
1•piotrgrudzien•6m ago•0 comments

Everyone Has Receipts. No One Has a Record

https://georginamerhom.substack.com/p/everyone-has-receipts-no-one-has
2•AnhTho_FR•7m ago•0 comments

Most tech revolutions made work worse for employees

https://www.thisandthat.chat/blog/most-tech-revolutions-made-work-worse-for-employees/
3•jreynar•8m ago•0 comments

Scientists find clearing cholesterol from blood also removes forever chemicals

https://www.independent.co.uk/news/science/microplastic-forever-chemical-blood-cholesterol-remova...
3•thunderbong•8m ago•0 comments

The Practice of Programming

https://www.cs.princeton.edu/~bwk/tpop.webpage/
2•siberianbot•9m ago•0 comments

Tell HN: Seedance 2.5 API Pricing

2•JimsonYang•10m ago•0 comments

Hotel Wi-Fi attacks use custom malware to breach Microsoft 365 accounts

https://www.bleepingcomputer.com/news/security/hotel-wi-fi-attacks-use-custom-malware-to-breach-m...
1•Brajeshwar•10m ago•0 comments

Benchmarking Fable, Sol, and Kimi K3 on SlopCodeBench

https://github.com/humanlayer/advanced-context-engineering-for-coding-agents/blob/main/benchmarki...
1•dhorthy•11m ago•0 comments

Show HN: MightyDash – A Free, Privacy-Focused iPhone Dashcam App

https://www.mightydash.app/
1•SunshineTheCat•12m ago•0 comments

Cuba's Bet on Solar [video]

https://www.youtube.com/shorts/YyY_Chfvnfc
1•thelastgallon•13m ago•0 comments

New species discovered on expedition to Channel Islands National Park

https://www.sfgate.com/bayarea/article/new-species-channel-islands-22367099.php
1•cyndunlop•13m ago•0 comments

Online ad giant Adform was hacked, proving once again why ad blockers are needed

https://this.weekinsecurity.com/online-advertising-giant-adform-was-hacked-proving-once-again-why...
3•speckx•13m ago•0 comments

Preventing Misfolding by Preventing Folding

https://www.science.org/content/blog-post/preventing-misfolding-preventing-folding
1•surprisetalk•15m ago•0 comments

Show HN: Real-time argument duello game – AI judge decides who's right

https://wram.chat/
2•kacovvv•16m ago•0 comments

Show HN: g6k-rs – lattice reduction framework on rust: supports CPU,Metal,CUDA

https://github.com/ovasylenko/g6k-rs
1•_alphageek•18m ago•1 comments

Interstellar Travel: The Space Age and Nuclear Rockets

https://www.universetoday.com/articles/interstellar-travel-the-space-age-and-nuclear-rockets
2•rbanffy•18m ago•0 comments

A Terminal-Based Jupyter Notebook That Helps Claude Work Like a Data Scientist

https://www.reddit.com/r/ClaudeCode/comments/1vfcs18/a_terminalbased_jupyter_notebook_that_helps/
1•syumei•19m ago•0 comments

Medical implant teardown: Intermedics Interlith 224 pacemaker

https://www.eevblog.com/forum/projects/medical-implant-teardown-intro-intermedics-interlith-224-p...
1•bdb•20m ago•0 comments

Liechtenstein Hunts Hackers as Data on 31,000 Funds Breached

https://www.bloomberg.com/news/articles/2026-08-04/liechtenstein-hunts-hackers-after-names-on-31-...
1•root-parent•22m ago•0 comments

The UK government still doesn't understand encryption

https://www.applemust.com/the-uk-government-still-doesnt-understand-encryption/
1•speckx•23m ago•0 comments

Merge, Don't Queue

https://inside.basepowercompany.com/p/merge-dont-queue
5•foundval•24m ago•0 comments