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?

40 Years Ago, Oceanographers Found the Wreckage of the RMS Titanic

https://nautil.us/40-years-ago-oceanographers-found-the-wreckage-of-the-rms-titanic-1284740
1•Brajeshwar•36s ago•0 comments

Why Short AI Coding Prompts Can Cost You More Time

https://deanhume.com/why-short-ai-coding-prompts-can-cost-you-more-time/
1•speckx•44s ago•0 comments

Io_uring I/O Can Outlive a Reaped Process

https://blog.ydb.tech/is-there-i-o-after-death-what-happens-to-io-uring-when-a-process-dies-92c65...
1•eivanov89•1m ago•1 comments

Show HN: A website anyone can edit through auto-merged GitHub PRs

https://pushthis.github.io/buildmysite/
1•terpinedream•2m ago•0 comments

New York Times and The Athletic workers demand company scrap Kalshi deal

https://newsguild.org/new-york-times-and-the-athletic-workers-demand-company-scrap-kalshi-deal/
1•ChrisArchitect•3m ago•0 comments

A Transformer Plays Tic-Tac-Toe

https://sbondaryev.dev/articles/transformer
1•vismit2000•4m ago•0 comments

Justifying text by hand, now at 35 columns

https://en.andros.dev/blog/079a7eaa/justifying-text-by-hand-now-at-35-columns/
1•andros•4m ago•0 comments

RSA-260 Factored

https://twitter.com/penlume/status/2095372672356212876
1•madars•6m ago•1 comments

Astronomers Detect a 10-Sided Structure in Saturn's Atmosphere

https://www.sciencealert.com/astronomers-spot-an-uncannily-geometric-10-sided-structure-in-saturn...
1•jjgreen•7m ago•0 comments

Fuck Off as a Service (Foaas)

https://foaas.io/
2•speckx•7m ago•0 comments

Show HN: A newsletter about systems performance, scalability, and efficiency

https://nodestonanoseconds.substack.com/
1•iandyh•10m ago•0 comments

AI could have written this post

https://heyjonny.dev/posts/ai-could-have-written-this-post/
1•heyjonny•10m ago•0 comments

Sitelo – Static Site Generator

https://sitelo.dev/
1•paulbrowne•10m ago•0 comments

Coloring the Snub Dodecahedron

https://neizod.dev/2026/08/08/coloring-snub-dodecahedron.html
1•vismit2000•11m ago•0 comments

Active Inference: The Free Energy Principle in Mind, Brain, and Behavior

https://direct.mit.edu/books/oa-monograph/5299/Active-InferenceThe-Free-Energy-Principle-in-Mind
1•teleforce•12m ago•0 comments

Show HN: DumbDetector – Community signals for AI tool problems

https://dumbdetector.net/
2•mauroherrera•13m ago•0 comments

ARKM KERNEL approaching you soon

1•project_silenc•15m ago•0 comments

Ask HN: Is SpaceXAI taking Claude down too?

3•redm•16m ago•0 comments

Balrogg: Demonically compacting (up to 15%) lossless Vorbis/Opus recompressor

https://github.com/iczelia/balrogg
3•palaiologos•17m ago•0 comments

The Cognitive Revolution (When Machines Do the Thinking)

https://twitter.com/Konstantine/status/2095166660223397963
1•gmays•18m ago•0 comments

ICE Has a $2M Contract for Spyware That Can Hack Phones Without a Click

https://www.military.com/ice-has-a-2-million-contract-for-spyware-that-can-hack-phones-without-a-...
4•miohtama•18m ago•0 comments

Show HN: Litelink – local-first, embedded stream capture into Iceberg tables

https://github.com/nhobin219/litelink
3•jnbh•19m ago•2 comments

Raycast now requires a subscription for BYOK and local models

https://manual.raycast.com/ai/byoai
1•jskull•19m ago•1 comments

Show HN: Pangolin – SSO and WireGuard instead of API keys for LLM access

https://github.com/fosrl/pangolin
3•miloschwartz•20m ago•1 comments

Life Is Bigger Than GPUs

https://twitter.com/pejmannozad/status/2095345765594075321
1•tosh•20m ago•0 comments

Paid Phones

https://thebaffler.com/salvos/paid-phones-kolitz
2•colinprince•20m ago•1 comments

Vibe Coding Does Not Have One Definition, It Has One per Developer

https://dupflo.dev/blog/vibe-coding-has-one-definition-per-developer/
1•dupflo•21m ago•0 comments

An AI agent sliced through an enterprise defenses in 10 hours

https://unit42.paloaltonetworks.com/ai-assisted-cyber-attack-inside-a-unit-42-investigation/
1•scottmas•21m ago•0 comments

21st Revision of Patches for Getting Linux to Shutdown Devices Asynchronously

https://www.phoronix.com/news/Linux-Shutdown-Async-21
1•Bender•21m ago•0 comments

Live Atomic Spatial Audio

https://panaudia.com/
2•paulharter•22m ago•0 comments