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?

Terminal and Panel Reorganization in RexIDE

https://www.youtube.com/watch?v=EgvDd6_kidQ
1•tomerbd•3m ago•0 comments

Install F-Droid apps over USB straight from the browser

https://droidstore.megahard.pro/
1•bboygravity•4m ago•1 comments

New studies suggest consciousness exists in organisms without brains

https://iai.tv/articles/new-studies-suggest-consciousness-exists-in-organisms-without-brains-auid...
2•XzetaU8•7m ago•1 comments

I built a WordPress plugin for simple content statistics and stylometry markers

https://github.com/alexboia/ABNET-PostStats
1•alexandruboia•8m ago•0 comments

Iranian Guards' business empire to win big if U.S. sanctions lifted

https://www.reuters.com/world/middle-east/iranian-guards-business-empire-win-big-if-us-sanctions-...
1•JumpCrisscross•8m ago•0 comments

When a Robot Kicks a Child

https://www.law.kuleuven.be/citip/blog/when-a-robot-kicks-a-child-what-humanoid-ai-can-teach-us-a...
1•jruohonen•10m ago•0 comments

UK unveils prototype missiles for Ukraine with no US components

https://www.ft.com/content/78d880ee-f5cd-4f58-ba8d-da8f2193d95a
2•JumpCrisscross•11m ago•0 comments

A Chin-Stroking Mystery: Why Are Humans the Only Animals with Chins?

https://www.smithsonianmag.com/smart-news/chin-stroking-mystery-why-are-humans-ony-animals-with-c...
1•thunderbong•11m ago•0 comments

VLMs cannot automate construction takeoff. The data is not in the drawings

https://andrewngo.dev/writing/the-limits-of-takeoff-automation
1•andrewngo•16m ago•0 comments

Updated UI icons on Wikimedia Foundation sites (including Wikipedia)

https://phabricator.wikimedia.org/T399175
1•exploraz•17m ago•1 comments

How Many Words Are in a 5 Minute Speech

https://fastwordcount.com/blog/how-many-words-in-a-5-minute-speech/
1•mssblogs•17m ago•0 comments

The CP-SAT Primer: Using and Understanding Google OR-Tools' CP-SAT Solver

https://github.com/d-krupke/cpsat-primer/blob/main/README.md
2•scrlk•21m ago•0 comments

A synthetic order analytics pipeline built on CDC from Postgres to ClickHouse

https://github.com/el10savio/ecommrt
1•ugabuga•25m ago•0 comments

An experiment in building accounting around financial actions instead of forms

https://github.com/hisaabo/hisaabo
2•saurabhsinghvi•27m ago•0 comments

Show HN: CoshUI – A backend-agnostic UI engine for Python game development

https://gitlab.com/jylefv/CoshUI
1•jylefv•28m ago•0 comments

The Hardest Kind of Unsafe Rust

https://oxide-and-friends.transistor.fm/episodes/the-hardest-kind-of-unsafe-rust
1•tosh•32m ago•0 comments

Performance Has Layers

https://oxide.computer/blog/performance-has-layers
1•tosh•34m ago•0 comments

The seven methods for delivering instructions

https://claude.com/blog/steering-claude-code-skills-hooks-rules-subagents-and-more
2•twapi•36m ago•0 comments

Rust in Production: ClickHouse

https://corrode.dev/podcast/s06e06-clickhouse/
1•tosh•36m ago•0 comments

Court Transcript Costs

https://hansard.parliament.uk/commons/2023-11-16/debates/942DF7A1-9D96-43A0-AD65-474A0B30BA1D/Cou...
3•mellosouls•38m ago•0 comments

Pappice – a self-hosted support desk in one Go binary

https://github.com/lallero-dev/pappice
1•lallero317•38m ago•1 comments

Show HN: Created On-Page SEO Tool – AI Action Plans for Search Console Data

https://blogr.ai
2•karakhanyans•42m ago•1 comments

Show HN: APK-interceptor – Android deeplink, Intent assessment helper

https://github.com/sterrasec/apk-interceptor
1•tkmru•45m ago•0 comments

Show HN: Local automation runner with built-in LLM steps – YAML pipelines

https://rorlikowski.github.io/stepyard/
2•rorlikowski•53m ago•0 comments

Show HN: WhatsKept – Searchable,agent-queryable WhatsApp history from iOS backup

https://github.com/alkait/whatskept
1•tenthead•54m ago•0 comments

Maria Isabel Sánchez Vegara on Her 100th "Little People, Big Dreams" Book

https://www.amightygirl.com/blog?p=36753
1•zeristor•1h ago•0 comments

Show HN: F1l0 – Fitness Logger

https://f1l0.nickyreinert.de/
1•y42•1h ago•0 comments

Data Center Warfare: Defending AI Infrastructure

https://mwi.westpoint.edu/data-center-warfare-defending-the-key-terrain-of-ai-infrastructure/
1•Alien1Being•1h ago•0 comments

Show HN: I'm building a free TradingView alternative

https://www.aulico.com
2•rendernos•1h ago•0 comments

Banned

https://netwars.pelicancrossing.net/2026/06/19/banned/
2•ColinWright•1h ago•0 comments