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?

Dead Forest Theory

https://contraptions.venkateshrao.com/p/dead-forest-theory
1•akkartik•30s ago•0 comments

Wing Commander IV and the FMV future that never quite was

https://arstechnica.com/gaming/2026/07/wing-commander-iv-and-the-fmv-future-that-never-quite-was/
1•ulrischa•44s ago•0 comments

Ancient Greek Technology: The Origins of Robotics and Engineering

https://kotsanas.com/news/ancient-greek-technology/
1•andsoitis•3m ago•0 comments

RetroPad: A Tiny Notepad-style Windows text editor ~2.5kb

https://github.com/PlummersSoftwareLLC/TinyRetroPad
1•rishikeshs•3m ago•0 comments

Two nasty surprises in Home Assistant's config

https://blog.frankel.ch/home-assistant/9/
1•edward•4m ago•0 comments

Urban thermal structures in scenarios of hot weather: The Bologna study

https://www.sciencedirect.com/science/article/pii/S2212095526000106?via%3Dihub
1•simonebrunozzi•4m ago•0 comments

QuickFolder: Android Home Screen Organizer and App Launcher

https://play.google.com/store/search?q=QuickFolder&c=apps
1•amm811•5m ago•0 comments

When AI agents get you kicked out from a YC Startup

https://github.com/vaishcodescape/shipd-agent
1•vaishcodescape•7m ago•0 comments

Australia probes mystery space balls that washed up on beach

https://www.bbc.com/news/articles/c1jyydr7jnjo
1•poly2it•8m ago•0 comments

Ghostlog: Live terminal UI to monitor AI coding agent Git commits

https://github.com/salarkhannn/ghostlog
1•salarkhannn•8m ago•0 comments

Paint the Earth on a live interactive globe

https://earth.tattoo/?lat=39.74225&lng=-96.94255&zoom=2.63
2•earth-tattoo•9m ago•0 comments

Chemical accidents rise as Trump administration proposes weakening safety rules

https://insideclimatenews.org/news/30062026/hazardous-chemical-accidents-rise-as-safety-rules-wea...
1•p_stuart82•11m ago•0 comments

Show HN: rockbox-dsp – A reusable Rust DSP library extracted from Rockbox

https://crates.io/crates/rockbox-dsp
1•tsiry•14m ago•0 comments

The Company Founder Who Got Fired for Ignoring His Own Return-to-Office Rules

https://www.wsj.com/business/the-founder-who-got-fired-for-ignoring-his-own-return-to-office-rule...
1•berkeleyjunk•21m ago•0 comments

Show HN: Meon – declarative flat-parsing engine (SoA, no AST)

https://github.com/vgnapuga/meon
1•vgnapuga•24m ago•0 comments

Show HN: Aletheia – The Uncertainty Loop Agent for Claude Code and Codex

https://github.com/nsankar/Aletheia
1•sankarn_ai•25m ago•0 comments

Engram – persistent memory for AI agents, in-process, no cloud

https://github.com/HBarefoot/engram
2•barefootdifital•31m ago•0 comments

Moving Back Home Used to Be a Sign of Failure. Now It Shows Financial Savvy

https://www.wsj.com/lifestyle/relationships/living-with-parents-finances-0c35530c
3•apparent•33m ago•1 comments

Cursed Gemstones – The Koh-I-Noor Diamond

https://www.vulcans-forge.com/blog/news/cursed-gemstones-the-koh-i-noor-diamond
3•thunderbong•34m ago•0 comments

Longcat

https://longc.at/longcat.html
12•willmeyers•34m ago•0 comments

Istota – a multi-user AI agent and personal OS

https://istota.cynium.com/
5•durakot•35m ago•0 comments

The Computers Used in Movies

https://www.starringthecomputer.com/computers.html
25•gitowiec•35m ago•7 comments

SOLAR: AI-Powered Speed-of-Light Performance Analysis

https://arxiv.org/abs/2606.26383
2•matt_d•39m ago•0 comments

Taphonomic analysis reveals behavioral & tech capabilities of Homo floresiensis

https://www.science.org/doi/10.1126/sciadv.aeb7219
2•bushwart•40m ago•0 comments

Show HN: Goldseam – heal broken Cypress selectors with a local LLM

https://github.com/adam-s/goldseam
2•dataviz1000•41m ago•0 comments

WSL Keeps Getting Better

https://www.xda-developers.com/wsl-keeps-getting-better-and-its-because-microsoft-is-finally-admi...
3•porridgeraisin•41m ago•1 comments

Show HN: Detecting AI slop with regex and Stephen King

https://github.com/guy-lifshitz/tacheles
2•shtofadhor•42m ago•1 comments

Why High-Earning Families Are Leaving Traditional Schools for AI

https://allk12.com/blog/why-high-earning-families-are-leaving-traditional-schools-for-ai
2•misterinfo•42m ago•0 comments

How Bending Spoons built a $23B tech empire from struggling brands

https://www.ft.com/content/040aac86-f458-400b-a353-7ff2ee5aa34f
2•chuckus•42m ago•1 comments

Dead Man's Switch and USB Kill Switch for Linux, Security Project

https://github.com/qxnode/luks-deadman
2•qxnode•44m ago•0 comments